Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

dsp.StandardDeviation System object

Package: dsp

Standard deviation of input or sequence of inputs

Description

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

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

  1. Define and set up your standard deviation object. See Construction.

  2. Call step to compute the standard deviation according to the properties of dsp.StandardDeviation. The behavior of step is specific to each object in the toolbox.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

    Note:   The Running mode in the dsp.StandardDeviation System object will be removed in a future release. To compute the running standard deviation in MATLAB®, use the dsp.MovingStandardDeviation System object instead.

Construction

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

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

Properties

RunningStandardDeviation

Enable calculation over successive calls to the step method

Set this property to true to enable the calculation of standard deviation over successive calls to the step method. The default is false.

ResetInputPort

Enable resetting in running standard deviation mode

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 step method to reset the running standard deviation. This property applies only when you set the RunningStandardDeviation property to true. The default is false.

ResetCondition

Reset condition for running standard deviation mode

Specify event to reset the running standard deviation as one of | Rising edge | Falling edge | Either edge | Non-zero |. This property applies only when you set the ResetInputPort property to true. The default is Non-zero.

Dimension

Dimension to operate along

Specify how the standard deviation calculation is performed over the data as one of | All | Row | Column | Custom |. This property applies only when you set the RunningStandardDeviation property to false. The default is Column.

CustomDimension

Numerical dimension to operate along

Specify the dimension (one-based value) of the input signal, over which the object computes the standard deviation. The cannot exceed the number of dimensions for the input signal. This property applies when you set the Dimension property to Custom. The default is 1.

Methods

resetReset states for running standard deviation computation
stepCalculate standard deviation of input
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,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.

Extended Capabilities

Introduced in R2012a

Was this topic helpful?