%% Reset an IIR Halfband 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).
% Create an IIR halfband decimator with default properties.

IIRHalfbandDecim = dsp.IIRHalfbandDecimator;

%
% Create a two-channel random signal. Apply the step method twice on the signal.

x = randn(10,2);

y1 = IIRHalfbandDecim(x);
y2 = IIRHalfbandDecim(x);

no = all(y2==y1)

%
% The output is different because the internal states of IIRHalfbandDecim have changed. Use reset to reset the IIR halfband decimator and apply  step again. Verify that the output is unchanged.

reset(IIRHalfbandDecim)

y3 = IIRHalfbandDecim,(x);

yes = all(y3==y1)

% Copyright 2012 The MathWorks, Inc.