Waveform Generator
Output waveforms using signal notations
Libraries:
Simulink /
Sources
Description
The Waveform Generator block outputs waveforms based on signal notations that you enter in the Waveform Definition table.
This block supports these syntaxes for the signal notations:
Function syntax — Specify all arguments in the specific order for the signal syntax (see Algorithms).
Name-value syntax — Specify optional comma-separated pairs of
Name,Value
arguments.Name
is the argument name andValue
is the corresponding value.Name
must appear inside single quotes (' '
). You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN
. For more information, see Algorithms.
This block supports normal, accelerator, and rapid accelerator modes and fast restart.
Supported Operators
Operation | Operator |
---|---|
Absolute value |
abs()
|
Addition |
+
|
Division |
/
|
Multiplication |
*
|
Parentheses |
()
|
Subtraction |
-
|
Unary minus |
-
|
The Waveform block observes the following rules of operator precedence:
( )
+ -
(unary)* /
+ -
Supported Operations
The Waveform Generator block outputs one signal at a time. You can change this output signal. Express frequency and phase offset parameters in radians. You can also:
Nest signal notations, for example:
sin('Amplitude',sin('Amplitude',1,'Frequency',1,'Phase',0),'Frequency',1,'Phase',1)
Reference real scalar variables in the base or model workspace, for example:
sin('Amplitude',x,'Frequency',y,'Phase',z)
x, y, and z exist in the base workspace.
For more information on waveforms, see Algorithms.
To quickly determine the response of a system to different types of inputs, you can vary the output signal of the Waveform Generator block while a simulation is in progress.
Examples
Limitations
You cannot tune the parameters of a waveform, such as frequency or amplitude, during execution of the code that you generate by using Simulink® Coder™. Instead, you can generate code that enables you to switch between waveform variants that you specify. For more information, see Switch Between Output Waveforms During Code Execution for Waveform Generator Block (Simulink Coder).
Ports
Output
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Algorithms
Extended Capabilities
Version History
Introduced in R2015b