how to design a filter

28 visualizaciones (últimos 30 días)
saikumar reddy
saikumar reddy el 7 de Nov. de 2019
Respondida: Star Strider el 7 de Nov. de 2019
please help to design a filter

Respuestas (1)

Star Strider
Star Strider el 7 de Nov. de 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.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by