DSP Blockset
  Go to block:
    Search    Help Desk 
Sine Wave    See Also

Generate samples of one or more sine waves over time.

Library

DSP Sources

Description

The Sine Wave block generates one or more sinusoidal signals with independent amplitude, frequency, and phase characteristics.

The Amplitude, Frequency, and Phase parameters specify the characteristics (A, , and ) of the generated sine waves. Each parameter value can be a scalar or a length-N vector, where N is the number of sine waves to output. A particular sine wave in the output is defined by the corresponding elements of the A, , and vectors. For example, A5, 5, and 5 define the characteristics of the fifth sinusoid in the output, y5. If a scalar value is specified for one of these parameters, the value is applied to each output sinusoid.

The figure below shows the block dialog configured to generate 3 sinusoidal signals:

   1.
A = 1, = 2, = 0
   2.
A = 2, = , = 0
   3.
A = 3, = /2, = /2

The Sample mode parameter specifies the block's sampling property, Continuous or Discrete:

Discrete Computational Methods

When Discrete is selected from the Sample mode parameter, the Computation method parameter provides two options for generating the discrete sinusoid, Trigonometric functions and Differential method.

Frame-Based Operation

In both discrete modes (differential or transcendental), the block can optionally buffer the output samples into frames.

In these modes the block computes and buffers the number of samples (for each individual sine) specified by the Samples per frame parameter value, M, and outputs this frame of samples with a frame period of M*Ts (where Ts is specified by the Sample time parameter). When the Samples per frame value is 1 (default), the block successively outputs the individual samples with a sample period of Ts.


For the general case of N independent sinusoidal outputs, the output is an M-by-N matrix with each column representing a distinct signal channel.

Dialog Box

Amplitude 
A vector containing the individual amplitudes of the sine waves in the output (one amplitude for each sine), or a scalar to be applied to all. The vector length must be the same as that specified for the Frequency and Phase parameters. The amplitude values can be altered while a simulation is running, but the vector length must remain the same.
Frequency 
A vector containing the frequencies of the sine waves in the output (one frequency for each sine, in rads/sec), or a scalar to be applied to all. The vector length must be the same as that specified for the Amplitude and Phase parameters. The frequency values can be altered while a simulation is running, but the vector length must remain the same. (The Frequency parameter is not tunable in Simulink's external mode when using the differential method.)
Phase 
A vector containing the phase offsets of the sine waves in the output (one phase offset for each sine, in radians), or a scalar to be applied to all. The vector length must be the same as that specified for the Amplitude and Frequency parameters. The phase values can be altered while a simulation is running, but the vector length must remain the same. (The Frequency parameter is not tunable in Simulink's external mode when using the differential method.)
Sample mode
The block's sampling behavior, Continuous or Discrete.
Computation method
The method by which discrete-time sinusoids are generated.
Sample time
The period with which the sine wave is sampled, Ts. The block's output frame period is M*Ts, where M is specified by the Samples per frame parameter.
Samples per frame
The number of consecutive samples from each sinusoid to buffer into the output frame, M.
State when reenabled
The behavior of the block when a disabled subsystem that contains it is reenabled. The block can either reset itself to its starting state (Restart at time zero), or resume generating the sinusoid based on the current simulation time (Catch up to simulation time).

See Also

Chirp
Signal From Workspace
Signal Generator (Simulink)
Sine Wave (Simulink)
sin (MATLAB)


[ Previous | Help Desk | Next ]