Sylib
A C++ Library For V5
Loading...
Searching...
No Matches
sylib::EMAFilter Class Reference

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...
 

Detailed Description

Exponential Moving Average Filter.

Constructor & Destructor Documentation

◆ EMAFilter()

sylib::EMAFilter::EMAFilter ( )

Creates an Exponential Moving Average filter.

Member Function Documentation

◆ filter()

double sylib::EMAFilter::filter ( double  rawValue,
double  kA 
)

Filters an input value.

Parameters
rawValueThe raw input value to filter
kAHow 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.
Returns
Filter output

◆ getCurrentEMA()

double sylib::EMAFilter::getCurrentEMA ( ) const

Gets the current filter output.

Returns
Filter output

◆ getkA()

double sylib::EMAFilter::getkA ( ) const

Gets the most recently used kA value.

Returns
kA value