%% Impulse and Frequency Response of CIC Compensation Interpolator
% Design an CIC compensation interpolator. Specify the interpolation factor to be 2, passband frequency to be 200 Hz, stopband frequency to be 500 Hz, and the input sample rate to be 600 Hz.

fs = 600;
fPass = 200;
fStop = 500;

CICCompInterp = dsp.CICCompensationInterpolator('InterpolationFactor',2,'PassbandFrequency',fPass, ...
    'StopbandFrequency',fStop,'SampleRate',fs);

%
% Plot the impulse response. The zeroth order coefficient is delayed 6 samples, which is equal to the group delay of the filter.

fvtool(CICCompInterp,'Analysis','impulse')

%
% Plot the magnitude and Phase response.

fvtool(CICCompInterp,'Analysis','freq')

% Copyright 2012 The MathWorks, Inc.