# Delay block controlled by input

**URL:** <https://www.ruby-forum.com/t/delay-block-controlled-by-input/232174>\
**Category:** GNU Radio\
**Created:** [September 23, 2014, 8:39am UTC](https://www.ruby-forum.com/t/delay-block-controlled-by-input/232174 "2014-09-23T08:39:53Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [October 8, 2014, 3:37pm UTC](https://www.ruby-forum.com/t/delay-block-controlled-by-input/232174/21 "2014-10-08T15:37:03Z")

</div>

On 10/08/2014 03:24 PM, Carlos Alberto Ruiz Naranjo wrote:

> Really the question is:
> 
> How can I call  
> gr::block::nitems\_read ( unsigned int /which\_input/ )
> 
> from a block to know the nitems\_read of another block?

You call ‘nitems\_read()’?

Not sure you should be calling it from other blocks, though.

Cheers,  
M

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 6, 2014, 1:02pm UTC](https://www.ruby-forum.com/t/delay-block-controlled-by-input/232174/22 "2014-11-06T13:02:00Z")

</div>

Now the clock runs fine (with gr::block::nitems\_read).

But I have another problem:  
I have a rate of 10.23 million samples per second and I need to delay  
the  
signal ±1ns. With the modified block delay (controlled by an input) I  
can  
delay the signal 97.75ns (1 / 10,230,000 → + - one sample).

Could I use the fractional resampler block to enter a variable  
fractional delay?  
1ns?

What is the exact meaning of the parameter mu?  
[http://gnuradio.org/doc/doxygen-3.6/classgr\_1\_1filter\_1\_1mmse\_\_fir\_\_interpolator\_\_ff.html](http://gnuradio.org/doc/doxygen-3.6/classgr_1_1filter_1_1mmse __fir__ interpolator__ff.html)  
I do not understand it :S

2014-10-08 15:35 GMT+02:00 Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [October 8, 2014, 3:37pm UTC](https://www.ruby-forum.com/t/delay-block-controlled-by-input/232174/23 "2014-10-08T15:37:03Z")

</div>

You call  
another\_block-\>nitems\_read(number)  
with number being the number of the input stream (ie. 0 for the first, 1  
for the second and so on).  
Remember, GNU Radio is C++, and blocks are built as classes.

Greetings,  
Marcus

[Previous page](https://www.ruby-forum.com/t/delay-block-controlled-by-input/232174.md?page=1)
