On Wed, Feb 5, 2014 at 7:02 PM, Miklos Maroti <[email protected]> wrote: > Hi Guys, > > Is it possible to write a c++ block that takes 2 input streams, > produces 1 output streams, but to generate 1000 outputs it needs 1000 > inputs of the first kind and 1 input of the second kind? How do I set > the set_output_rate? Does it apply to both input streams? How can I > ensure that the scheduler does not create too big buffer for the > second type of input? > > Miklos
There are a couple of ways to do this. It might be easiest for you to use vectors of samples on input port 0. The output could be another vector or you could convert it to a stream again here. This is assuming that you always want to process 1000 samples at a time for every 1 sample on input port 1. You set your IO signature like: gr::io_signature::make2(2, 2, 1000*sizeof(type0), 1*sizeof(type1)) The output signature is either 1000*sizeof(type0) and you can use a gr::sync_block (because 1 output item is 1 input item) or your output signature is 1*sizeof(type0) but you'll use a gr::sync_interpolator because now you'll be producing 1000 items after taking in a stream of 1 item. See vector_to_stream for a model of this second approach. You might also want to consider the tag stream interface instead of an indicator on stream 1. You would then have one input stream but look for the tag to process your 1000 output samples. This would be a more general approach if you aren't always using 1000 items at a time. Tom _______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
