how to design a filter

2 次查看(过去 30 天)
saikumar reddy
saikumar reddy 2019-11-7
please help to design a filter

回答(1 个)

Star Strider
Star Strider 2019-11-7
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.

类别

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