Apply custom low-pass filter to time domain waveform with scipy.signal

198 Views Asked by At

I am interested in applying a custom low-pas filter to a time domain signal using the various tools that SciPy provides.

I know how to apply a low-pass filter to a time domain waveform using the Butterwoth filter and filtering with sosfilt (see scipy.signal.butter). What I do not know is how to use SciPy's built-in tools to apply filtering using a custom filter that I have. How can I take my filter (attenuation vs frequency measured experimentally) and process it so I can feed it to the sosfilt method for instance? It probably is going to take extracting the polynomials or second-order sections representation of the filter in some way but I failed finding the relevant information in the SciPy's doc.

It might be something standard in signal processing but I am no expert.

For now I successfully applied "by hand" the filtering to the FFT of the time domain waveform and inversed FFT it to retrieve the filtered time domain waveform. It would be neat to not have to go the FFT route and use sosfilt instead.

Thanks!

0

There are 0 best solutions below