Simulink Reference Previous page   Next Page
Signal Generator

Generate various waveforms

Library

Sources

Description


The Signal Generator block can produce one of three different waveforms: sine wave, square wave, and sawtooth wave. The signal parameters can be expressed in Hertz (the default) or radians per second. This figure shows each signal displayed on a Scope using default parameter values.

A negative Amplitude parameter value causes a 180-degree phase shift. You can generate a phase-shifted wave at other than 180 degrees in a variety of ways, including connecting a Clock block signal to a MATLAB Fcn block and writing the equation for the particular wave.

You can vary the output settings of the Signal Generator block while a simulation is in progress. This is useful to determine quickly the response of a system to different types of inputs.

The block's Amplitude and Frequency parameters determine the amplitude and frequency of the output signal. The parameters must be of the same dimensions after scalar expansion. If the Interpret vector parameters as 1-D option is off, the block outputs a signal of the same dimensions as the Amplitude and Frequency parameters (after scalar expansion). If the Interpret vector parameters as 1-D option is on, the block outputs a vector (1-D) signal if the Amplitude and Frequency parameters are row or column vectors, i.e. single row or column 2-D arrays. Otherwise, the block outputs a signal of the same dimensions as the parameters.

Data Type Support

The Signal Generator block outputs a scalar or array of real signals of type double.

Parameters and Dialog Box

Opening this dialog box causes a running simulation to pause. See Changing Source Block Parameters in the online Simulink documentation for details.

Wave form
The wave form: a sine wave, square wave, or sawtooth wave. The default is a sine wave. This parameter cannot be changed while a simulation is running.
Time
Specifies whether to use simulation time as the source of values for the waveform's time variable or an external signal. If you specify an external time source, the block displays an input port for the time source.
Amplitude
The signal amplitude. The default is 1.
Frequency
The signal frequency. The default is 1.
Units
The signal units: Hertz or radians/sec. The default is Hertz.
Interpret vector parameters as 1-D

If selected, column or row matrix values for the Amplitude and Frequency parameters result in a vector output signal.

Characteristics

Sample Time
Continuous
Scalar Expansion
Yes, of parameters
Dimensionalized
Yes
Zero Crossing
No


Previous page  Signal Conversion Signal Specification Next page

© 1994-2005 The MathWorks, Inc.