[SciPy-user] Lowpass Filter

Christopher Brown c-b at asu.edu
Thu Feb 5 12:28:47 EST 2009


Hi Marco,

M> Let's suppose a to be a 1D array with N elements.
M> Basically, it's a signal of some sort.
M>
M> How do I apply a low pass filter (with selected frequency and width)
M> to this signal?
M> How to store the resulting, filtered, signal, in a new array?
M>
M> I had a look at lp2lp() in scipy.signal, but it returns, if I am
M> right, a filter object, which then I dunno how to use to filter my
M> data.
M>
M> Any ideas or pointers?

The following is a low-pass Butterworth filter

cutoff = 500.
fs = 44100.
nyq = fs/2.
filterorder = 5

b,a = scipy.signal.filter_design.butter(filterorder,cutoff/nyq)
filteredsignal = scipy.signal.lfilter(b,a,signal)

-- 
Chris



More information about the SciPy-User mailing list