Choosing the correct sampling frequency for lowpass IIR

16 views (last 30 days)
I've been producing contact force data from an ANSY dynamic FE model which is solved at 200hz. Available benchmarks insist on filtering the resultant data to only show results of 0-20hz, so i've coded a lowpass zerophase iir filter. I've been told the filter sampling should not exceed solving frequency.
However this massively exaggerates high and low values, 300 becomes 350 and 0 becomes -50. It seems like increasing the sampling rate may resolve some of these issues. I'm unsure of the best practise here, moreover is it okay to oversample a dataset, if not why not?
My filter shown below:
%%Parameter Inputs
Fp=20; % Input Lowpass cut off frequency
Fs=200; % Input Lowpass sampling frequency, equal to substep frequency
%%Lowpass filter design & display filter properties
Fnorm = Fp/(Fs/pi); % Frequency normalised
df = designfilt('lowpassiir',... %Filter Design
'PassbandFrequency',Fnorm,...
'FilterOrder',20,...
'PassbandRipple',0.05,...
'StopbandAttenuation',50);

Answers (1)

Star Strider
Star Strider on 2 Apr 2018
If your sampling frequency is 200 Hz, the highest uniquely resolvable signal in your data is 100 Hz (the Nyquist frequency).
A lowpass filter (regardless of type or design) with a passband frequency of 20 Hz will only produce output data with a frequency content of 0 to 20 Hz. I would specify a stopband frequency of at most 30 Hz with your filter. A stopband frequency of 200 Hz is impossible, since the frequency content of your signal is only 0 to 100 Hz.
  4 Comments
Amedee Vautravers
Amedee Vautravers on 3 Apr 2018
Thanks again! Just to make sure, my model is solved at 200hz and i'm looking to optimise the sampling frequency of my lowpass filter and I think what you're saying is there's no point having filter sampling frequency greater than my solutions nyquist frequency.
Star Strider
Star Strider on 3 Apr 2018
My pleasure!
First, I’m not certain what you mean by:
‘... my model is solved at 200hz ...’
I assume that means that the sampling frequency of the simulation is 200 Hz. If so, that must be the sampling frequency of your filter.
Second, you’re correct in stating:
‘... there's no point having filter sampling frequency greater than my solutions nyquist frequency.’
Actually, it isn’t possible to design a discrete (digital) filter with any defined passband or stopband frequencies less than 0 Hz (d-c) or greater than the Nyquist frequency. (The MATLAB filter design functions require that bandpass or bandstop filter passband or stopband frequencies not include those limits.) However lowpass or highpass filters can include those frequency limits, by default.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!