Generate discrete sine wave
The dsp.SineWave
System object™ generates a real or complex, multichannel sinusoidal signal with independent
amplitude, frequency, and phase in each output channel.
For both real and complex sinusoids, the Amplitude, Frequency, and PhaseOffset properties can be scalars or length-N vectors, where N is the number of channels in the output. When you specify at least one of these properties as a length-N vector, scalar values specified for the other properties are applied to each of the N channels.
To generate a discrete-time sinusoidal signal:
Create the dsp.SineWave
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?.
creates a sine wave
object that generates a real-valued sinusoid with an amplitude of 1, a frequency of 100
Hz, and a phase offset of 0. By default, the sine wave object generates only one
sample.sine
= dsp.SineWave
creates a sine wave object with each specified property set to the specified value.
Enclose each property name in single quotes. sine
= dsp.SineWave(Name,Value
)
creates a sine wave object with the Amplitude property set to sine
= dsp.SineWave(amp,freq,phase,Name,Value
)amp
, Frequency property set to freq
,
PhaseOffset property set to phase
,
and anyother specified properties set to the specified values.
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)