You are here: Symbol Reference > Dew Namespace > Dew.Signal Namespace > Dew.Signal.Units Namespace > Classes > SignalUtils Class > SignalUtils Methods > ExpAverageFilter Method > SignalUtils.ExpAverageFilter Method (TVec, double, double)
Dew Signal for .NET
ContentsIndexHome
PreviousUpNext
SignalUtils.ExpAverageFilter Method (TVec, double, double)

Filter data with an exponential average filter.

Syntax
C#
Visual Basic
public static void ExpAverageFilter(TVec Data, ref double State, double Decay);

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-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!