Re: Code::Blocks and FIR pm_remez algorithm

2023-09-30 Thread Marcus D. Leech

On 30/09/2023 22:42, N B wrote:

Helo,

I was looking at the FIR algorithm in pm_remez.cc and saw it is based 
on the old Janovetz implementation of Parks-McClellan. The author of 
one of my DSP books, Andreas Antoniou, makes the statement that he 
improved on the original Parsk-McClellan algorithm. I found another 
paper online where the author makes a similar statement.


I have no idea how accurate those statements are, but I am going to 
experiment with those algorithms. I'll make those initial experiments 
outside GNU Radio and if something good ever comes out of it, I would 
like to modify pm_remez.cc with the new algos, even if only for my 
personal use.


I'm getting to my issues, which I guess are really basic, but I'm new 
to Code::Blocks.


I created the .cbp file and opened the project in Code::Blocks. I was 
trying to trace the entire path from gr_filter_design to pm_remez.cc 
and wasn't getting anywhere.


When I look under the folder gr-filter, I see only two subfolders, lib 
and python. Eventually I looked in Github and there I could see 
several more subfolders under gr-filter, which I don't have in CB. (I 
couldn't be more grateful for the ability to search definitions and 
references in Github. I was able to trace the entire path in a few 
minutes)


My questions in order of importance are:

Why don't those folders display in CB?
Is it possible to Run the entire project in CB? It builds fine, but it 
just doesn't run.


Thanks,
Nic
Your question is a bit like asking George Lucas why the BluRay copy of 
Episode IV won't play in your machine


This isn't the Code::Blocks support mailing list, so my guess is that 
your question would be better asked in a more appropriate
  group.  There are literally *dozens* of editing/IDE environments that 
people use to work on Gnu Radio code.




Code::Blocks and FIR pm_remez algorithm

2023-09-30 Thread N B
Helo,

I was looking at the FIR algorithm in pm_remez.cc and saw it is based on the 
old Janovetz implementation of Parks-McClellan. The author of one of my DSP 
books, Andreas Antoniou, makes the statement that he improved on the original 
Parsk-McClellan algorithm. I found another paper online where the author makes 
a similar statement.

I have no idea how accurate those statements are, but I am going to experiment 
with those algorithms. I'll make those initial experiments outside GNU Radio 
and if something good ever comes out of it, I would like to modify pm_remez.cc 
with the new algos, even if only for my personal use.

I'm getting to my issues, which I guess are really basic, but I'm new to 
Code::Blocks.

I created the .cbp file and opened the project in Code::Blocks. I was trying to 
trace the entire path from gr_filter_design to pm_remez.cc and wasn't getting 
anywhere.

When I look under the folder gr-filter, I see only two subfolders, lib and 
python. Eventually I looked in Github and there I could see several more 
subfolders under gr-filter, which I don't have in CB. (I couldn't be more 
grateful for the ability to search definitions and references in Github. I was 
able to trace the entire path in a few minutes)

My questions in order of importance are:

Why don't those folders display in CB?
Is it possible to Run the entire project in CB? It builds fine, but it just 
doesn't run.

Thanks,
Nic


Re: Index Error: output_index < noutputs

2023-09-30 Thread Vasil Velichkov
Hi Jim,

On 29/09/2023 17.58, Elmore’s wrote:
> Thanks for the answer. I thought that since I imported the Receive 
> constructor I would be able to create a new instance of the Receive class not 
> a new class.

You are creating a new instance (not a new class) and this is exactly your 
problem. In freq.py you need to obtain a reference to the instance that has 
been created in your top flowgraph and call set_wave_select to this instance. 
> Also, since a message is asynchronous I don’t think that will work since I 
> need precise timing.

But your solution is not any more synchronous then using messages. In gnuradio 
all blocks are running in their own threads in parallel (more or less) and have 
their own input and output buffers. Each block consume and produce samples as 
fast as it can. The fact that one block currently process the N-th sample does 
not necessary means that the other block is also processing this very same N-th 
sample. Depending on the sampling rate this other block can be few million 
samples behind (if it is a downstream) or ahead. Calling a member function is 
not any more synchronous than sending a message because you don't know how far 
behind or ahead is the other block. Both solutions are non-deterministic - 
every time you run the flowgraph with the same input you would get slightly 
different result.

P.S.
Please keep the mailing list address in the loop.

Regards,
Vasil

> Jim
> 
> Sent from my iPhone
> 
>> On Sep 29, 2023, at 9:55 AM, Vasil Velichkov  wrote:
>>
>> Hi Jim,
>>
>>> On 29/09/2023 05.00, Elmore Family wrote:
>>> If I am not properly instantiating the objects then I am very confused. I 
>>> don't understand how I could be creating an instance of the FT8_Receive 
>>> block outside of the flowgraph. 
>>
>> In freq.py on line 64 you are calling the FT8_Receive class constructor.
>>
>> 64 RCV = FT8_Receive()
>>
>> This basically create a new instance FT8_Receive class. Have a look in the 
>> python file generated by your top flowgraph (top_block.py), you would have 
>> something like
>>
>> 369 self.FT8_Receive_0 = FT8_Receive(
>> 370 wave_select=0,
>> 371 )
>>
>> Here the first instance is created and later this instance gets connected to 
>> other blocks in your flowgraph.
>>
>> 384 self.connect((self.Receive, 2), (self.FT8_Receive_0, 0))
>>
>> You can try adding a print statement in FT8_Receive constructor and check 
>> how many time it gets printed on your terminal.
>>
>>> If this is the case, how do I create the proper instance?
>>
>> I'm not sure how to pass a reference to this first instance of FT8_Recive to 
>> freq.py.
>>
>> I'm usually using message ports when available in order to avoid tight 
>> coupling between blocks. The selector block has iindex port that you can use 
>> to change the input port, see 
>> https://wiki.gnuradio.org/index.php/Selector#Messages
>>
>> Regards,
>> Vasil
>>
>>> -Original Message- From: Vasil Velichkov
>>> Sent: Thursday, September 28, 2023 5:00 AM
>>> To: Elmore Family
>>> Cc: discuss-gnuradio@gnu.org
>>> Subject: Re: Index Error: output_index < noutputs
>>>
>>> Hi Elmore,
>>>
 On 28/09/2023 04.58, Elmore Family wrote:
 I moved the Selector code (i.e. set_wave_select(wave_select)) into the 
 portion of my code which runs after the flowgraph is running. I still get 
 the same error.
>>>
>>> Where did you moved it? Can you provide the modified source code?
>>>
>>> Are you sure that you are calling set_wave_select() to the correct instance 
>>> of FT8_Receive block, that is actually part of your flowgraph?
>>>
>>> Previously you were creating a new instance of FT8_Receive block that was 
>>> not part of any flowgraph and because of this it would never be run, the 
>>> check_topology() would never be called on this specific instance.
>>>
>>> Regards,
>>> Vasil
>>>
>>
>