[SciPy-user] butterworth filter

Ryan Krauss ryanlists@gmail....
Fri Sep 12 16:18:21 CDT 2008


So, attached is the plot I get from scipy.  It is a high pass filter.  It
seems reasonable.  What does the curve look like from Matlab.

Ryan

On Tue, Sep 9, 2008 at 8:37 AM, cyril giraudon <cyril.giraudon@free.fr>wrote:

> Hi,
>
> I use scipy 0.6.0 and i try to reproduce the plot of the matlab butter
> function web documentation (first response for a google request "matlab
> butter example").
>
> The matlab code is :
>
> [z,p,k] = butter(9,300/500,'high');
> [sos,g] = zp2sos(z,p,k);             % Convert to SOS form
> Hd = dfilt.df2tsos(sos,g);   % Create a dfilt object
> h = fvtool(Hd);              % Plot magnitude response
> set(h,'Analysis','freq')             % Display frequency response
>
>
> In scipy, I write :
>
> from scipy.signal import butter, freqz
>
> from pylab import show, grid, log, plot
>
> b, a = butter(9, 300./500., 'high')
>
> fi = freqz(b, a)
>
> plot(fi[0], 20*log(abs(fi[1])))
>
> grid()
>
> show()
>
>
>
> Why are the two filters not the same ?
>
>
> Thanks a lot,
>
> Cyril.
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20080912/42c1edb7/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: butter_scipy.png
Type: image/png
Size: 33022 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20080912/42c1edb7/attachment-0001.png 


More information about the SciPy-user mailing list