www.gusucode.com > signal 案例源码程序 matlab代码 > signal/BandstopIIRFilterExample.m

    %% Bandstop IIR Filter
% Design a 20th-order bandstop IIR filter with lower 3-dB frequency 500 Hz
% and higher 3-dB frequency 560 Hz. The sample rate is 1500 Hz. Visualize
% the magnitude response of the filter. Use it to filter 1000 samples of
% random data.

% Copyright 2015 The MathWorks, Inc.


%%

bsFilt = designfilt('bandstopiir','FilterOrder',20, ...
         'HalfPowerFrequency1',500,'HalfPowerFrequency2',560, ...
         'SampleRate',1500);
fvtool(bsFilt)
dataIn = randn(1000,1);
dataOut = filter(bsFilt,dataIn);