Signal Generator - Generate various waveforms

Library

Sources

Description

The Signal Generator block can produce one of four different waveforms: sine wave, square wave, sawtooth wave, and random 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 During Simulation in the online Simulink documentation for details.

Wave form

The wave form: a sine wave, square wave, sawtooth wave, or random 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 (see Determining the Output Dimensions of Source Blocks). This option is not available when an external signal specifies time. In this case, if the Amplitude and Frequency parameters are column or row matrix values, the output is a 1-D vector.

Characteristics

Sample Time

Continuous

Scalar Expansion

Yes, of parameters

Dimensionalized

Yes

Multidimensionalized

Yes

Zero Crossing

No

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS