필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Angelos Mongolias
Angelos Mongolias 2019년 8월 9일
댓글: Star Strider 2019년 8월 10일
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
Angelos Mongolias
Angelos Mongolias 2019년 8월 9일
편집: Angelos Mongolias 2019년 8월 9일
In some applications that i am using, i need only the limit of 200Hz. That's why i am confused.

댓글을 달려면 로그인하십시오.

답변 (1개)

Star Strider
Star Strider 2019년 8월 9일
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.

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by