Designing a specific low-pass discrete filter in MATLAB
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jonathan George
am 25 Mär. 2022
Kommentiert: Star Strider
am 26 Mär. 2022
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.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 26 Mär. 2022
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
The passband frequency is acceptably close to the designed value for ‘Fp’.
.
2 Kommentare
Star Strider
am 26 Mär. 2022
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')
the highest order with respect to z would be b(2). At least that is how I read it.
.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Analog Filters 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!
