[SciPy-Dev] scipy.signal.butter returns complex coefficients

Pierre Haessig pierre.haessig at crans.org
Wed Feb 20 12:18:45 EST 2013


Hello,

Just a quick question about filter design using scipy.signal.butter :
(using scipy '0.10.1')

>>> import scipy.signal as sig
>>> B,A = sig.butter(N=4, Wn=1, analog=1) # 4rth order low-pass filter
with cutoff at 1 rad/s
>>> A,B
(array([ 1.00000000 +0.00000000e+00j,  2.61312593 -1.11022302e-16j,
        3.41421356 +0.00000000e+00j,  2.61312593 -1.11022302e-16j,
        1.00000000 -1.66533454e-16j]),
 array([ 1.+0.j]))

I was surprised by the result since I was expecting real numbers and not
complex numbers. And indeed the imaginary part is zero with respect to
floating point precision. For comparison, bessel function return real
coefficients.

So my question is : is the return of complex coefficients the expected
behavior ? or should I place an issue on Trac ?

best,
Pierre

(Maybe I didn't use the proper keywords because a quick Google search
didn't give me preexisting discussion on this topic)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130220/e0040c2c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130220/e0040c2c/attachment.sig>


More information about the SciPy-Dev mailing list