discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Custom Block to Output Items that Meet Criteria


From: Mark Gannet
Subject: Re: [Discuss-gnuradio] Custom Block to Output Items that Meet Criteria
Date: Fri, 8 Mar 2019 06:52:27 -0800

Thank you.  Basically, I want to take something like the burst tagger block but copy the item from the 1st input to the output buffer only when a condition is met on the 2nd input rather than just append a tag to the stream.  The number of times that condition is met will vary but should be between 100-1000 times per second.

Mark

On Wed, Mar 6, 2019 at 6:20 PM Nick Foster <address@hidden> wrote:
Sure, no problem, use a gr::block. Just call consume() to tell the scheduler how many items you consumed, and return the number of samples you produced -- subject to the size of the output buffer. general_work() gets the size of your input and output buffers from ninput_items and noutput_items. Perfectly fine to return a smaller value than requested.

Nick

On Wed, Mar 6, 2019 at 5:43 PM Mark Gannet <address@hidden> wrote:
Is it possible to write a custom block that only copies items to the output buffer if they meet a certain criterion?  I'm thinking of something like a "keep m of n" block but where there is no knowledge of the number of items that will be written to the output buffer when entering the work function.

Thanks,
Mark
_______________________________________________
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]