%% Get Decimation Factors
% Get decimation factors of each filter stage of the dsp.DigitalDownConverter System object™.
% Create a dsp.DigitalDownConverter System object with the default settings. Using the getDecimationFactors function, obtain the decimation factors of each stage of the object.

dwnConv = dsp.DigitalDownConverter
M = getDecimationFactors(dwnConv) %#ok

%
% The DecimationFactor property of the object is set to 100. The output M is by default a 1-by-3 vector, where each element in the vector is a factor of the overall decimation factor.
%
% When you set the DecimationFactor to a 1-by-2 vector, the object bypasses the third filter stage and sets the decimation factor of the first and second filtering stages to the values in the first and second vector elements respectively.

dwnConv.DecimationFactor = [10 10]
M = getDecimationFactors(dwnConv)

% The output of the getDecimationFactors function is now a 1-by-2 vector.
% Copyright 2018 The MathWorks, Inc.