Designing a higher order lowpass filter to avoid Gibbs phenomenon
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dhanushka Palipana
am 12 Mai 2020
Kommentiert: Star Strider
am 13 Mai 2020
Hello!
I'm designing a simple but higher order lowpass filter to get rid of the Gibbs Phenomenon. This is what I thought of. Am I correct? Is this a valid filter?
d = designfilt('lowpassiir', 'FilterOrder',20,... % Response type
'PassbandFrequency',400, ... % Frequency constraints
'MatchExactly','passband', ... % Design method options
'SampleRate',2000)
I want to keep it simple having only cutoff frequency and the order as variables. (I assumed 'Match exactly' should be 'passband' because I need the filter to depend on cutoff frequency. Is this not necessary?)
How should I compensate for the delay in this? Since it is an IIR filter, it's only a phase shift, am I right?
Thank you!!
0 Kommentare
Akzeptierte Antwort
Star Strider
am 13 Mai 2020
I could not get that code to work.
Try this:
Fs = 2000; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = 400/Fn; % Normalised Passband (Passband = 5 Hz To 40 Hz)
Ws = 450/Fn; % Normalised Stopband (Passband = 2 Hz To 45 Hz)
Rp = 1; % Passband Ripple/Attenuation
Rs = 60; % Stopband Ripple/Attenuation
[n,Wp] = ellipord(Wp, Ws, Rp, Rs); % Calculate Elliptic Filter Optimum Order
[z,p,k] = ellip(n, Rp, Rs, Wp,'low'); % Elliptic Filter
[sos,g] = zp2sos(z,p,k); % Second-Order-Section For Stability
figure
freqz(sos, 2^26, Fs)
To use it with filtfilt:
y_filtered = filtfilt(sos, g, y);
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Digital Filter Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!