I see, thanks~~

2009/12/22 Eric Blossom <[email protected]>

>  On Tue, Dec 22, 2009 at 12:22:29PM +0800, zhi yan wrote:
> > Hi All,
> >
> > I am confused of the Set_history() which is a function of gr_block, what
> is
> > the function of this function? thanks~~
> >
>
> It exists so that you can implement an "inline delay line", or similar
> functionality.  The primary user of set_history are the FIR filters,
> but there is other code that uses it.  The default value of history is
> 1, which is admittedly confusing, but is how it was historically
> defined.
>
> To give a concrete example, if you subclass gr_sync_block (which is
> 1:1 from input to output) and don't call set_history in the
> constructor,  when your work function is called with a value of
> noutput_items = N, there are guarenteed to be N valid samples in the
> input vector, indexed from 0 to N-1.
>
> If in the constructor you call set_history(2), when work is called
> with a value of noputout_items = N, there are guarenteed to be N + 1
> valid samples in the input vector, indexed from 0 to N.
>
> If in the constructor you call set_history(H), when work is called
> with a value of noputout_items = N, there are guarenteed to be
> N + H - 1 valid samples in the input vector, indexed from 0 to N + H - 2.
>
> The other subclasses of gr_block work similarly.  Take a look at their
> forecast routines for the details.
>
> On the first call to work, the first H - 1 samples will be zero.
>
> Eric
>
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to