[SciPy-user] Problems with filter design

Kumar Appaiah akumar at iitm.ac.in
Sun Jan 21 00:01:07 EST 2007


Dear Scipy users,

I am having problems with the filter design functions in SciPy. I
am unable to find out what I am doing wrong.

Here's the relevant code section:

<code>
omega_c = sqrt(0.8)
omega_r = 1 / sqrt(0.8)
omega_s = 7.5

gpass = 0.1
gstop = 43.46

(n, Wn) = signal.ellipord(omega_c, omega_r, gpass, gstop, analog=1)
[B, A] = signal.ellip(n, gpass, gstop, Wn, analog=1)
</code>

However, it throws an error at me, like this:

<error>
Traceback (most recent call last):
  File "ellip.py", line 18, in ?
    [B, A] = signal.ellip(n, gpass, gstop, Wn, analog=1)
  File
"/usr/lib/python2.4/site-packages/scipy/signal/filter_design.py", line
514, in ellip
    return iirfilter(N, Wn, rs=rs, rp=rp, btype=btype, analog=analog,
output=output, ftype='elliptic')
  File
"/usr/lib/python2.4/site-packages/scipy/signal/filter_design.py", line
448, in iirfilter
    b, a = lp2lp(b,a,wo=wo)
  File
"/usr/lib/python2.4/site-packages/scipy/signal/filter_design.py", line
186, in lp2lp
    wo = wo[0]
IndexError: 0-d arrays can't be indexed
</error>

Referring to filter_design.py, I guessed an array may be expected in
Wn. But neither does that make sense, nor does it give the expected
output. What is the mistake?

Thanks.

Kumar
-- 
Kumar Appaiah,
462, Jamuna Hostel,
Indian Institute of Technology Madras,
Chennai - 600 036




More information about the SciPy-User mailing list