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

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

% Copyright 2015 The MathWorks, Inc.