%% Generate a Sine Wave Signal
% Note:  If you are using R2016a or an earlier release, replace each call to the object with the equivalent step syntax. For example, obj(x) becomes step(obj,x).
% Generate a sine wave with an amplitude of 2, frequency of 10 Hz, and an initial phase of 0.

sine1 = dsp.SineWave(2,10);
sine1.SamplesPerFrame = 1000;
y = sine1();
plot(y)

%
% Generate two sine waves offset by a phase of pi/2 radians.

sine2 = dsp.SineWave;
sine2.Frequency = 10;
sine2.PhaseOffset = [0 pi/2];
sine2.SamplesPerFrame = 1000;
y = sine2();
plot(y)

% Copyright 2012 The MathWorks, Inc.