# Filter taps and delays

**URL:** <https://www.ruby-forum.com/t/filter-taps-and-delays/238349>\
**Category:** GNU Radio\
**Created:** [January 5, 2014, 10:40pm UTC](https://www.ruby-forum.com/t/filter-taps-and-delays/238349 "2014-01-05T22:40:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [January 5, 2014, 10:40pm UTC](https://www.ruby-forum.com/t/filter-taps-and-delays/238349/1 "2014-01-05T22:40:33Z")

</div>

Hi Guys,

If I use interp\_fir\_filter\_ccc(3, [1, 2, 3, 4, 5, 6]) on a vector  
source containing [1, 0, 0, …] then I get [1, 2, 3, 4, 5, 6, 0, 0,  
…] as expected. However, if I use interp\_fir\_filter\_ccc(3, [1, 2, 3,  
4, 5]) then I get [0, 1, 2, 3, 4, 5, 0, 0, …] so the samples are  
shifted to the right by one. For taps of length divisible by 3 there  
is no delay, and for others there is 1 or 2 sample delay introduced by  
the interpolation filter. Why is this?

Also, maybe related to this, I see filter.declare\_sample\_delay(0) in  
generated code, and I do not know what it does and if it is strictly  
necessary.

Miklos

---

<div class="post-metadata">

**Author:** ![Miklos\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@Miklos\_M](https://www.ruby-forum.com/u/Miklos_M)\
**Post date:** [January 6, 2014, 6:39pm UTC](https://www.ruby-forum.com/t/filter-taps-and-delays/238349/2 "2014-01-06T18:39:56Z")

</div>

On Sun, Jan 5, 2014 at 4:39 PM, Miklos M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi Guys,
> 
> If I use interp\_fir\_filter\_ccc(3, [1, 2, 3, 4, 5, 6]) on a vector  
> source containing [1, 0, 0, …] then I get [1, 2, 3, 4, 5, 6, 0, 0,  
> …] as expected. However, if I use interp\_fir\_filter\_ccc(3, [1, 2, 3,  
> 4, 5]) then I get [0, 1, 2, 3, 4, 5, 0, 0, …] so the samples are  
> shifted to the right by one. For taps of length divisible by 3 there  
> is no delay, and for others there is 1 or 2 sample delay introduced by  
> the interpolation filter. Why is this?

Good catch, Miklos. I’ve identified the problem. I’ve put it into a  
queue of patches that will be pushed soon.

> Also, maybe related to this, I see filter.declare\_sample\_delay(0) in  
> generated code, and I do not know what it does and if it is strictly  
> necessary.
> 
> Miklos

No, that has nothing to do with it. That is a very specialized  
function to instruct the scheduler how to handle tags when passing  
through blocks with delay. The documentation of that function tells  
you that it doesn’t do anything with the signal processing of the  
block:

> **[GNU Radio Manual and C++ API Reference: gr::block Class Reference](https://www.gnuradio.org/doc/doxygen/classgr_1_1block.html)**

Tom
