This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


System object: dsp.SineWave
Package: dsp

Reset sine wave to the beginning




reset(sine) 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.

Reset the SineWave Signal

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 dsp.ColoredNoise System object™, myObject() becomes step(myObject). For all other objects, myObject(x) becomes step(myObject,x).

sine = dsp.SineWave('Amplitude',1,'Frequency',1/4,'SamplesPerFrame',7);

7 samples of a sine wave with frequency of 1/4 Hz

y = sine();

Call step method without reset

y1 = sine();
stem([y; y1])

y1 is a continuation of y. Now reset

y2 = sine();

y2 starts at n = 0 and equals y

ans =



Was this topic helpful?