[SciPy-user] Lowpass Filter

Christopher Brown c-b@asu....
Thu Feb 5 11:28:47 CST 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