# Processing block with conditional number of output items

**URL:** <https://www.ruby-forum.com/t/processing-block-with-conditional-number-of-output-items/237574>\
**Category:** GNU Radio\
**Created:** [November 19, 2013, 5:05pm UTC](https://www.ruby-forum.com/t/processing-block-with-conditional-number-of-output-items/237574 "2013-11-19T17:05:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [November 19, 2013, 5:05pm UTC](https://www.ruby-forum.com/t/processing-block-with-conditional-number-of-output-items/237574/1 "2013-11-19T17:05:03Z")

</div>

Hello all,

I’m a grad student writing my first GNU Radio processing block, and I’m  
a little stuck. I’m not sure how to tell GNU Radio the input output  
relationship of my block.

The block takes 2 inputs. One is an index, and the other is data (I may  
use stream tags to indicate index in the future). The block also has  
one output port of processed data. The block needs to buffer a small  
history of inputs then search through for matching indexes. When it  
finds a matching pair of indexes, it processes the 2 pieces of data  
corresponding to the two matching indexes (i.e. has the same position in  
the buffer) and produces 1 output. The trouble is, there is no  
guarantee it will find a match. The result is that sometimes there is  
no output, and sometimes there are multiple outputs. I’m not sure how  
to setup GNU Radio’s buffers to accommodate this.

I’m getting close to a solution, but I thought I’d ask here. So, if I  
wanted to buffer say 8 index and 8 data items, and then arbitrarily  
pluck matching data from the input buffer to process and put on the  
output buffer, how would you recommend I go about it?

Thanks,  
Nate

---

<div class="post-metadata">

**Author:** ![PriceS\_Nathan\_DSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8c91f0/32.png) [@PriceS\_Nathan\_DSSS](https://www.ruby-forum.com/u/PriceS_Nathan_DSSS)\
**Post date:** [April 20, 2014, 1:42pm UTC](https://www.ruby-forum.com/t/processing-block-with-conditional-number-of-output-items/237574/2 "2014-04-20T13:42:35Z")

</div>

Hi Nate,

I met the same kind of problem: the ratio between input and output of my  
block is gonna change depending on the content of the data.Have you  
solved it?

Thanks,  
Niko.
