%% Reset a Biquad Filter
% 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).

n =0:20;
x = cos(pi/4*n)+sin(pi/2*n);
biquad = dsp.BiquadFilter;
y = biquad(x');

%
% Call the biquad filter without invoking reset.

y1 = biquad(x');
isequal(y,y1)

%
% Reset filter states to zero.

reset(biquad);

%
% Call the biquad filter again.

y2 = biquad(x');
isequal(y,y2)

% Copyright 2012 The MathWorks, Inc.