[SciPy-User] SciPy and MATLAB give different results for 'buttord' function
Renan Birck Pinheiro
renan.ee.ufsm at gmail.com
Tue Jan 20 19:53:51 EST 2015
2015-01-20 22:47 GMT-02:00 KURT PETERS <peterskurt at msn.com>:
>
> I tried it myself and I get your MATLAB answer:
> file: buttest.py:
>
> #!/usr/bin/env python
>
> 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)
> print(N,Wn)
>
> ~]$ ./buttest.py
> (5, 99.581776302787929)
>
Which version of SciPy are you using? I tried with 0.14.0 and 0.15.0 but
couldn't reproduce your result.
While poking around in the issue tracker, I found this change:
https://github.com/scipy/scipy/pull/3235/files
where
W0 = nat / ((10 ** (0.1 * abs(gstop)) - 1) ** (1.0 / (2.0 * ord)))
was changed to
W0 = (GPASS - 1.0) ** (-1.0 / (2.0 * ord)).
which might explain something. The first implementation is how MATLAB
calculates Wn.
Renan
--
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/20150120/0bf19ddc/attachment.html>
More information about the SciPy-User
mailing list