Problem with OOT Interpolator Python module

2021-01-22 Thread George Edwards
Hello,
I am working with the OOT Interpolator template and I set the interpolation
factor to 2. In the QA file I input 5-complex samples  and based on my
simple code below in the work() method, I expect the QA test to return
1+j1, 10-times (5x2). The QA returns ((1+1j), (1+1j), 0j,  0j,  0j,  0j,
0j,  0j,  (1+1j) ,  (1+1j)). I have tried a lot of different coding
permutations and this is the closest I come to a solution, but it is
wrong!!!  Any help is greatly appreciated!

def work(self, input_items, output_items):

in0 = input_items[0]

out = output_items[0]

for ii in range(0,len(in0)):

for k in range(0,2):

out[k] = 1.0+1.0*1j



return len(output_items[0])

Thanks,
George


Re: Problem with OOT Interpolator Python module

2021-01-23 Thread Cinaed Simson
Hi George - I'm presuming the enclosed example.py script is what you're 
trying calculate - and that the input data is complex.


I invented my own data.

If true, it should be easy to adapt it to your problem by combining the 
2 loops for any value of n.


-- Cinaed


On 1/22/21 10:49 AM, George Edwards wrote:

Hello,
I am working with the OOT Interpolator template and I set the 
interpolation factor to 2. In the QA file I input 5-complex samples  
and based on my simple code below in the work() method, I expect the 
QA test to return 1+j1, 10-times (5x2). The QA returns ((1+1j), 
(1+1j), 0j, 0j,  0j,  0j, 0j, 0j,  (1+1j) , (1+1j)). I have tried a 
lot of different coding permutations and this is the closest I come to 
a solution, but it is wrong!!!  Any help is greatly appreciated!


defwork(self, input_items, output_items):

in0 = input_items[0]

out = output_items[0]

for ii inrange(0,len(in0)):

for k inrange(0,2):

out[k] = 1.0+1.0*1j

returnlen(output_items[0])

Thanks,
George



#!/bin/env python3
import cmath
n=4
m=2*n-1
print ("(n,m)=",[n,m])
u=[complex(0, 0) for k in range(n) ]
u[0]=complex(-1,2)
u[1]=complex(3,-3)
u[2]=complex(-4,4)
u[3]=complex(5,-6)
v=[complex(0, 0) for k in range(m) ]
v[0]=u[0]
v[1]=(u[0]+u[1])/2
v[2]=u[1]
v[3]=(u[1]+u[2])/2
v[4]=u[2]
v[5]=(u[2]+u[3])/2
v[6]=u[3]
print ("u=",u)
print ("v=",v)


Re: Problem with OOT Interpolator Python module

2021-01-23 Thread George Edwards
Thanks Cinaed!

I will test how it works.

George

On Sat, Jan 23, 2021 at 2:58 PM Cinaed Simson 
wrote:

> Hi George - I'm presuming the enclosed example.py script is what you're
> trying calculate - and that the input data is complex.
>
> I invented my own data.
>
> If true, it should be easy to adapt it to your problem by combining the 2
> loops for any value of n.
>
> -- Cinaed
>
>
> On 1/22/21 10:49 AM, George Edwards wrote:
>
> Hello,
> I am working with the OOT Interpolator template and I set the
> interpolation factor to 2. In the QA file I input 5-complex samples  and
> based on my simple code below in the work() method, I expect the QA test to
> return 1+j1, 10-times (5x2). The QA returns ((1+1j), (1+1j), 0j,  0j,  0j,
> 0j,  0j,  0j,  (1+1j) ,  (1+1j)). I have tried a lot of different coding
> permutations and this is the closest I come to a solution, but it is
> wrong!!!  Any help is greatly appreciated!
>
> def work(self, input_items, output_items):
>
> in0 = input_items[0]
>
> out = output_items[0]
>
> for ii in range(0,len(in0)):
>
> for k in range(0,2):
>
> out[k] = 1.0+1.0*1j
>
>
>
> return len(output_items[0])
>
> Thanks,
> George
>
>
>


Re: Problem with OOT Interpolator Python module

2021-01-23 Thread George Edwards
Hi Cinaed,

Thanks again for your suggestion.

I can tell it will not work because I am not writing plain stand alone
Python. My code is written within Gnuradio constructs in an OOT module. The
QA test shows the module is reading in the input complex samples (5 complex
samples) and responding with the correct amount of output samples (10
complex samples). However, it was working properly all 10 output samples
would be 1+j1. Instead only the first two and last two samples are correct
and the middle value 6 values are j0 (which are wrong). So the question is:
"how do I fix my code to output 10 samples of 1+j1". Based on how I have
written the code, I am under the belief that I am writing 1+j1 to the
output buffer 10 times, but my output is not 1+j1 10 times, so something is
wrong. So I am looking for help on how to modify the code to fulfill the
proper operation of Gnuradio OOT Interpolator module.

Thanks again for the help.

George



On Sat, Jan 23, 2021 at 7:00 PM George Edwards 
wrote:

> Thanks Cinaed!
>
> I will test how it works.
>
> George
>
> On Sat, Jan 23, 2021 at 2:58 PM Cinaed Simson 
> wrote:
>
>> Hi George - I'm presuming the enclosed example.py script is what you're
>> trying calculate - and that the input data is complex.
>>
>> I invented my own data.
>>
>> If true, it should be easy to adapt it to your problem by combining the 2
>> loops for any value of n.
>>
>> -- Cinaed
>>
>>
>> On 1/22/21 10:49 AM, George Edwards wrote:
>>
>> Hello,
>> I am working with the OOT Interpolator template and I set the
>> interpolation factor to 2. In the QA file I input 5-complex samples  and
>> based on my simple code below in the work() method, I expect the QA test to
>> return 1+j1, 10-times (5x2). The QA returns ((1+1j), (1+1j), 0j,  0j,  0j,
>> 0j,  0j,  0j,  (1+1j) ,  (1+1j)). I have tried a lot of different coding
>> permutations and this is the closest I come to a solution, but it is
>> wrong!!!  Any help is greatly appreciated!
>>
>> def work(self, input_items, output_items):
>>
>> in0 = input_items[0]
>>
>> out = output_items[0]
>>
>> for ii in range(0,len(in0)):
>>
>> for k in range(0,2):
>>
>> out[k] = 1.0+1.0*1j
>>
>>
>>
>> return len(output_items[0])
>>
>> Thanks,
>> George
>>
>>
>>


Re: Problem with OOT Interpolator Python module

2021-01-23 Thread Cinaed Simson
Hi Edward - okay, I sent the wrong copy anyway - the one I sent wasn't 
finished.When I change the inputs to 5 complex numbers I get 9 complex 
values.


And that's good because it appeared you weren't doing anything.

See the loop

  for k in range(0,2)

which is loop over only 3 values - may be you're clipping your output?

I don't anything about the OOT module or C++.

Sorry - I can't help you.

-- Cinaed
S


On 1/23/21 5:37 PM, George Edwards wrote:

Hi Cinaed,

Thanks again for your suggestion.

I can tell it will not work because I am not writing plain stand alone 
Python. My code is written within Gnuradio constructs in an OOT 
module. The QA test shows the module is reading in the input complex 
samples (5 complex samples) and responding with the correct amount of 
output samples (10 complex samples). However, it was working properly 
all 10 output samples would be 1+j1. Instead only the first two and 
last two samples are correct and the middle value 6 values are j0 
(which are wrong). So the question is: "how do I fix my code to output 
10 samples of 1+j1". Based on how I have written the code, I am under 
the belief that I am writing 1+j1 to the output buffer 10 times, but 
my output is not 1+j1 10 times, so something is wrong. So I am looking 
for help on how to modify the code to fulfill the proper operation of 
Gnuradio OOT Interpolator module.


Thanks again for the help.

George



On Sat, Jan 23, 2021 at 7:00 PM George Edwards > wrote:


Thanks Cinaed!

I will test how it works.

George

On Sat, Jan 23, 2021 at 2:58 PM Cinaed Simson
mailto:cinaed.sim...@gmail.com>> wrote:

Hi George - I'm presuming the enclosed example.py script is
what you're trying calculate - and that the input data is
complex.

I invented my own data.

If true, it should be easy to adapt it to your problem by
combining the 2 loops for any value of n.

-- Cinaed


On 1/22/21 10:49 AM, George Edwards wrote:

Hello,
I am working with the OOT Interpolator template and I set the
interpolation factor to 2. In the QA file I input 5-complex
samples  and based on my simple code below in the work()
method, I expect the QA test to return 1+j1, 10-times (5x2).
The QA returns ((1+1j), (1+1j), 0j,  0j,  0j,  0j,  0j, 0j, 
(1+1j) ,  (1+1j)). I have tried a lot of different coding
permutations and this is the closest I come to a
solution, but it is wrong!!! Any help is greatly appreciated!

defwork(self, input_items, output_items):

in0 = input_items[0]

out = output_items[0]

for ii inrange(0,len(in0)):

for k inrange(0,2):

out[k] = 1.0+1.0*1j

returnlen(output_items[0])

Thanks,
George







Re: Problem with OOT Interpolator Python module

2021-01-24 Thread George Edwards
Hi Cinaed,

Thanks for the attempt!

I will continue to seek a solution via experimentation with trying more
permutations and going back to Gnuradio Discussion if I still cannot find
something to stick.

Regards,
George

George

On Sat, Jan 23, 2021 at 11:15 PM Cinaed Simson 
wrote:

> Hi Edward - okay, I sent the wrong copy anyway - the one I sent wasn't
> finished.When I change the inputs to 5 complex numbers I get 9 complex
> values.
>
> And that's good because it appeared you weren't doing anything.
>
> See the loop
>
>   for k in range(0,2)
>
> which is loop over only 3 values - may be you're clipping your output?
>
> I don't anything about the OOT module or C++.
>
> Sorry - I can't help you.
>
> -- Cinaed
> S
>
>
> On 1/23/21 5:37 PM, George Edwards wrote:
>
> Hi Cinaed,
>
> Thanks again for your suggestion.
>
> I can tell it will not work because I am not writing plain stand alone
> Python. My code is written within Gnuradio constructs in an OOT module. The
> QA test shows the module is reading in the input complex samples (5 complex
> samples) and responding with the correct amount of output samples (10
> complex samples). However, it was working properly all 10 output samples
> would be 1+j1. Instead only the first two and last two samples are correct
> and the middle value 6 values are j0 (which are wrong). So the question is:
> "how do I fix my code to output 10 samples of 1+j1". Based on how I have
> written the code, I am under the belief that I am writing 1+j1 to the
> output buffer 10 times, but my output is not 1+j1 10 times, so something is
> wrong. So I am looking for help on how to modify the code to fulfill the
> proper operation of Gnuradio OOT Interpolator module.
>
> Thanks again for the help.
>
> George
>
>
>
> On Sat, Jan 23, 2021 at 7:00 PM George Edwards 
> wrote:
>
>> Thanks Cinaed!
>>
>> I will test how it works.
>>
>> George
>>
>> On Sat, Jan 23, 2021 at 2:58 PM Cinaed Simson 
>> wrote:
>>
>>> Hi George - I'm presuming the enclosed example.py script is what you're
>>> trying calculate - and that the input data is complex.
>>>
>>> I invented my own data.
>>>
>>> If true, it should be easy to adapt it to your problem by combining the
>>> 2 loops for any value of n.
>>>
>>> -- Cinaed
>>>
>>>
>>> On 1/22/21 10:49 AM, George Edwards wrote:
>>>
>>> Hello,
>>> I am working with the OOT Interpolator template and I set the
>>> interpolation factor to 2. In the QA file I input 5-complex samples  and
>>> based on my simple code below in the work() method, I expect the QA test to
>>> return 1+j1, 10-times (5x2). The QA returns ((1+1j), (1+1j), 0j,  0j,  0j,
>>> 0j,  0j,  0j,  (1+1j) ,  (1+1j)). I have tried a lot of different coding
>>> permutations and this is the closest I come to a solution, but it is
>>> wrong!!!  Any help is greatly appreciated!
>>>
>>> def work(self, input_items, output_items):
>>>
>>> in0 = input_items[0]
>>>
>>> out = output_items[0]
>>>
>>> for ii in range(0,len(in0)):
>>>
>>> for k in range(0,2):
>>>
>>> out[k] = 1.0+1.0*1j
>>>
>>>
>>>
>>> return len(output_items[0])
>>>
>>> Thanks,
>>> George
>>>
>>>
>>>
>