%% Plot Time-Varying Magnitude Response of FIR Filter
% Design an FIR filter with time-varying magnitude response. Plot this varying response on a dynamic filter visualizer.
% Create a dsp.DynamicFilterVisualizer object.

dfv = dsp.DynamicFilterVisualizer('YLimits',[-120 10])

% Vary the cutoff frequency of the FIR filter, k, from 0.1 to 0.5 in increments of 0.001. View the varying magnitude response using the dynamic filter visualizer.

for k = 0.1:0.001:0.5
    b = fir1(90,k);
    dfv(b,1);
end

%
% Copyright 2018 The MathWorks, Inc.