Products & Services Solutions Academia Support User Community Company

Learn more about Signal Processing Blockset   

Key Blockset Concepts

Signals

Signals in the Simulink environment can be real or complex valued. You can represent signals 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, and single channel or multichannel.

Sample Time

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 sample times, and the associated signal values are the signal samples. For a periodically sampled signal, the equal interval between any pair of consecutive sample times is the signal 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:

State

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.

Sample-Based Signals

A signal is sample based if it propagates 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 propagates 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.

Frame-Based Signals

A signal is frame based if it propagatesthrough 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 an M-by-1 column vector. One frame of a multichannel signal is represented by anM-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 frame-based processing. Because multiple samples can process 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 propagatesthrough 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. Once you export your signal values into the MATLAB workspace, they are no longer grouped into frames.

Tunable Parameters

There are some parameters that you can change, or tune, during simulation. To change a tunable parameter during simulation, double-click the block to open its dialog box, change any tunable parameters to the desired settings, and then click OK. The simulation now uses the new parameter settings.

As a rule, parameters that specify numeric values are tunable. However, some parameters are not tunable, such as parameters that change the operational mode of a block. For example, you cannot directly or indirectly change the following while a simulation is running:

For more information on tunable parameters, see the Tunable Parameters section of the Simulink documentation.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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