Documentation

This is machine translation

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

dsp.Mean System object

Package: dsp

Find mean value of input or sequence of inputs

Description

The Mean object finds the mean of an input or sequence of inputs.

To compute the mean of an input or sequence of inputs:

  1. Define and set up your System object™. See Construction.

  2. Call step to compute the mean according to the properties of dsp.Mean. 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.

Construction

H = dsp.Mean returns an object, H, that computes the mean of an input or a sequence of inputs.

H = dsp.Mean('PropertyName',PropertyValue,...) returns a mean-finding object, H, with each specified property set to the specified value.

Properties

RunningMean

Calculate over single input or multiple inputs

When you set this property to true, the object calculates the mean over successive calls to the step method. When you set this property to false, the object computes the mean over the current input. The default is false.

ResetInputPort

Additional input to enable resetting of running mean

Set this property to true to enable resetting of the running mean. When you set this property to true, you must specify a reset input to the step method to reset the running mean. This property applies only when you set the RunningMean property to true. The default is false.

ResetCondition

Condition that triggers resetting of running mean

Specify the event that resets the running maximum 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 mean calculation is performed over the data as one of | All | Row | Column | Custom |. This property applies when you set the RunningMean property to false. The default is Column.

CustomDimension

Numerical dimension to calculate over

Specify the integer dimension, indexed from one, of the input signal over which the object calculates the mean. The value cannot exceed the number of dimensions in the input signal. This property only applies when you set the Dimension property to Custom. The default is 1.

 Fixed-Point Properties

Methods

cloneCreate mean 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 internal states of mean-finding object
stepMean value

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

Mean

hmean1 = dsp.Mean;
x = randn(100,1);
y = hmean1(x);

Running Mean

hmean2 = dsp.Mean;
hmean2.RunningMean = true;
x = randn(100,1);
yrmean = hmean2(x);

Algorithms

This object implements the algorithm, inputs, and outputs described on the Mean block reference page. The object properties correspond to the block parameters.

Introduced in R2012a

Was this topic helpful?