[SciPy-User] SciPy and MATLAB give different results for 'buttord' function (Renan Birck Pinheiro)

KURT PETERS peterskurt at msn.com
Mon Jan 19 20:54:52 EST 2015


> Date: Mon, 19 Jan 2015 22:07:04 -0200
> From: Renan Birck Pinheiro <renan.ee.ufsm at gmail.com>
> Subject: [SciPy-User] SciPy and MATLAB give different results for
> 	'buttord'	function
> To: scipy-user at scipy.org
> Message-ID:
> 	<CAE6izLdE=Ez04t8+UE+Sv6sgcnfUZ_rtkfk-pdXQiNfXxyCnVA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> 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

I think Wp and Ws are supposed to be between 0 and 1.

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20150119/318f5254/attachment.html>


More information about the SciPy-User mailing list