If one uses gr::block and ::general_work, then I believe that there are no
constraints on the I/O streams & one can have generalized ninput and noutput
items on each stream.
It's when one moves to specialized blocks (e.g., gr::sync_block,
gr::sync_interpolator, gr::tagged_stream, etc), that
Correction: sync_block guarantees number of inputs (on each port) to be
equal to number of outputs. The sync_decimator and sync_interpolator
allow number of inputs (on each port) a 1:N or N:1 relationship between
input and output. Sorry for the confusion.
On 01/02/2018 08:07 AM, Jeff Long
Yes, you'll get the same number of samples on both inputs if you derive
from sync_block. For example, here is the code from the "add" block:
add_ff_impl::work(int noutput_items,
gr_vector_const_void_star _items,
gr_vector_void_star _items)
{
float *out = (float *) output_items[0];
Hi Michael,
Thank you very much for the detailed explanation. I have one more query -
If a block has two input streams, will the no of items be same in both
streams? say for example I build a block that takes I and Q samples as
input and the algorithm demands I sample and its corresponding Q
Hi Sakthivel - Short answers: The value can vary for each call; it is
determined by the scheduler. I've provided more info below if you're curious.
Cheers! - MLD
Details: One way to think of your questions is to imagine the finite-length I/O
buffers that hold the data between blocks, and note
Hi all,
I am new to GNU radio. I have this general doubt that when items are
streamed from one block to another, how many input_items per port (consider
a type general block) are passed when the work() function of the block is
called each time? I guess this is handled by the GNU radio's scheduler