%% Computational Cost of Sample Rate Converter
% Create src, a multistage sample rate converter with default values. src combines three filter stages to convert from 192 kHz to 44.1 kHz. Determine its computational cost: the number of coefficients, the number of states, the number of multiplications per unit sample, and the number of additions per unit sample.

src = dsp.SampleRateConverter;
cst = cost(src)

%
% Repeat the computation allowing a tolerance of 10% in the output sample rate.

src.OutputRateTolerance = 0.1;
ctl = cost(src)

% Copyright 2015 The MathWorks, Inc.