# Can't read fir taps

**URL:** <https://www.ruby-forum.com/t/cant-read-fir-taps/238806>\
**Category:** GNU Radio\
**Created:** [January 29, 2014, 6:55pm UTC](https://www.ruby-forum.com/t/cant-read-fir-taps/238806 "2014-01-29T18:55:32Z")\
**Posts on this page:** 4\
**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 29, 2014, 6:55pm UTC](https://www.ruby-forum.com/t/cant-read-fir-taps/238806/1 "2014-01-29T18:55:32Z")

</div>

Hi all guys,

this two lines of code sort of doesn’t work as I expect.

self.channel\_filter = gr.fir\_filter\_ccf(1, firdes.low\_pass(10,  
samp\_rate,  
80000, 5000, firdes.WIN\_HAMMING, 6.76))

print self.channel\_filter.taps(), self.channel\_filter

I use 3.6.5.1 version and the only thing I get is empty tuple.

What might be the problem?

Best and thank you,

---

<div class="post-metadata">

**Author:** ![Nemanja\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nemanja\_S](https://www.ruby-forum.com/u/Nemanja_S)\
**Post date:** [January 30, 2014, 10:48am UTC](https://www.ruby-forum.com/t/cant-read-fir-taps/238806/2 "2014-01-30T10:48:27Z")

</div>

After a few more tries to figure out how this works I realized that  
method  
taps() can return list of coefficients only if set\_taps was called  
before  
for setting taps. In the constructor of filter set\_taps is not called,  
so  
my question is which taps does filter use?

---

<div class="post-metadata">

**Author:** ![Nemanja\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nemanja\_S](https://www.ruby-forum.com/u/Nemanja_S)\
**Post date:** [January 30, 2014, 2:17pm UTC](https://www.ruby-forum.com/t/cant-read-fir-taps/238806/3 "2014-01-30T14:17:18Z")

</div>

On Thu, Jan 30, 2014 at 4:47 AM, Nemanja S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> After a few more tries to figure out how this works I realized that method  
> taps() can return list of coefficients only if set\_taps was called before  
> for setting taps. In the constructor of filter set\_taps is not called, so my  
> question is which taps does filter use?

It uses those taps, but it looks like it doesn’t set a variable inside  
to hold them until you call set\_taps on it. The fir filter blocks  
encapsulate another fir kernel, which is where the real taps are  
actually stored. When you create your FIR filter, the taps are being  
set correctly.

You should switch to using filter.fir\_filter, which exists in 3.6.5.1.  
It will help future-proof you when moving up GNU Radio versions.  
Getting the taps here right after creating the filter will work fine  
in this implementation.

Tom

---

<div class="post-metadata">

**Author:** ![Nemanja\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nemanja\_S](https://www.ruby-forum.com/u/Nemanja_S)\
**Post date:** [January 30, 2014, 2:40pm UTC](https://www.ruby-forum.com/t/cant-read-fir-taps/238806/4 "2014-01-30T14:40:48Z")

</div>

Thank you Tom. It works when using fir from filter module.
