Sinks that consume variable rates on each input

“How to write a signal processing block” suggests subclassing from
gr_sync_block for the case of a sink. However, gr_sync_block’s work
function arranges to call consume_each for the user, consuming the
same number of elements on all inputs. What if my sink doesn’t
consume at the same rate on each input? Presumably what I’d want to
do is inherit directly from gr_block and call consume directly?

Thanks,
Kyle

You’ll want to inherit from either gr_sync_decimator or
gr_sync_interpolator, then handle the number of consumed items properly.
The
filters are a good place to get some ideas for how to do this.

Tom

On Wed, Sep 20, 2006 at 06:21:02PM -0400, Kyle Jamieson wrote:

“How to write a signal processing block” suggests subclassing from
gr_sync_block for the case of a sink. However, gr_sync_block’s work
function arranges to call consume_each for the user, consuming the
same number of elements on all inputs. What if my sink doesn’t
consume at the same rate on each input? Presumably what I’d want to
do is inherit directly from gr_block and call consume directly?

Yes, inherit from gr_block directly. You’ll need to implement
forecast and general_work

Thanks,
Kyle

Eric