Filter löschen
Filter löschen

How can i design a correct lowpass filter with the Filter Design Assistant?

5 Ansichten (letzte 30 Tage)
Hi! I try to design a simple lowpass filter to keep only the frequencys below 200Hz.
d1 = designfilt('lowpassiir', 'PassbandFrequency', XXX, 'StopbandFrequency', XXX, 'PassbandRipple', XXX, 'StopbandAttenuation', XXX, 'SampleRate', 1000);
My sampling ratio is 1000.
What should be my inputs at:
-PassbandFrequency
-StopbandFrequency
-StopbandAttenuation
-PassbandRipple
I only want to keep the 0-200Hz.
Any instructions?
  1 Kommentar
Angelos Mongolias
Angelos Mongolias am 9 Aug. 2019
Bearbeitet: Angelos Mongolias am 9 Aug. 2019
In some applications that i am using, i need only the limit of 200Hz. That's why i am confused.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 9 Aug. 2019
It is actually straightforward to design your filter using the various functions:
Fs = 1000; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = 200/Fn; % Passband Normalised
Ws = 250/Fn; % Stopband Normalised
Rp = 1; % Passband Ripple (Irrelevant in Butterworth)
Rs = 50; % Stopband Attenuation
[n,Wn] = buttord(Wp,Ws,Rp,Rs); % Order Calculation
[z,p,k] = butter(n,Wn); % Zero-Pole-Gain
[sos,g] = zp2sos(z,p,k); % Second-Order Section For Stability
figure
freqz(sos, 2^16, Fs) % Filter Bode Plot
I prefer elliptical filters that here would be designed as:
Fs = 1000; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = 200/Fn; % Passband Normalised
Ws = 210/Fn; % Stopband Normalised
Rp = 1; % Passband Ripple (Irrelevant in Butterworth)
Rs = 50; % Stopband Attenuation
[n,Wp] = ellipord(Wp,Ws,Rp,Rs); % Order Calculation
[z,p,k] = ellip(n,Rp,Rs,Wp); % Zero-Pole-Gain
[sos,g] = zp2sos(z,p,k); % Second-Order Section For Stability
figure
freqz(sos, 2^16, Fs) % Filter Bode Plot
Elliptic discrete filters are much more computationally efficient than other designs.
If you have R2018a or later, you can also use the lowpass function to design your filter. For all of these filters (the ones I design here and the second output from the lowpass function), use filtfilt to filter your signal with it.

Kategorien

Mehr zu Filter Design and Analysis finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by