discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Simple block with constant rate


From: Activecat
Subject: Re: [Discuss-gnuradio] Simple block with constant rate
Date: Tue, 1 Jul 2014 22:13:57 +0800


On Tue, Jul 1, 2014 at 9:30 PM, Activecat <address@hidden> wrote:

On Tue, Jul 1, 2014 at 6:17 PM, caruiz.ext <address@hidden> wrote:
 ---> Delay = 1
current_delay < delay ->delay of 1 sample
I insert a virtual sample (linear interpolation)
I sent the next sample (2)
current_delay = 1

I don't understand what this means.
 
 ---> Delay = 1
current_delay = delay -> nothing
I send the next sample (3)
current_delay = 1



My comments:

1).  I see no reason that "q", "inicio", "sample_rate" and "delay" should be defined as public class variables, rather than private.

2).  You make this a general block that always consumes and returns the same value.  This is similar to a sync block. 
      But a delay block is not a sync block.

3).  Basically what a delay block does is just to copy "input[i]" to "output[ i + delay ]", this creates an effect of delaying the signal.
      You don't need to create a std::queue to perform delay.

4).  The definition of "Sample" class, if it is really needed, should be placed in separate file.

5).  Your always forecast 1 input item, but in general_work() you always consumes and access the input buffer as if its length is always not smaller than noutput_items.
      (you forget the memory boundary) This is fatal.

6).  I don't understand your attached picture.
      I also don't understand your requirement.


You have written a code (delay_cola_fff) that is wrong from the ground up.
The only way to help you is to understand your requirement and suggest something else from scratch.
Unfortunately I fail to understand your requirement.

I suggest you to look into the source code of the existing "Delay" block, and start from there.



Meanwhile, you shouldn't have skipped the unittest from the very beginning.
The unittest will show you that this block (delay_cola_fff) doesn't work accordingly.
There is no point to go further unless this block has passed its unittest.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]