# Lowpass Butterworth filter equation

I am using a 5th order lowpass Butterworth filter with a varying cutoff frequency, $$f_c$$, to smoothen some data coming from a spectrometer. An example of a spectrum, plotted with the filtered data, looks like this: The spectrum thus consists of intensity values over a range of energies.

To apply the filter, I have used the SciPy signal butterworth filter, applied like this:

b, a = signal.butter(5, fc, 'low')
self.spec = signal.filtfilt(b, a, self.lowpassdata)


where fc is the cutoff frequency, and self.lowpassdata is an array with the data plotted in orange above. self.spec is the resulting filtered dataset.

I have been doing this quite blindly (at least it works) but I would like to know what actually happens, i.e. if the filter follows a specific mathematical function that takes the order, the cutoff frequency, and the spectral data as input.

Thank you!

• If I got your question correct, are you asking how the filter can be applied to the signal? Mar 26 '20 at 9:31
• I have (blindly) been using the filter to smoothen the spectrum, but I want to know the mathematics that is behind it, as in what the filter actually does. All I know is that it works
– Sara
Mar 26 '20 at 9:56
• Sara, you're not telling us how you've been using the filter on what kind of spectral data; please extend your question to explain that – your question can't be answered without. Mar 26 '20 at 10:41
• Hi Marcus, thanks for the hint - I have edited my question, let me know if it makes the question clearer.
– Sara
Mar 26 '20 at 11:50
• To explain Butterworth filter mathematical details and how it does filtering - I am not sure if someone would be patient enough to answer. Did you search in google before asking it? It is one of the fundamental filters out there so there would be excellent references including wikipedia page. You should be able to follow it if you have knowledge of undergraduate mathematics. Please feel free to ask if you are really stuck though. Mar 26 '20 at 12:02