# Cut off frequency of low pass filter

I have a data here, I want to make sense of Lowpass filtering function in Mathematica.I do not fully understand units of cut off frequency in this option since the data is in frequency space. What I would like to do is to eliminate the small oscillation. It turns out that the Lowpass filter is doing its job

I have done the following.

ListPlot[data, PlotRange -> All, Joined -> True]


and secondly,

ListPlot[Transpose[{data[[All, 1]],
LowpassFilter[data[[All, 2]], 0.1]}], Joined -> True,
PlotRange -> All, AxesLabel -> {"Frequency (Hz)", "Scaled intensity with offset correction"}]


Here; what is the unit of the cut off frequency which is "0.1".

I know that I should define a sample rate in order to know the cut-off frequency. But from the definition of Lowpass filtering, I saw that the sample rate is automatically defined.

Could anyone please explain me how do I make sense of the cut-off frequency 0.1 and its unit in this example?

• Is your data given as a time series or as amplitudes/power for specific frequencies? – Thies Heidecke Aug 28 '17 at 12:43
• I ask because LowpassFilter[] expects time series data. If your data is given already in the frequency domain you usually just multiply your spectrum by the filter frequency response. – Thies Heidecke Aug 28 '17 at 12:49
• If you want to know the physical units of the LowpassFilter, you need to be clear on the physical units of your data. You label the vertical axis "Intensity", but this is nonsense since intensity is watts per square metre en.wikipedia.org/wiki/Intensity_(physics) and hence is always positive, yet you show negative values. Your horizontal axis is also suspicious, since you only show a very small part of the frequency axis. You need to describe the meaning of the data in order to know the meaning of the operations carried out on it. – bill s Aug 30 '17 at 14:16
• Here's what you need at a minimum: how many samples are there in your data per unit of the horizontal axis (frequency, in your case). Usually in a time based filtering, this is samples per second. In your case, you need to specify number of samples per Hz. – bill s Aug 30 '17 at 15:05
• Since your data is in frequency units, the cut off frequency for LowPassFilter will be in time units. Specifically, since your data is intensities, the cut off will refer to a cut off lag in the autocorrelation function of the amplitude time series behind your intensities. But does that actually mean anything in the context of your problem? If you want to smooth this data, I'd suggest using MovingAverage: at least it will be clear what you're doing. Or you could do some kind of fit. – John Doty Aug 30 '17 at 15:10

sr = (Max[data[[All, 1]]] - Min[data[[All, 1]]])/(Length[data] - 1)
400


where sr is in "Hz per sample." This is 1/400 samples per Hz, so when you are choosing the parameter 0.1 for the LowpassFilter, you are selecting a filter with about 1/(0.1/400) = 4000 Hz bandwidth. To check this, make a time series object and lowpassfilter it:

tsData = TimeSeries[data];
ListPlot[LowpassFilter[tsData, 0.1/400]]


Observe that this is identical to your original filtered output given by

ListPlot[Transpose[{data[[All, 1]], LowpassFilter[data[[All, 2]], 0.1]}]]

• Awesome, Thank you very much bill s, Now I got you. – TM90 Aug 31 '17 at 1:55
• Er… I think the bandwidth should be 0.1/(1/400)/(2 Pi)? – xzczd Aug 31 '17 at 2:21