Generate continuous or discrete sine wave
DSP System Toolbox / Sources
DSP System Toolbox HDL Support / Sources
The Sine Wave block generates a multichannel real or complex sinusoidal signal, with independent amplitude, frequency, and phase in each output channel. The block supports floating point and signed fixed-point data types.
The block generates a real sinusoidal signal when you set the Output
complexity parameter to Real
. The real
sinusoidal output is defined by an expression of the type
where you specify A in the Amplitude parameter, f in hertz in the Frequency parameter, and ϕ in radians in the Phase offset parameter.
The block generates a complex exponential signal when you set the Output
complexity parameter to Complex
. This complex
exponential signal is defined by an expression of the type
For both real and complex sinusoids, the Amplitude, Frequency, and Phase offset parameter values (A, f, and ϕ) can be scalars or length-N vectors, where N is the desired number of channels in the output. When you specify at least one of these parameters as a length-N vector, scalar values specified for the other parameters are applied to every channel.
For example, to generate the three-channel output containing the following real sinusoids, set the block parameters as shown:
Output complexity =
Real
Amplitude = [1 2 3]
Frequency = [1000 500 250]
Phase offset = [0 0 pi/2]
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|