M5Unit-HEART 0.2.1 git rev:e0975a4
Loading...
Searching...
No Matches
m5::heart::EMA Class Reference

Exponential Moving Average. More...

#include <pulse_monitor.hpp>

Public Member Functions

 EMA (float factor)
 Constructor.
 
void clear ()
 Clear the stored value.
 
float update (float new_value)
 Update with a new value and return the smoothed result.
 

Detailed Description

Exponential Moving Average.

Constructor & Destructor Documentation

◆ EMA()

m5::heart::EMA::EMA ( float factor)
inlineexplicit

Constructor.

Parameters
factorSmoothing factor (0.0 - 1.0)

Member Function Documentation

◆ update()

float m5::heart::EMA::update ( float new_value)
inline

Update with a new value and return the smoothed result.

Parameters
new_valueNew input value
Returns
Smoothed value