MATLAB: IIR Bandstop (Notch) Filter design

iir bandstop filter

Im new to filter design and I'd like to design an IIR bandstop filter with the following conditions:
2.01: 200 Hz,
2.02: 15 Hz bandwidth,
2.03: 30 dB depth,

Best Answer

I have absolutely no idea what ‘2.01’, ‘2.02’ and ‘2.03’mean.
Here is a prototype bandstop filter design that you can change to produce the filter you want:
Fs = 900; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = [48 52]/Fn; % Stopband Frequency (Normalised)
Ws = [0.9 1.1].*Wp; % Passband Frequency (Normalised)
Rp = 1; % Passband Ripple
Rs = 90; % 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 Fs/5]) % Optional

set(subplot(2,1,2), 'XLim',[0 Fs/5]) % Optional
% signal_filt = filtfilt(sos, g, signal); % Filter Signal
Un-comment the filtfilt line to filter your signal.
Related Question