OpenWareLaboratory
|
Exponential Moving Average EMA. More...
Public Member Functions | |
ExponentialMovingAverage (float lambda=0.995, float y=0) | |
float | getAverage () |
float | getLambda () |
float | getNextAverage (float x) |
RMS detection with smoothing coefficient (Moving RMS) as per: R. More... | |
float | process (float in) |
virtual float | process (float input) |
void | process (FloatArray input) |
virtual void | process (FloatArray input, FloatArray output) |
virtual void | process (FloatArray input, FloatArray output) |
void | set (float value) |
void | setCutoff (float fc) |
Set lambda (time coefficient) as the -3dB cutoff frequency, in radians. More... | |
void | setLambda (float value) |
Set the exponential decay time coefficient. More... | |
void | setModifiedMovingAverage (size_t N) |
Set lambda (time coefficient) as 1/N. More... | |
void | setSmoothing (size_t observations, float smoothing=2) |
Set lambda (time coefficient) as amount of smoothing over number of observations. More... | |
Static Public Member Functions | |
static ExponentialMovingAverage * | create (float lambda) |
static void | destroy (ExponentialMovingAverage *obj) |
Exponential Moving Average EMA.
Definition at line 9 of file MovingAverage.h.
|
inline |
Definition at line 14 of file MovingAverage.h.
Referenced by create().
|
inlinestatic |
Definition at line 75 of file MovingAverage.h.
References ExponentialMovingAverage().
|
inlinestatic |
Definition at line 78 of file MovingAverage.h.
|
inline |
Definition at line 63 of file MovingAverage.h.
|
inline |
Definition at line 26 of file MovingAverage.h.
|
inline |
RMS detection with smoothing coefficient (Moving RMS) as per: R.
J. Cassidy, “Level Detection Tunings and Techniques for the Dynamic Range Compression of Audio Signals,” presented at the 117th Convention of the Audio Engineering Society (2004 Oct.), convention paper 6235. Referenced in https://www.eecs.qmul.ac.uk/~josh/documents/2012/GiannoulisMassbergReiss-dynamicrangecompression-JAES2012.pdf
Definition at line 59 of file MovingAverage.h.
Referenced by process().
|
inlinevirtual |
Reimplemented from SignalProcessor.
Definition at line 67 of file MovingAverage.h.
References getNextAverage().
|
inline |
Definition at line 13 of file SignalProcessor.h.
|
inline |
Definition at line 70 of file MovingAverage.h.
References getNextAverage(), and SimpleArray< T >::getSize().
|
inline |
Definition at line 16 of file SignalProcessor.h.
|
inlinevirtualinherited |
Reimplemented in FirFilter, Window, VoiceAllocatorSignalProcessor< Allocator, SynthVoice, VOICES >, StateVariableFilter, DownSampler, UpSampler, Envelope, CrossFadingDelayProcessor, FastFractionalDelayProcessor, FractionalDelayProcessor< im >, DelayProcessor, SmoothingFilter, EnvelopeFollower, DcBlockingFilter, and BiquadFilter.
Definition at line 16 of file SignalProcessor.h.
References SimpleArray< T >::getSize(), and SignalProcessor::process().
|
inline |
Definition at line 15 of file MovingAverage.h.
|
inline |
Set lambda (time coefficient) as the -3dB cutoff frequency, in radians.
(i.e. radians = pi times frequency / sample rate). Ref: https://dsp.stackexchange.com/questions/28308/exponential-weighted-moving-average-time-constant
Definition at line 51 of file MovingAverage.h.
|
inline |
Set the exponential decay time coefficient.
Lambda should be a value between 0 and 1, typically greater than 0.9. Higher values gives more smoothing.
Definition at line 23 of file MovingAverage.h.
|
inline |
Set lambda (time coefficient) as 1/N.
Known as a Modified Moving Average MMA, Smoothed Moving Average SMMA, or Running Moving Average RMA.
Definition at line 43 of file MovingAverage.h.
|
inline |
Set lambda (time coefficient) as amount of smoothing over number of observations.
With smoothing = 2.0 and observations = N, this corresponds roughly to an N-point SMA.
Definition at line 35 of file MovingAverage.h.