[SciPy-User] SciPy and MATLAB give different results for 'buttord' function

Renan Birck Pinheiro renan.ee.ufsm at gmail.com
Mon Jan 19 19:07:04 EST 2015


I'm trying to design a analog Butterworth filter using the 'buttord'
function.
My settings are:

Passband frequency (Fpass) = 10 Hz -> Wp = 2*pi*10 Hz
Stopband frequency (Fstop) = 100 Hz -> Ws = 2*pi*100 Hz

The passband and stopband losses/attenuations (Rp, Rs) are 3 and 80 dB
respectively.

In MATLAB I use the command line

[N, Wn] = buttord(Wp, Ws, Rp, Rs, 's')

that gives me N = 5, Wn = 99.581776302.

But in SciPy I did this:

from numpy import pi
from scipy import signal
Wp = 2 * pi * 10
Ws = 2 * pi * 100
Rp = 3
Rs = 80
(N, Wn) = signal.buttord(Wp, Ws, Rp, Rs, analog=True)

and I get N = 5 and Wn = 62.861698649592753. Wn is different than the value
that MATLAB gives.

What am I doing wrong here? I read both the documentation of MATLAB and
SciPy and couldn't find the problem.

​Thanks,​

-- 
Renan Birck Pinheiro - Chip Inside Tecnologia <http://www.chipinside.com.br>
Acad. Engenharia Elétrica <http://www.ufsm.br/cee> - UFSM
<http://www.ufsm.br> - Santa Maria, Brasil
http://renanbirck.blogspot.com - +55 55 91162798 / +55 55 99034839

*Talk is cheap, show me the code*. - Linus Torvalds
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150119/795d3f8f/attachment.html>


More information about the SciPy-User mailing list