Using Simulink     Search    Help Desk 
Sine Wave

Generate a sine wave.

Library

Sources

Description

The Sine Wave block provides a sinusoid. The block can operate in either continuous or discrete mode.

The output of the Sine Wave block is determined by:

The value of the Sample time parameter determines whether the block operates in continuous mode or discrete mode:

Using the Sine Wave Block in Discrete Mode

A Sample time parameter value greater than zero causes the block to behave as if it were driving a Zero-Order Hold block whose sample time is set to that value.

Using the Sine Wave block in this way allows you to build models with sine wave sources that are purely discrete, rather than models that are hybrid continuous/discrete systems. Hybrid systems are inherently more complex and, as a result, take longer to simulate.

The Sine Wave block in discrete mode uses an incremental algorithm rather than one based on absolute time. As a result, the block can be useful in models intended to run for an indefinite length of time, such as in vibration or fatigue testing.

The incremental algorithm computes the sine based on the value computed at the previous sample time. This method makes use of the following identities:

These identities can be written in matrix form.

Since t is constant, the following expression is a constant.

Therefore the problem becomes one of a matrix multiply of the value of sin(t) by a constant matrix to obtain sin(t+t). This algorithm may also be faster on computers that do not have hardware floating-point support for trigonometric functions.

Using the Sine Wave Block in Continuous Mode

A Sample time parameter value of zero causes the block to behave in continuous mode. When operating in continuous mode, the Sine Wave block can become inaccurate due to loss of precision as time becomes very large.

Data Type Support

A Sine Wave block accepts and outputs real signals of type double.

Parameters and Dialog Box

Amplitude
The amplitude of the signal. The default is 1.
Frequency
The frequency, in radians/second. The default is 1 rad/sec.
Phase
The phase shift, in radians. The default is 0 radians.
Sample time
The sample period. The default is 0.

Characteristics

Sample Time
Continuous, discrete, or inherited
Scalar Expansion
Of parameters
Vectorized
Yes
Zero Crossing
No



[ Previous | Help Desk | Next ]