lipm_walking_controller
1.6.0
|
Exponential Moving Average. More...
#include <lipm_walking/utils/ExponentialMovingAverage.h>
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | ExponentialMovingAverage (double dt, double timeConstant, const Eigen::Vector3d &initValue=Eigen::Vector3d::Zero()) |
Constructor. More... | |
void | append (const Eigen::Vector3d &value) |
Append a new reading to the series. More... | |
const Eigen::Vector3d & | eval () const |
Evaluate the smoothed statistic. More... | |
const Eigen::Vector3d & | raw () const |
Last raw value provided to the integrator. More... | |
void | reset () |
Reset average to zero. More... | |
void | saturation (double limit) |
Set output saturation; disable by providing a negative value. More... | |
void | setZero () |
Reset average to zero. More... | |
double | timeConstant () const |
Get time constant of the filter. More... | |
void | timeConstant (double T) |
Update time constant. More... | |
Protected Attributes | |
Eigen::Vector3d | average_ = Eigen::Vector3d::Zero() |
Eigen::Vector3d | rawValue_ = Eigen::Vector3d::Zero() |
double | alpha_ |
double | dt_ |
double | saturation_ = -1. |
double | timeConstant_ |
Exponential Moving Average.
This filter can be seen as an integrator:
\[ y(t) = \frac{1}{T} \int_{\tau=0}^t x(\tau) e^{(\tau - t) / T} {\rm d}{\tau} \]
with \(T > 0\) a reset period acting as anti-windup. It can also (informally) be interpreted as the average value of the input signal \(x(t)\) over the last \(T\) seconds. Formally, it represents the amount of time for the smoothed response of a unit input to reach \(1-1/e \ (\approx 63\%)\) of the original signal.
See https://en.wikipedia.org/wiki/Exponential_smoothing. It is equivalent to a low-pass filter applied to the integral of the input signal.
Definition at line 56 of file ExponentialMovingAverage.h.
|
inline |
Constructor.
dt | Time in [s] between two readings. |
timeConstant | Informally, length of the recent-past window, in [s]. |
initValue | Initial value of the output average. |
Definition at line 69 of file ExponentialMovingAverage.h.
|
inline |
Append a new reading to the series.
value | New value. |
Definition at line 82 of file ExponentialMovingAverage.h.
|
inline |
Evaluate the smoothed statistic.
Definition at line 95 of file ExponentialMovingAverage.h.
|
inline |
Last raw value provided to the integrator.
Definition at line 103 of file ExponentialMovingAverage.h.
|
inline |
Reset average to zero.
Definition at line 111 of file ExponentialMovingAverage.h.
|
inline |
Set output saturation; disable by providing a negative value.
limit | Output will saturate between -limit and +limit. |
Definition at line 121 of file ExponentialMovingAverage.h.
|
inline |
Reset average to zero.
Definition at line 129 of file ExponentialMovingAverage.h.
|
inline |
Get time constant of the filter.
Definition at line 137 of file ExponentialMovingAverage.h.
|
inline |
Update time constant.
T | New time constant of the filter. |
Definition at line 147 of file ExponentialMovingAverage.h.
|
protected |
Definition at line 176 of file ExponentialMovingAverage.h.
|
protected |
Definition at line 174 of file ExponentialMovingAverage.h.
|
protected |
Definition at line 177 of file ExponentialMovingAverage.h.
|
protected |
Definition at line 175 of file ExponentialMovingAverage.h.
|
protected |
Definition at line 178 of file ExponentialMovingAverage.h.
|
protected |
Definition at line 179 of file ExponentialMovingAverage.h.