%% Bandstop FIR Filter
% Design a 20th-order bandstop FIR filter with lower cutoff frequency 500 Hz and higher cutoff 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.

bsFilt = designfilt('bandstopfir','FilterOrder',20, ...
         'CutoffFrequency1',500,'CutoffFrequency2',560, ...
         'SampleRate',1500);
fvtool(bsFilt)
dataIn = randn(1000,1);
dataOut = filter(bsFilt,dataIn);

% Copyright 2015 The MathWorks, Inc.