# Error trying to load FFT filter taps

**URL:** <https://www.ruby-forum.com/t/error-trying-to-load-fft-filter-taps/240542>\
**Category:** GNU Radio\
**Created:** [April 19, 2014, 7:29pm UTC](https://www.ruby-forum.com/t/error-trying-to-load-fft-filter-taps/240542 "2014-04-19T19:29:11Z")\
**Posts on this page:** 5\
**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:** [April 19, 2014, 7:29pm UTC](https://www.ruby-forum.com/t/error-trying-to-load-fft-filter-taps/240542/1 "2014-04-19T19:29:11Z")

</div>

Am getting the following error when trying to run a GRC flowgraph that  
loads FFT filter taps from an external file. The type filter parameter  
is  
set to complex-\>complex (complex taps).  
The flow graph has imported numpy. The taps are loaded using:

numpy.fromfile(’/home/tom/Desktop/EchoScreencaps/chirp-down-20-20-131072’,  
numpy.complex64)

as the taps parameter. What does the error below mean?

GRC: v3.7.4git-101-g76970d54  
Ubuntu 13.10  
top\_block.py is attached.

– Tom, N5EG

Traceback (most recent call last):  
File “/home/tom/Desktop/EchoScreencaps/top\_block.py”, line 173, in  
  
tb = top\_block()  
File “/home/tom/Desktop/EchoScreencaps/top\_block.py”, line 115, in  
**init**  
self.fft\_filter\_xxx\_0 = filter.fft\_filter\_ccc(1,  
(numpy.fromfile(’/home/tom/Desktop/EchoScreencaps/chirp-down-20-20-131072’,  
numpy.complex64)), 1)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/filter/filter\_swig.py”,  
line 1329, in make  
return \_filter\_swig.fft\_filter\_ccc\_make(\*args, \*\*kwargs)  
TypeError: in method ‘fft\_filter\_ccc\_make’, argument 2 of type  
‘std::vector\< gr\_complex,std::allocator\< gr\_complex \> \> const &’

---

<div class="post-metadata">

**Author:** ![Tom\_McDermott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/9fc29f/32.png) [@Tom\_McDermott](https://www.ruby-forum.com/u/Tom_McDermott)\
**Post date:** [April 20, 2014, 5:46pm UTC](https://www.ruby-forum.com/t/error-trying-to-load-fft-filter-taps/240542/2 "2014-04-20T17:46:00Z")

</div>

On Sat, Apr 19, 2014 at 1:27 PM, Tom McDermott [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> GRC: v3.7.4git-101-g76970d54  
> File “/home/tom/Desktop/EchoScreencaps/top\_block.py”, line 115, in

Tom,

This is a conflict between the numpy array data type and swig. Call the  
.tolist() function on the array passed back from numpy and it should  
work.

Tom

---

<div class="post-metadata">

**Author:** ![Tom\_McDermott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/9fc29f/32.png) [@Tom\_McDermott](https://www.ruby-forum.com/u/Tom_McDermott)\
**Post date:** [April 20, 2014, 6:24pm UTC](https://www.ruby-forum.com/t/error-trying-to-load-fft-filter-taps/240542/3 "2014-04-20T18:24:55Z")

</div>

Thanks, Tom that solved the problem.

numpy.fromfile(‘filename’, numpy.complex64).tolist()

Should the gnuradio wiki (GRC) text be updated?

Apologies for the triple posting, first two attempts were using  
yahoo.commail account, got  
bit by the yahoo DMARC problem and dumped from the list. Changed to  
gmail  
to avoid the problem.

– Tom, N5EG

---

<div class="post-metadata">

**Author:** ![Tom\_McDermott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/9fc29f/32.png) [@Tom\_McDermott](https://www.ruby-forum.com/u/Tom_McDermott)\
**Post date:** [April 20, 2014, 6:30pm UTC](https://www.ruby-forum.com/t/error-trying-to-load-fft-filter-taps/240542/4 "2014-04-20T18:30:49Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Strange: For me, the problem persists (at least with random dummy data  
from a random file in /tmp):

> > > taps = numpy.fromfile(“/tmp/tblatex-4.png”,  
> > > dtype=numpy.complex64).tolist()  
> > > fffilter = filter.fft\_filter\_ccc(1, taps ,1)  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in   
> > > File  
> > > “/home/marcus/.usrlocal/lib64/python2.7/site-packages/gnuradio/filter/filter\_swig.py”,  
> > > line 1329, in make  
> > > return \_filter\_swig.fft\_filter\_ccc\_make(\*args, \*\*kwargs)  
> > > TypeError: in method ‘fft\_filter\_ccc\_make’, argument 2 of type  
> > > ‘std::vector\< gr\_complex,std::allocator\< gr\_complex \> \> const &’

Greetings,  
Marcus

On 20.04.2014 18:24, Tom McDermott wrote:

> – Tom, N5EG
> 
> > > Am getting the following error when trying to run a GRC  
> > > flowgraph that loads FFT filter taps from an external file. The  
> > > type filter parameter is set to complex-\>complex (complex  
> > > taps). The flow graph has imported numpy. The taps are loaded  
> > > using:
> > > 
> > > numpy.fromfile(‘/home/tom/Desktop/EchoScreencaps/chirp-down-20-20-131072’,

numpy.complex64)

> > > “/home/tom/Desktop/EchoScreencaps/top\_block.py”, line 173, in  
> > > tb = top\_block() File  
> > > “/home/tom/Desktop/EchoScreencaps/top\_block.py”, line 115, in  
> > > **init** self.fft\_filter\_xxx\_0 = filter.fft\_filter\_ccc(1,  
> > > (numpy.fromfile(‘/home/tom/Desktop/EchoScreencaps/chirp-down-20-20-131072’,

numpy.complex64)), 1)

> > > File  
> > > “/usr/local/lib/python2.7/dist-packages/gnuradio/filter/filter\_swig.py”,

line 1329, in make

> > Call the .tolist() function on the array passed back from numpy  
> > [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1  
Comment: Using GnuPG with Thunderbird - [http://www.enigmail.net/](http://www.enigmail.net/)

iQEcBAEBAgAGBQJTU/XlAAoJEBQ6EdjyzlHtZWkH/jJQqxauQAOVHZQ2+uPj7MoW  
Fqbnvcoo4jgbW9fey+GNn6CsnFjzcfCi4VahEkX7ysBMLU194wXCVa3vdIsWMGB1  
LqcvptQUX0mS/Aso8W4i0MP2utDxOj7xAKzsvE0eEHUh7G+WkJvd1yJoBnwvW3ng  
wVCqj31lReOx2qCq0vKqpFcBC256yOGXeARVBUaBaRaXHUU4cxdWhXH11W1vKInJ  
pOds2U0z1brTgz808qRRfHu4L8PdR7B6Q0xfTW6X45Iq7D1/OvaazgI6FSBu1qa3  
tsdWlipOiBHFWAnIz6LVORROJe40xXzcKKnCNFR3buZkt/XPHCHwH2ruWS3rkdM=  
=DmUg  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![Tom\_McDermott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/9fc29f/32.png) [@Tom\_McDermott](https://www.ruby-forum.com/u/Tom_McDermott)\
**Post date:** [April 20, 2014, 6:39pm UTC](https://www.ruby-forum.com/t/error-trying-to-load-fft-filter-taps/240542/5 "2014-04-20T18:39:41Z")

</div>

On Sun, Apr 20, 2014 at 12:24 PM, Tom McDermott [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> – Tom, N5EG

Absolutely update the wiki page with helpful tips like this. Which page  
in  
particular are you referring to?

Tom
