You are here: Symbol Reference > SignalUtils Namespace > Functions > SignalUtils.ExpAverageFilter Function
DSP Master VCL
ContentsIndex
PreviousUpNext
SignalUtils.ExpAverageFilter Function

Filter data with an exponential average filter.

Pascal
procedure ExpAverageFilter(Data: TVec; var State: double; Decay: double = 50); overload;

Exponential average filter without the TIirState structure. The function can be called to filter sample by sample. Initialize the State to 0 on the first call. Decay defines the decay from sample to sample and is initialized to 50% by default. With each new sample, the filter will take average from the 50% of the new sample and 50% of the previous average. The exponential average filter implements the following difference equation: 

 

y[i] = 1/d * x[i] + (d-1)/d * y[i-1]

x.. input signal
y.. output signal
d.. Decay factor

In terms of percentage:

y[i] = a * x[i] + b * y[i-1] ,   a + b = 1

a*100 ... percent of the new data used.
b*100 ... percent of the old average used to compute the new average.
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!