reset

System object: dsp.SineWave
Package: dsp

Reset sine wave to the beginning

Syntax

reset(H)

Description

reset(H) resets the sine wave object to the beginning (n=0). If you invoke the step method without first invoking the reset method, the sine wave object generates additional samples of the original sinusoid. As an example:

H = dsp.SineWave('Amplitude',1,'Frequency',1/4,'SamplesPerFrame',7);
% 7 samples of a sine wave with frequency of 1/4 Hz
y = step(H);
% Call step method without reset
y1 = step(H);
stem([y; y1])
% y1 is a continuation of y
% Now reset
reset(H);
y2 = step(H);
% y2 starts at n=0 and equals y
isequal(y,y2)
Was this topic helpful?