average~ Reference

Multi-mode signal average

average~

Description

Use the average~ to perform bipolar, absolute, or rms averaging on any input signal.

Examples

Running average of a signal across n samples

Arguments

max-averaging-interval [int]

Optional
Unitssamples

Sets the maximum averaging interval in samples. The default value is 100.

averaging-mode [symbol]

Optional

Sets the averaging mode, as defined in the "Messages" section. The default is bipolar.

Attributes

mode [symbol]8.0.0

Sets the averaging mode for the input signal.

Possible values:

'bipolar' ( Average input )
Sets bipolar averaging mode (default). In bipolar mode, the sample values are averaged.

'absolute' ( Average the absolute value of input )
Sets absolute averaging mode. This mode averages the absolute value of the incoming samples.

'rms' ( Root mean square input )
Sets root mean square (RMS) averaging mode. This mode computes the square root of the average of the sample values squared.

The RMS mode of the average~ object is more CPU-intensive than the bipolar and absolute modes. While RMS values are often used to measure signal levels, the absolute mode often works as well as the RMS mode in many level-detection tasks.

Common Box Attributes

Messages

int

Arguments

averaging-sample-interval [int]
Sets the interval in samples used for each of the three modes of signal averaging. The default value is 100.

absolute

Sets absolute averaging mode. This mode averages the absolute value of the incoming samples.

bipolar

Sets bipolar averaging mode (default). In bipolar mode, the sample values are averaged.

rms

Sets root mean square (RMS) averaging mode. This mode computes the square root of the average of the sample values squared.

The RMS mode of the average~ object is more CPU-intensive than the bipolar and absolute modes.While RMS values are often used to measure signal levels, the absolute mode often works as well as the RMS mode in many level-detection tasks.

signal

The signal to be averaged.

Output

signal

The running average value of the input signal averaged over the specified number of samples.

See Also

Name Description
avg~
meter~
MSP Compression Introduction: What is Compression? MSP Compression Introduction: What is Compression?