dsp.StandardDeviation

(To be removed) Standard deviation of input or sequence of inputs

Description

The dsp.StandardDeviation object computes the standard deviation for an input or sequence of inputs.

Note

The dsp.StandardDeviation System object™ will be removed in a future release. To compute the standard deviation, use the std function. To compute the running standard deviation in MATLAB®, use the dsp.MovingStandardDeviation object. For more information, see Compatibility Considerations.

To compute the standard deviation for an input or sequence of inputs:

  1. Create the dsp.StandardDeviation object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects? (MATLAB).

Creation

Description

std = dsp.StandardDeviation returns a standard deviation System object, std, that computes the standard deviation for the columns of input.

std = dsp.StandardDeviation(Name,Value) returns a standard deviation System object, std, with each specified property set to the specified value.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects (MATLAB).

Set this property to true to enable the calculation of standard deviation over successive calls to the object algorithm.

Set this property to true to enable resetting for the running standard deviation. When the property is set to true, you must specify a reset input to the object to reset the running standard deviation.

Dependencies

This property applies only when you set the RunningStandardDeviation property to true.

Specify event to reset the running standard deviation.

Dependencies

This property applies only when you set the ResetInputPort property to true.

Specify how the standard deviation calculation is performed over the data.

Dependencies

This property applies only when you set the RunningStandardDeviation property to false.

Specify the dimension (one-based value) of the input signal, over which the object computes the standard deviation. The custom dimension cannot exceed the number of dimensions for the input signal.

Dependencies

This property applies when you set the Dimension property to Custom.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Usage

Description

y = std(x) computes the standard deviation, y, of input x. The object computes the standard deviation over successive calls to the algorithm when the RunningStandardDeviation property is true.

y = std(x,r) resets its state based on the value of reset signal r and the ResetCondition property. You can use this option only when the RunningStandardDeviation property is true.

Input Arguments

expand all

Data input, specified as a vector or a matrix. If x is a matrix, each column is treated as an independent channel. The standard deviation is computed along each channel. The object also accepts variable-size inputs. Once the object is locked, you can change the size of each input channel.

Data Types: single | double
Complex Number Support: Yes

Reset signal used to reset the running standard deviation, specified as a scalar value. The object resets the running standard deviation if the reset signal satisfies the ResetCondition.

Dependencies

To enable this signal, set the RunningStandardDeviation property to true and the ResetInputPort property to true.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | logical

Output Arguments

expand all

Standard deviation output, returned as a scalar, vector or a matrix. If RunningStandardDeviation is set to:

  • false –– The object computes the standard deviation value of each input channel. If the input is a column vector, the output is a scalar. If the input is a multichannel signal, the output signal is a 1-by-N vector, where N is the number of input channels.

  • true –– The object computes the running standard deviation of the signal. The size of the output signal matches the size of the input signal.

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

Running Standard Deviation

Note: If you are using R2016a or an earlier release, replace each call to the object with the equivalent step syntax. For example, obj(x) becomes step(obj,x).

Compute the running standard deviation of a signal using dsp.StandardDeviation object. To activate this mode, set the RunningStandardDeviation property to true.

 std2 = dsp.StandardDeviation;
 std2.RunningStandardDeviation = true;
 x = randn(100,1);
 y = std2(x);

y(i) is the standard deviation of the ith input sample with respect to all the past input samples.

Algorithms

This object implements the algorithm, inputs, and outputs described on the Standard Deviation block reference page. The object properties correspond to the block parameters, except the Reset port block parameter corresponds to the ResetInputPort and ResetCondition object properties.

Compatibility Considerations

expand all

Warns starting in R2019b

Extended Capabilities

Introduced in R2012a