dsp.StandardDeviation System object

Package: dsp

Standard deviation of input or sequence of inputs

Description

The 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.

Construction

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

H = dsp.StandardDeviation('PropertyName',PropertyValue,...) returns a standard deviation System object, H, 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.

ROIProcessing

ROIProcessing

Enable region of interest processing

Set this property to true to enable calculating the standard deviation within a particular region for each image. This property applies only when you set the RunningStandardDeviation property to false and the Dimension property is All. The default is false.

Full ROI processing support requires a Computer Vision System Toolbox™ license. With only the DSP System Toolbox™ license, Rectangles is the only selection that applies for the ROIForm property.

ROIForm

Type of region of interest

Specify the type of region of interest as one of | Rectangles | Lines | Label matrix | Binary mask |. This property applies only when you set the ROIProcessing property to true. The default is Rectangles.

Full ROI processing support requires a Computer Vision System Toolbox license. With only the DSP System Toolbox license, Rectangles is the only selection that applies for the ROIForm property.

ROIPortion

Calculate over entire ROI or just perimeter

Specify the region over which to calculate the standard deviation as one of | Entire ROI | ROI perimeter |. This property applies if the ROIForm property is Rectangles. The default is Entire ROI.

ROIStatistics

Statistics for each ROI, or one for all ROIs

Specify what statistics to calculate as one of | Individual statistics for each ROI | Single statistic for all ROIs |. This property applies when you set the ROIForm property to Rectangles, Lines, or Label matrix. The default is Individual statistics for each ROI.

ValidityOutputPort

Enable output of validity check of ROI or label numbers

Indicate whether to return the validity of the specified ROI being completely inside image when the ROIForm property is Lines, Rectangles or Binary mask. Indicate whether to return the validity of the specified label numbers when the ROIForm property is Label Matrix. This property applies when you set the ROIForm property to anything except Binary Mask. The default is false.

FrameBasedProcessing

Enable frame-based processing

Set this property to true to enable frame-based processing. Set this property to false to enable sample-based processing. This property applies only when you set the RunningStandardDeviation property to true. The default is true.

Methods

cloneCreate standard deviation object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset states for running standard deviation computation
stepCalculate standard deviation of input

Examples

Compute running standard deviation of a signal:

 hstd2 = dsp.StandardDeviation;
 hstd2.RunningStandardDeviation = true;
 x = randn(100,1);
 y = step(hstd2,x); 
 % y(i) is the standard deviation of all values 
 % in the vector x(1:i)

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.

  • Treat sample-based row input as a column block parameter is not supported by the dsp.StandardDeviation object.

Both this object and its corresponding block let you specify whether to process inputs as individual samples or as frames of data. The object uses the FrameBasedProcessing property. The block uses the Input processing parameter. See Set the FrameBasedProcessing Property of a System object for more information.

Was this topic helpful?