On Mon, May 19, 2014 at 8:14 AM, Kun Qian <[email protected]> wrote: > Hi, > > I wrote a block using gnuradio history functionality. The block is > inherited > from gr::block (built by command "gr_modtool add -t general my_block"), > with > history set to a bit large number, 320. I then finished rest parts of the > block. > > I run the flowgraph and output the input buffer of this block when the > general_work() function is called. Then I found the history of the block is > stored at the end of the input buffer, which is not as what the tutorial > said. > > For example, suppose my block is prepended by a delay block with delay > value > set to 16, the content of the input buffer of my block at the first time > when general_work() is called is 336 complex zeros. Then my block consume > all 16 zeros by calling consume_each(16) and return the number of output > items. According the description of gnuradio history functionality, the > content of the input buffer of my block at the second time when > general_work() is called ought to be 320 complex zeros (history) followed > by > some data items. Yet in fact, what I get at second time is some data items > followed by 320 complex zeros! > > I have no idea why it happens. Could anyone help me please? Thank you! >
Take a look at the PDF that I posted here: http://www.trondeau.com/blog/2013/9/15/explaining-the-gnu-radio-scheduler.html Specifcally slide 24. That might show you what's going on with the set history concept. In reality, it sets the read pointer history()-1 items back when the flowgraph starts, so you'll have that many zeros, which then allows the block to read ahead. Tom
_______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
