%% Magnitude Response of Digital Down Converter
% Plot the magnitude response of the digital down converter using the fvtool function and the visualizeFilterStages function.
% Create a dsp.DigitalDownConverter System object with the default settings. Using the fvtool function, plot the magnitude response of the overall filter cascade. The visualizeFilterStages function in addition plots the magnitude response of the individual filters stages.

dwnConv = dsp.DigitalDownConverter

%
%% Using fvtool
% If the System object is unlocked, you must specify the filter arithmetic through the 'Arithmetic' input of the fvtool function. If the System object is locked, the arithmetic input is ignored.

fvtool(dwnConv,'Arithmetic','fixed-point')

%
%% Using visualizeFilterStages
% To view the magnitude response of the individual filter stages, call the visualizeFilterStages function.

visualizeFilterStages(dwnConv,'Arithmetic','fixed-point')

% Copyright 2018 The MathWorks, Inc.