| Signal Processing Blockset™ | ![]() |
| On this page… |
|---|
Signals in the Simulink environment can be real or complex valued. They can be represented with data types such as single-precision floating point, double-precision floating point, or fixed point. Signals can be either sample based or frame based, single channel or multichannel.
A discrete-time signal is a sequence of values that correspond to particular instants in time. The time instants at which the signal is defined are the signal's sample times, and the associated signal values are the signal's samples. For a periodically sampled signal, the equal interval between any pair of consecutive sample times is the signal's sample period, Ts. The sample rate, Fs, is the reciprocal of the sample period. It represents the number of samples in the signal per second:
![]()
Note In the block parameter dialog boxes, the term sample time refers to the sample period of the signal Ts. |
Some Signal Processing Blockset blocks have state and others do not. If a block does not have state, the block calculates its output using only the current input. If a block has state, the output of the block depends on the current input as well as past inputs and/or outputs.
A signal is sample based if it is propagated through the model one sample at a time. To represent a single-channel sample-based signal, create a 1-by-1-by-T matrix. Each matrix element represents one sample from the channel, and T is the total number of samples in the channel. To represent a multichannel signal with M*N independent channels, create an M-by-N-by-T matrix. Each matrix element represents one sample from a distinct channel, and T is the total number of samples in each channel.
Consider the following model.

The Signal From Workspace block outputs a sample-based signal. The Gain block multiplies all the samples of the signal by two. Then, the Signal To Workspace block outputs the signal to the MATLAB workspace in a variable called yout. The following figure is a symbolic representation of how the single-channel, sample-based signal is propagated through the model.

If you type yout at the MATLAB command prompt after you run the model, you see, in part:
yout(:,:,1) =
2
yout(:,:,2) =
4
yout(:,:,3) =
6
Because yout represents a single-channel, sample-based signal, each sample of the signal is a different page of the output matrix.
A signal is frame based if it is propagated through a model one frame at a time. A frame of data is a collection of sequential samples from a single channel or multiple channels. One frame of a single-channel signal is represented by a M-by-1 column vector. One frame of a multichannel signal is represented by a M-by-N matrix. Each matrix column is a different channel, and the number of rows in the matrix is the number of samples in each frame.
You can typically specify whether a signal is frame based or sample based using a source block from the Signal Processing Sources library. Most other signal processing blocks preserve the frame status of an input signal, but some do not.
The process of propagating frames of data through a model is called frame-based processing. Because multiple samples can be processed at once, the computational time of the model improves. Working with Signals in the Signal Processing Blockset User's Guide contains more information about frame-based processing.
Consider the following model.

To have the Signal From Workspace block output a frame-based signal, set the Samples per frame parameter to 2 and run the model. The lines that connect the blocks become double lines, indicating a frame-based signal; in this example, there are two signals per frame.
The Gain block multiplies all the samples of this signal by two. Then, the Signal To Workspace block outputs the signal to the MATLAB workspace in the form of a variable called yout. The following figure is a symbolic representation of how the frame-based signal is propagated through the model.

If, after you run the model, you type yout at the MATLAB command prompt, the following is a portion of what you would see:
yout =
2
4
6
8
10
12
Because yout represents a single-channel, frame-based signal, the output is a column vector. Note that once you export your signal values into the MATLAB workspace, they are no longer grouped into frames.
There are some parameters that you can change, or tune, during simulation. Many parameters cannot be changed while a simulation is running. This is usually the case for parameters that directly or indirectly alter a signal's dimensions or sample rate.
To change a tunable parameter during simulation, double-click the block to open its block parameters dialog box, change any tunable parameters to the desired settings, and then click OK. The simulation now uses the new parameter settings.
Note Opening a dialog box for a source block causes Simulink to pause. While Simulink is paused, you can edit the parameter values. However, you must close the dialog box to have the changes take effect and allow Simulink to continue. |
In addition to changing tunable parameters during simulation when Simulink is in Normal mode, you can also change tunable parameters when Simulink is in Accelerator mode or External mode.
Note When a parameter is marked "Tunable" in a reference page, it is tunable only when Simulink is in Normal mode, and not in Accelerator mode or External mode, unless indicated otherwise. |
For more information on tunable parameters, see the Tunable Parameters section of the Simulink documentation.
![]() | Sample Model and Block Libraries | Signal Processing Blockset Product Features | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |