Sylib
A C++ Library For V5
|
Exponential Moving Average Filter. More...
#include <math.hpp>
Public Member Functions | |
EMAFilter () | |
Creates an Exponential Moving Average filter. More... | |
double | filter (double rawValue, double kA) |
Filters an input value. More... | |
double | getkA () const |
Gets the most recently used kA value. More... | |
double | getCurrentEMA () const |
Gets the current filter output. More... | |
Exponential Moving Average Filter.
sylib::EMAFilter::EMAFilter | ( | ) |
Creates an Exponential Moving Average filter.
double sylib::EMAFilter::filter | ( | double | rawValue, |
double | kA | ||
) |
Filters an input value.
rawValue | The raw input value to filter |
kA | How much the filter will condider previous information. A value of 1 will make the input the full value of the output, a value of 0 will make the input have no effect on the output. |
double sylib::EMAFilter::getCurrentEMA | ( | ) | const |
Gets the current filter output.
double sylib::EMAFilter::getkA | ( | ) | const |
Gets the most recently used kA value.