Choosing the correct sampling frequency for lowpass IIR
Afficher commentaires plus anciens
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);
Réponses (1)
Star Strider
le 2 Avr 2018
0 votes
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 commentaires
Amedee Vautravers
le 2 Avr 2018
Star Strider
le 2 Avr 2018
My pleasure.
As I understood your original Question, the sampling frequency of your data is 200 Hz. The highest frequency you can resolve (and therefore the highest frequency you can filter) is half the sampling frequency.
The passband frequency in your original Question is 20 Hz.
Amedee Vautravers
le 3 Avr 2018
Star Strider
le 3 Avr 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.
Catégories
En savoir plus sur Single-Rate Filters dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!