%% Reset an FIR Interpolator
% 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).
% Reset filter states to 0 to produce consistent output.

firinterp = dsp.FIRInterpolator(2);
x =[1 -1]'; x = repmat(x,8,1);
y = firinterp(x); % Filter states are nonzero

%
% Use reset method to set states to zero.

reset(firinterp);

%
% Apply FIR interpolator to input x

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

% Copyright 2012 The MathWorks, Inc.