Public Member Functions | Protected Attributes
alvar::FilterDoubleExponentialSmoothing Class Reference

FilterDoubleExponentialSmoothing provides an weighted running average filter More...

#include <Filter.h>

Inheritance diagram for alvar::FilterDoubleExponentialSmoothing:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FilterDoubleExponentialSmoothing (double _alpha=0.5, double _gamma=1.0)
double getGamma ()
virtual double next (double y)
 Update the value. All inherited classes need to update value in next().
double operator= (double _value)
void setGamma (double _gamma)

Protected Attributes

double gamma
double slope

Detailed Description

FilterDoubleExponentialSmoothing provides an weighted running average filter

The FilterDoubleExponentialSmoothing calculates a simple running average for both the average and slope using the weight values alpha and gamma.

                value = ((1.0-alpha) * (value + slope)) + (alpha * (double)y);
                slope = ((1.0-gamma) * (slope)) + (gamma * (value - value_prev));

If the weight values (alpha , gamma) are larger (near 1.0) the formulas react faster for changes and if they are near 0.0 then the reaction is slower. The weight values alpha and gamma may be set in the constructor or with setAlpha() and setGamma() .

Examples:
SampleFilter.cpp.

Definition at line 187 of file Filter.h.


Constructor & Destructor Documentation

alvar::FilterDoubleExponentialSmoothing::FilterDoubleExponentialSmoothing ( double  _alpha = 0.5,
double  _gamma = 1.0 
) [inline]

Definition at line 192 of file Filter.h.


Member Function Documentation

Definition at line 196 of file Filter.h.

double alvar::FilterDoubleExponentialSmoothing::next ( double  y) [virtual]

Update the value. All inherited classes need to update value in next().

Reimplemented from alvar::FilterRunningAverage.

Definition at line 99 of file Filter.cpp.

double alvar::FilterDoubleExponentialSmoothing::operator= ( double  _value) [inline]

Reimplemented from alvar::FilterRunningAverage.

Definition at line 197 of file Filter.h.

void alvar::FilterDoubleExponentialSmoothing::setGamma ( double  _gamma) [inline]

Definition at line 195 of file Filter.h.


Member Data Documentation

Definition at line 189 of file Filter.h.

Definition at line 190 of file Filter.h.


The documentation for this class was generated from the following files:


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Thu Jun 6 2019 21:12:55