DSP Blockset    
Standard Deviation

Find the standard deviation of an input or sequence of inputs.

Library

Statistics

Description

The Standard Deviation block computes the standard deviation of each column in the input, or tracks the standard deviation of a sequence of inputs over a period of time. The Running standard deviation parameter selects between basic operation and running operation.

Basic Operation

When the Running standard deviation check box is not selected, the block computes the standard deviation of each column in M-by-N input matrix u independently at each sample time.

For convenience, length-M 1-D vector inputs and sample-based length-M row vector inputs are both treated as M-by-1 column vectors. (A scalar input generates a zero-valued output.)

The output at each sample time, y, is a 1-by-N vector containing the standard deviation for each column in u. For purely real or purely imaginary inputs, the standard deviation of the jth column is the square root of the variance

where µj is the mean of jth column. For complex inputs, the output is the total standard deviation for each column in u, which is the square root of the total variance for that column.

Note that the total standard deviation is not equal to the sum of the real and imaginary standard deviations. The frame status of the output is the same as that of the input.

Running Operation

When the Running standard deviation check box is selected, the block tracks the standard deviation of each channel in a time-sequence of M-by-N inputs. For sample-based inputs, the output is a sample-based M-by-N matrix with each element yij containing the standard deviation of element uij over all inputs since the last reset. For frame-based inputs, the output is a frame-based M-by-N matrix with each element yij containing the standard deviation of the jth column over all inputs since the last reset, up to and including element uij of the current input.

If the Reset port parameter is set to Non-zero sample, the optional Rst port is enabled and the block resets the running standard deviation when the scalar input at the Rst port is nonzero. (The Rst port can be disabled by setting the Reset port parameter to None.)

As in basic operation, length-M 1-D vector inputs and sample-based length-M row vector inputs are both treated as M-by-1 column vectors.

Example

The Standard Deviation block in the model below calculates the running standard deviation of a frame-based 3-by-2 (two-channel) matrix input, u. The running standard deviation is reset at t=2 by an impulse to the block's Rst port.

The Standard Deviation block has the following settings:

The Signal From Workspace block has the following settings:

where

The Discrete Impulse block has the following settings:

The block's operation is shown in the figure below.

Dialog Box

Running standard deviation
Enables running operation when selected.
Reset port
Enables the Rst input port when set to Non-zero sample, and disables the Rst input port when set to None.

See Also

Mean
DSP Blockset
RMS
DSP Blockset
Variance
DSP Blockset
std
MATLAB


 Stack Submatrix