[SciPy-user] butter function different from matlab?

Will Woods will.woods@ynic.york.ac...
Thu Aug 9 07:59:39 CDT 2007


I'm rather new to the scipy.signal module, so I appologise if I have 
missed something obvious, but I seem to be getting strange results from 
the 'butter' function.

In matlab, a 9th order higpass filter at 300 Hz on a signal sampled at 
1kHz would be:

 >> [B,A] = butter(9,300/500,'high')

B =

     0.0011   -0.0096    0.0384   -0.0895    0.1342   -0.1342    0.0895 
   -0.0384    0.0096   -0.0011


A =

     1.0000    1.7916    2.5319    2.1182    1.3708    0.6090    0.1993 
    0.0431    0.0058    0.0004




If I do the same with scipy.signal.butter, I get:

In [47]: (b,a)=butter(9,300/500,btype='high')

In [48]: (b,a)
Out[48]:
(array([   1.,   -9.,   36.,  -84.,  126., -126.,   84.,  -36.,    9., 
-1.]),
  array([   1.,   -9.,   36.,  -84.,  126., -126.,   84.,  -36.,    9., 
   -1.]))


It would seem that b is roughly 1000 * B, and that a is the same as b, 
while in matlab B and A are very different.

Can anyone explain why this is? The docs for matlab butter function 
appear to say the same thing as the scipy version.

Thanks

Will





More information about the SciPy-user mailing list