# Making a custom block with no specific/fixed relationship between input and output rates

**URL:** <https://www.ruby-forum.com/t/making-a-custom-block-with-no-specific-fixed-relationship-between-input-and-output-rates/222146>\
**Category:** GNU Radio\
**Created:** [August 14, 2012, 5:45pm UTC](https://www.ruby-forum.com/t/making-a-custom-block-with-no-specific-fixed-relationship-between-input-and-output-rates/222146 "2012-08-14T17:45:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 14, 2012, 5:45pm UTC](https://www.ruby-forum.com/t/making-a-custom-block-with-no-specific-fixed-relationship-between-input-and-output-rates/222146/1 "2012-08-14T17:45:28Z")

</div>

Hello everyone,

I have a rather open question for you guys this time. I need to make a  
custom block with no specific/fixed relationship between input and  
output rates. More precisely, the input(s) to my custom block still come  
in a streaming fashion but the output is now bursty and aperiodic in  
nature. In other words, my custom block should consume/accept the  
input(s) at regular rates but should produce (possibly variable number  
of)samples at its output(s) only when it pleases. Therefore, I cannot  
derive my class from any of the gr\_sync\_block, gr\_block,  
gr\_sync\_decimator, gr\_sync\_interpolator parent classes. What other  
options do I have in my hand to accomplish this job? Any suggestions?

Thanks,  
Yu.

---

<div class="post-metadata">

**Author:** ![Zing\_Yu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/d6d6ee/32.png) [@Zing\_Yu](https://www.ruby-forum.com/u/Zing_Yu)\
**Post date:** [August 14, 2012, 7:14pm UTC](https://www.ruby-forum.com/t/making-a-custom-block-with-no-specific-fixed-relationship-between-input-and-output-rates/222146/2 "2012-08-14T19:14:53Z")

</div>

On Tue, Aug 14, 2012 at 08:44:20AM -0700, Zing Yu wrote:

> I have a rather open question for you guys this time. I need to make a custom  
> block with no specific/fixed relationship between input and output rates. More  
> precisely, the input(s) to my custom block still come in a streaming fashion  
> but the output is now bursty and aperiodic in nature. In other words, my custom  
> block should consume/accept the input(s) at regular rates but should produce  
> (possibly variable number of) samples at its output(s) only when it pleases.  
> Therefore, I cannot derive my class from any of the gr\_sync\_block, gr\_block,  
> gr\_sync\_decimator, gr\_sync\_interpolator parent classes. What other options do I  
> have in my hand to accomplish this job? Any suggestions?

You _can_ derive from gr\_block. The OFDM detector block does this.

MB

–  
Karlsruhe Institute of Technology (KIT)  
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.  
Research Associate

Kaiserstraße 12  
Building 05.01  
76131 Karlsruhe

Phone: +49 721 608-43790  
Fax: +49 721 608-46071  
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and  
National Laboratory of the Helmholtz Association
