This version (25 Jun 2012 19:32) was approved by William Jahn.

Running Average

Click here to return to the Dynamics Processors page

The signal envelope block allows a running average to be computed on an input signal. This is not true RMS since the absolute value of the input signal drives the averaging, not the square of the input. Time constants are used to define the averaging time for computation.

Input Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Input Audiodecimal - audioInput Signal to compute envelope

Output Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Envelope OutputdecimalEnvelope Signal Output

GUI Controls

GUI Control NameDefault ValueRangeFunction Description
RMS TC dB/s1201- 10000Controls the main averaging time used to drive the envelope calculation
Hold (ms)00 - 2000Controls the amount of time the envelope signal is held before releasing
Decay dB/s101- RMS TCControls how quickly the envelope will track the signal during a decay. The max value of this control is determined by the RMS TC value.

DSP Parameter Information

GUI Control NameCompiler NameFunction Description
RMS TC dB/sMonoRunAvgDetectAlg1RMSWhen the RMS time is changed in the GUI a new value is written to the DSP to control the averaging time in the calculation: 1 - RMSTC / (10 * Fs)
Hold (ms)MonoRunAvgDetectAlg1HoldWhen the Hold time is changed in the GUI, a new value is written to the DSP to control the hold time in the calculation: Fs * Hold / 1000
Decay (dB/s)MonoRunAvgDetectAlg1DecayWhen the Decay time is changed in the GUI, a new value is written to the DSP to control the decay time in the calculation: Decay / (96 * Fs)

Algorithm Description

The running average block takes the envelope of the input signal based on a running average. The absolute value of the input signal is taken and then filtered to get an averaged level. The RMS TC, hold, and decay time constants affect how the averaging is computed. RMS TC mainly affects the attack rise of the signal and decay affects the release of the signal. The hold time holds the previous envelope value for the amount of time before reacting to a new input signal level change.


The following example uses the Running Average block to drive a GPIO LED. Depending on the level of the input signal, in a given application, you may want to conditionally turn something on or off. In this example, the output of the running average envelope is sent to a Tolerance block to check the limits of the input signal. If the signal is within the defined range, a “1” is sent to the GPIO output, otherwise a “0” is sent.

Algorithm Details

Toolbox PathDynamics Processors - Envelope - Running Average - Signal Envelope
Cores SupportedAD1940
“Grow Algorithm” Supportedno
“Add Algorithm” Supportedno
Subroutine/Loop Basedno
Program RAM24
Data RAM11
Parameter RAM3
resources/tools-software/sigmastudio/toolbox/dynamicsprocessors/runningaverage.txt · Last modified: 25 Jun 2012 19:32 by William Jahn