필터 지우기
필터 지우기

Designing a specific low-pass discrete filter in MATLAB

조회 수: 8 (최근 30일)
Jonathan George
Jonathan George 2022년 3월 25일
댓글: Star Strider 2022년 3월 26일
How would I go about designing a 6th order low pass discrete filter with a 3dB frequency of 12Hz using the FIR (fir1) window approach, with the filter being designed to filter signals sampled at 100Hz?
Thank you in advance.

채택된 답변

Star Strider
Star Strider 2022년 3월 26일
Try this —
Fs = 100; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
order = 6;
Fp = 12; % Passband Frequency
h = fir1(6, Fp/Fn, 'low');
figure
freqz(h, 1, 2^16, Fs)
[h,f] = freqz(h, 1, 2^16, Fs); % Get Output
passband_freq = interp1(mag2db(abs(h)), f, -3) % Check Passband Frequency
passband_freq = 11.8608
The passband frequency is acceptably close to the designed value for ‘Fp’.
.
  댓글 수: 2
Jonathan George
Jonathan George 2022년 3월 26일
Thank you, Star. And one more question out of curiosity: how would I be able to determine the value of the highest order b coefficient of the discrete system with those results? Many thanks.
Star Strider
Star Strider 2022년 3월 26일
As always, my pleasure!
The ‘b’ coefficients are actually ‘h’ in my original code, so according to the documentation section on b since ‘The coefficients are sorted in descending powers of the Z-transform variable z’:
Fs = 100; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
order = 6;
Fp = 12; % Passband Frequency
b = fir1(6, Fp/Fn, 'low')
b = 1×7
0.0095 0.0717 0.2442 0.3493 0.2442 0.0717 0.0095
the highest order with respect to z would be b(2). At least that is how I read it.
.

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

추가 답변 (0개)

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by