Re: Problem with the OOT forecast() method in Python

2022-10-12 Thread George Edwards
Hi Jeff, thanks for bearing with me.

When I retested the last approach just now upon receiving your email it
works. Earlier, l forgot to take out some extraneous stuff in my code,
which broke it. The code snippet I sent implies a one to one relationship
between input and output. The forecaster does its job to ensure the number
of input samples is at least the same size as the output, but in many
instances the input is larger. This, however, will present a problem to the
signal processing algorithm I have in mind which requires the post-pending
samples (the size of my filter) to the end to the incoming data before
upsampling. It seems the forecaster may be too loose in its input/output
sample relationship and will mess up my algorithm.

Anyway, if you have any thought on this and do not mind sharing I would
appreciate it.

Thank again for your assistance.

George

On Wed, Oct 12, 2022, 2:58 PM Jeff Long  wrote:

> The last one looks correct, and would not have given the error you mention
> above. What happened?
>
> On Wed, Oct 12, 2022 at 4:49 PM George Edwards 
> wrote:
>
>> Hi Jeff, thank you very much for the response.
>> I tries:
>> ninput_items_required[0]=[noutput_items]
>> ninput_items_required=[noutput_items]
>> and
>> return [noutput_items]
>> None of these worked for me.
>>
>> Regards
>> George
>>
>> On Wed, Oct 12, 2022, 8:07 AM Jeff Long  wrote:
>>
>>> For Python, the forecast() function should return a list, containing the
>>> number of items required for each input.
>>>
>>> On Wed, Oct 12, 2022 at 8:08 AM George Edwards 
>>> wrote:
>>>
 Hello GNURadio Community,

 I am getting a TypeError when I fill in the code in the forecast()
 method in my Gnuradio OOT block design. I know, if I want to interpolate or
 decimate, I can simply pick the block type in the gr_modtool design menu,
 however, I would like to develop the capability to design my own. Here is
 how I fill in the forecast() method in Python to do either decimation or
 interpolation:

 ninput_items_required[0] = noutput_items*self.sps  # for decimation
 OR
 ninput_items_required[0] = noutput_items/self.sps  # for interpolation

 On running the flowgraph in GRC Console I see TypeError: 'int' object
 does not support item assignment.

 Will appreciate any suggestion to fix this problem.

 George




Re: Problem with the OOT forecast() method in Python

2022-10-12 Thread Jeff Long
The last one looks correct, and would not have given the error you mention
above. What happened?

On Wed, Oct 12, 2022 at 4:49 PM George Edwards 
wrote:

> Hi Jeff, thank you very much for the response.
> I tries:
> ninput_items_required[0]=[noutput_items]
> ninput_items_required=[noutput_items]
> and
> return [noutput_items]
> None of these worked for me.
>
> Regards
> George
>
> On Wed, Oct 12, 2022, 8:07 AM Jeff Long  wrote:
>
>> For Python, the forecast() function should return a list, containing the
>> number of items required for each input.
>>
>> On Wed, Oct 12, 2022 at 8:08 AM George Edwards 
>> wrote:
>>
>>> Hello GNURadio Community,
>>>
>>> I am getting a TypeError when I fill in the code in the forecast()
>>> method in my Gnuradio OOT block design. I know, if I want to interpolate or
>>> decimate, I can simply pick the block type in the gr_modtool design menu,
>>> however, I would like to develop the capability to design my own. Here is
>>> how I fill in the forecast() method in Python to do either decimation or
>>> interpolation:
>>>
>>> ninput_items_required[0] = noutput_items*self.sps  # for decimation
>>> OR
>>> ninput_items_required[0] = noutput_items/self.sps  # for interpolation
>>>
>>> On running the flowgraph in GRC Console I see TypeError: 'int' object
>>> does not support item assignment.
>>>
>>> Will appreciate any suggestion to fix this problem.
>>>
>>> George
>>>
>>>


Re: Problem with the OOT forecast() method in Python

2022-10-12 Thread George Edwards
Hi Jeff, thank you very much for the response.
I tries:
ninput_items_required[0]=[noutput_items]
ninput_items_required=[noutput_items]
and
return [noutput_items]
None of these worked for me.

Regards
George

On Wed, Oct 12, 2022, 8:07 AM Jeff Long  wrote:

> For Python, the forecast() function should return a list, containing the
> number of items required for each input.
>
> On Wed, Oct 12, 2022 at 8:08 AM George Edwards 
> wrote:
>
>> Hello GNURadio Community,
>>
>> I am getting a TypeError when I fill in the code in the forecast() method
>> in my Gnuradio OOT block design. I know, if I want to interpolate or
>> decimate, I can simply pick the block type in the gr_modtool design menu,
>> however, I would like to develop the capability to design my own. Here is
>> how I fill in the forecast() method in Python to do either decimation or
>> interpolation:
>>
>> ninput_items_required[0] = noutput_items*self.sps  # for decimation
>> OR
>> ninput_items_required[0] = noutput_items/self.sps  # for interpolation
>>
>> On running the flowgraph in GRC Console I see TypeError: 'int' object
>> does not support item assignment.
>>
>> Will appreciate any suggestion to fix this problem.
>>
>> George
>>
>>


Help with the Protocol Parser and Header/Payload Demux blocks

2022-10-12 Thread Miguel Angel Champi Castro
Hello, I'm Miguel and I'm trying to do a flowgraph using the Header/Payload
Demux.

I'm using Ubuntu 20.04 with GNU Radio 3.10.3, I'm also using Windows 10
with GNU Radio (same version) installed in the Anaconda environment when
I'm not using Ubuntu.

I'm trying to use the header/payload demux with a protocol parser.

I've read another discussion (this post
)
about the block and it helped me to understand the basics using a Packet
header generator and a Packet header parser.
But now I made a change to it and by using the Protocol formatter and
Protocol parser with the default access code, but the terminal outputs full
lines of:

"header_payload_demux :info: Parser returned #f"

And I don't stop the program immediately, it starts to freeze.

I've been trying to copy the structure of the examples packet_tx and
packet_rx which use the prot. formatter and prot. parser but I'm not using
PDU as a source information, instead I'm using a byte source or a file to
transmit.

I might think my error would be  the command to generate the preamble for
my packet in the protocol formatter, but I'm not sure of how to use other
commands referred in the API documentation properly.

I would appreciate any advice or suggestion to make the protocol parser
work with the Header/Payload Demux.


hdr_pay_dmux_prot.grc
Description: application/gnuradio-grc


Re: Problem with the OOT forecast() method in Python

2022-10-12 Thread Jeff Long
For Python, the forecast() function should return a list, containing the
number of items required for each input.

On Wed, Oct 12, 2022 at 8:08 AM George Edwards 
wrote:

> Hello GNURadio Community,
>
> I am getting a TypeError when I fill in the code in the forecast() method
> in my Gnuradio OOT block design. I know, if I want to interpolate or
> decimate, I can simply pick the block type in the gr_modtool design menu,
> however, I would like to develop the capability to design my own. Here is
> how I fill in the forecast() method in Python to do either decimation or
> interpolation:
>
> ninput_items_required[0] = noutput_items*self.sps  # for decimation
> OR
> ninput_items_required[0] = noutput_items/self.sps  # for interpolation
>
> On running the flowgraph in GRC Console I see TypeError: 'int' object
> does not support item assignment.
>
> Will appreciate any suggestion to fix this problem.
>
> George
>
>


Problem with the OOT forecast() method in Python

2022-10-12 Thread George Edwards
Hello GNURadio Community,

I am getting a TypeError when I fill in the code in the forecast() method
in my Gnuradio OOT block design. I know, if I want to interpolate or
decimate, I can simply pick the block type in the gr_modtool design menu,
however, I would like to develop the capability to design my own. Here is
how I fill in the forecast() method in Python to do either decimation or
interpolation:

ninput_items_required[0] = noutput_items*self.sps  # for decimation
OR
ninput_items_required[0] = noutput_items/self.sps  # for interpolation

On running the flowgraph in GRC Console I see TypeError: 'int' object does
not support item assignment.

Will appreciate any suggestion to fix this problem.

George