www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/DefaultResamplingFactorExample.m

    %% Computational Cost of a 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.

% Copyright 2015 The MathWorks, Inc.


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)