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)
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.