# Gr\_delay behaviour

**URL:** <https://www.ruby-forum.com/t/gr-delay-behaviour/223913>\
**Category:** GNU Radio\
**Created:** [October 23, 2012, 11:09am UTC](https://www.ruby-forum.com/t/gr-delay-behaviour/223913 "2012-10-23T11:09:38Z")\
**Posts on this page:** 4\
**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:** [October 23, 2012, 11:09am UTC](https://www.ruby-forum.com/t/gr-delay-behaviour/223913/1 "2012-10-23T11:09:38Z")

</div>

One short question. What happens if I call the set\_delay method of the  
gr\_delay block during runtime. Will it throw away/add some samples  
when the delay is changed?  
I am actually trying to create a block that throws away some samples  
whenever I call a memberfunction skip() but having difficulties  
testing it.

---

<div class="post-metadata">

**Author:** ![jst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@jst](https://www.ruby-forum.com/u/jst)\
**Post date:** [October 23, 2012, 12:06pm UTC](https://www.ruby-forum.com/t/gr-delay-behaviour/223913/2 "2012-10-23T12:06:20Z")

</div>

gr\_delay pads “delay” number of zeros at the beginning of the sequence.

see qa\_delay.py in gnuradio/gnuradio-core/src/python/gnuradio/gr

I also wanted to throw away some samples at the beginning, I imported  
the  
collected data in MATLAB, then threw away some samples and got it back  
in  
gnuradio .bin file … I know its not a good solution but I was in  
hurry 🙂

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/gr-delay-behaviour-tp38105p38106.html](http://gnuradio.4.n7.nabble.com/gr-delay-behaviour-tp38105p38106.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![jst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@jst](https://www.ruby-forum.com/u/jst)\
**Post date:** [October 23, 2012, 6:55pm UTC](https://www.ruby-forum.com/t/gr-delay-behaviour/223913/3 "2012-10-23T18:55:23Z")

</div>

I am now just using a simple gr\_block to asynchronously skip some  
samples from time to time by calling

consume\_each(d\_skip\_size);  
return 0;

I didn’t define any forecast function and it seems to work fine but I  
am wondering what is the performance impact of not doing this.  
Shouldn’t I basically somehow let the scheduler know that I am  
skipping something by writinga custom forecast?  
The amount of skipped samples is relatively low compared to the passed  
samples.

---

<div class="post-metadata">

**Author:** ![jst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@jst](https://www.ruby-forum.com/u/jst)\
**Post date:** [October 23, 2012, 4:14pm UTC](https://www.ruby-forum.com/t/gr-delay-behaviour/223913/4 "2012-10-23T16:14:37Z")

</div>

On Tue, Oct 23, 2012 at 5:07 AM, Johannes S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> One short question. What happens if I call the set\_delay method of the  
> gr\_delay block during runtime. Will it throw away/add some samples  
> when the delay is changed?

If you increase the delay, you will skip over a number of items in the  
buffer, but otherwise, no, you won’t lose any data, so this isn’t what  
you want to use to throw away data.

> I am actually trying to create a block that throws away some samples  
> whenever I call a memberfunction skip() but having difficulties  
> testing it.

Calling a function externally probably isn’t what you want to do if  
you have a specific set of items you want to toss. If you’re just  
throwing away any set of items, then this should work. If you have  
specific items (or items at a specific time or time delta), then  
you’ll want to do something with stream tags to tell the block to toss  
items at a particular sample.

Tom
