discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] consuming all inputs, small outputs


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] consuming all inputs, small outputs
Date: Mon, 19 Jan 2015 22:10:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

Hi Jon,

um, which tutorial block are you referring to?

noutput_items[0] is the *maximum* number of items your work function call is allowed to produce (on output stream 0); you can produce less.
ninput_items[0] is the number of items ready for processing (on input stream 0); you can consume less, and will be presented with the remainder plus items that might have come in in the meantime.

So the point here is that general_work of general_block doesn't make any assumptions on the relationship between the number of items you consume and produce; if you have a sync_block, for comparison, there's always a take-N-give-N relationship.

Greetings,
Marcus

On 01/19/2015 10:05 PM, Jon West wrote:
Well in regards to the general block, in my attempts at learning, I noticed that noutput_items is less than ninput_items, what happens to the samples not used? I just ask because the tutorial block is a general block

On Mon, Jan 19, 2015 at 3:39 PM, Marcus Müller <address@hidden> wrote:
Hi Jon,

On 01/19/2015 09:24 PM, Jon West wrote:
I am trying to create a block that outputs one number from each chucnk of data it takes in, I would like to output this number and be able to use it in visualizations, what would the best block be for this?
Sounds like a "keep 1 in N" situation, so maybe that; documentation at [1].
Would a decimation block work?
Yes. you could for example use a decimating FIR filter (if you don't want to write a block of your own), and just set the taps to [1.0], if you just want to keep the numbers as they were in the original sample stream. Of course, if you want to do decimation, you'd just try to use an appropriate low pass filter.
what if I would like to out put three numbers from one chunk of input and visualize those (lets say I'm doing an autocorellation and would like to know  sample number I found the highest correlation and the size of the correlation peak) and I want to plot them.
Well, [2] is "keep M in N".
Thanks, I'm finding this all REALLY confusing and every time I try something I am just running in to problems.
Hope you have your little moments of success in between :)

Greetings,
Marcus

[1] http://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1keep__one__in__n.html
[2] http://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1keep__m__in__n.html


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

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