%% Determine Filter Order
% Design a compensation decimator for a CIC decimator using the dsp.FilterCascade object. Determine the order of the overall filter.

cicdecim = dsp.CICDecimator('DecimationFactor', 6, ...
    'NumSections', 6);

fs = 16e3;     % Sampling frequency of input of compensation decimator
fPass = 4e3;   % Passband frequency
fStop = 4.5e3; % Stopband frequency
ciccomp = dsp.CICCompensationDecimator(cicdecim, ...
    'DecimationFactor', 2, ...
    'PassbandFrequency', fPass, ...
    'StopbandFrequency', fStop, ...
    'SampleRate', fs);

filtchain = dsp.FilterCascade(cicdecim, ciccomp);

order(filtchain)

% Copyright 2012 The MathWorks, Inc.