%% Reset an FIR Decimator
% Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

firdecim = dsp.FIRDecimator;
x = cos(pi/8*(0:1023)')+sin(pi/4*(0:1023)');
y = firdecim(x);

%
% Call the FIR decimator again without reset.

y1 = firdecim(x);
isequal(y,y1)

%
% Reset filter states.

reset(firdecim);

%
% Call the FIR decimator again.

y2 = firdecim(x);
isequal(y,y2)

% Copyright 2012 The MathWorks, Inc.