Class TwoSpeedExponentialAverager

java.lang.Object
likelihoodDetectionModule.normalizer.TwoSpeedExponentialAverager

public class TwoSpeedExponentialAverager extends Object
This class is almost identical to the simple exponential (decaying) average. For each input sample, the output is: y[i] = x[i]*(1-alpha) + x[i-1]*alpha; However, there are two values for alpha, a highAlpha and a lowAlpha. Which one gets used in the above formula is based upon the following logic: if referenceInput[ i ] invalid input: '<' output[ i - 1 ], then lowAlpha is used if referenceInput[ i ] > output[ i - 1 ], then highAlpha is used Again, just like the simple ExponentialAverager this requires knowledge of the previous sample which makes a problem for the very first data point. To get around this, we initialize the x[-1] point to the same value as the x[0] point. After this, we simply keep a copy of the last sample.
Author:
Dave Flogeras
  • Method Details

    • Process

      public double[] Process(double[] data, double[] referenceInput)