how to design a filter
28 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
please help to design a filter
0 Kommentare
Antworten (1)
Star Strider
am 7 Nov. 2019
Here is one for a bandstop filter:
Fs = 2250; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = [59 61]/Fn; % Stopband Frequency (Normalised)
Ws = [58 62]/Fn; % Passband Frequency (Normalised)
Rp = 1; % Passband Ripple
Rs = 60; % Passband Ripple (Attenuation)
[n,Wp] = ellipord(Wp,Ws,Rp,Rs); % Elliptic Order Calculation
[z,p,k] = ellip(n,Rp,Rs,Wp,'stop'); % Elliptic Filter Design: Zero-Pole-Gain
[sos,g] = zp2sos(z,p,k); % Second-Order Section For Stability
figure
freqz(sos, 2^18, Fs) % Filter Bode Plot
set(subplot(2,1,1), 'XLim',[0 100]) % Restrict Frequency Axis If Necessary To See Detail
set(subplot(2,1,2), 'XLim',[0 100]) % Restrict Frequency Axis If Necessary To See Detail
% signal_filt = filtfilt(sos, g, signal); % Filter Signal
Make appropriate changes to use it with your signals.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Digital Filter Analysis 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!