Sine Wave
Generate continuous or discrete sine wave
Libraries:
DSP System Toolbox / Sources
DSP System Toolbox HDL Support / Sources
Description
TheSine Waveblock 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 theOutput complexityparameter toReal
. The real sinusoidal output is defined by an expression of the type
你指定Ain theAmplitudeparameter,fin hertz in theFrequencyparameter, andϕin radians in thePhase offsetparameter.
The block generates a complex exponential signal when you set theOutput complexityparameter toComplex
. This complex exponential signal is defined by an expression of the type
Generating Multichannel Outputs
For both real and complex sinusoids, theAmplitude,Frequency, andPhase offsetparameter values (A,f, andϕ) can be scalars or length-Nvectors, whereNis the desired number of channels in the output. When you specify at least one of these parameters as a length-Nvector, 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]
Ports
Output
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Algorithms
Extended Capabilities
Version History
Introduced before R2006a
See Also
Blocks
- Chirp|Signal From Workspace|Signal Generator(Simulink)|Sine Wave(Simulink)|Enabled Subsystem(Simulink)