[SciPy-dev] problem with signal.butter

John Hunter jdhunter at ace.bsd.uchicago.edu
Wed Aug 3 17:18:11 CDT 2005


>>>>> "Travis" == Travis Oliphant <oliphant at ee.byu.edu> writes:

    Travis> val must be complex for some reason where it is not
    Travis> expected to be.

    Travis> Not sure what is going on.  Which version of Numeric do
    Travis> you have installed?

23.7

Here is what I get for the same commands in a plain-ol-python-shell.


> uname -a
Linux peds-pc311 2.6.10-5-386 #1 Fri Jun 24 16:53:01 UTC 2005 i686 GNU/Linux

> python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Numeric as N
>>> N.__version__
'23.7'
>>> import scipy as s
>>> s.__version__
'0.3.2'
>>> import scipy.signal as sig
>>> ord,Wn = sig.buttord([7/200.,12/200.],[5/200.0,18/200.0],3,15)
>>> ord
2
>>> Wn
array([ 0.03497942,  0.06003517])
>>> mybutt = sig.butter(ord,Wn,btype='bandpass')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/scipy/signal/filter_design.py", line 482, in butter
    return iirfilter(N, Wn, btype=btype, analog=analog, output=output, ftype='butter')
  File "/usr/lib/python2.4/site-packages/scipy/signal/filter_design.py", line 456, in iirfilter
    b, a = lp2bp(b,a,wo=wo,bw=bw)
  File "/usr/lib/python2.4/site-packages/scipy/signal/filter_design.py", line 253, in lp2bp
    aprime[Dp-j] = val
TypeError: can't convert complex to float; use abs(z)
>>>

Let me know if there is anything else you want me to try.  I can
always upgrade to scipy CVS and try that.  

Thanks!
JDH




More information about the Scipy-dev mailing list