[SciPy-user] butterworth filter

David Cournapeau david@ar.media.kyoto-u.ac...
Tue Sep 16 21:53:57 CDT 2008


Stef Mientki wrote:
> As an engineer I would say -120 dB equals -250 dB, so the graphs are equal.
> I really would like to see your lab, if your interested -250 dB ;-)
> In Matlab you probably never get to know how the frequency response is 
> calculated,

That's not entirely accurate. A lot of matlab functions are implemented
in matlab itself. That's the case for butterworth AFAICS (butterworth is
a big .m file, suggesting the implementation itself is in matlab). I
avoid reading the actual code itself, though, for licensing issues,
because I work a lot on scipy/numpy. But if you don't intend to write
this code for numpy/scipy, I guess you can read it.

> although presumable it's just a copy of  "Numerical recipes".

IIRC, there is no signal processing code in Numerical recipes. For
Butterworth, it should not be too difficult to check, though, because it
is a direct implementation of the analog domain filters. That's
certainly one of the easiest IIR to implement for anyone familiar with
digital signal processing (bilinear transform and co to go into digital
domain).

Looking at the code, for butterworth, I think the scipy implementation
may be a bit too naive in some corner cases. IIRC, you would be better
implementing a N order filter by cascading 2n order filters. In a former
life, I was really into synthesizer and digital sound processing, and I
know that it mattered in fixed point and even floating point (32 bits)
implementations, because for synthesizer, you like the corner cases (to
make boom boom and make you ear bleed in clubs).

cheers,

David


More information about the SciPy-user mailing list