Importing Filter Taps

I need to import complex filter taps from a .txt file and use them in
FFT FIlter block in GRC. How can I do that?

Regards,
Umair N.
MSc Communication Engineering
Chalmers University ot Technology, Sweden.

My walkthrough:

  1. matlab, e.g. A=[3+4i 4+3i 5+2.3i 6 3.4i]
  2. copy A to clipboard: clipboard(‘copy’, A)
  3. with xclip and sed, the clipboard’s content is converted to
    something python understands: xclip -o -selection c | sed -r -e
    ‘s/^[//’ -e ‘s/]$//’ -e ‘s/ /,/g’ -e ‘s/i*([^,]),/\1j,/g’ -e
    's/i*(.
    )$/\1j/’ > taps_c.txt
  4. from numpy import *
  5. e.g. self.filter = gr.interp_fir_filter_ccc(1,
    genfromtxt(“taps_c.txt”, dtype=“complex”, delimiter=“,”))

Cheers,
Gregor

2010/4/21 Umair N. [email protected]:

you can call numpy.fromfile in grc
http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromfile.html

if it cant find the numpy module, add an import block that has “import
numpy”

-Josh