okapi::DemaFilter class

Base classes

class Filter

Constructors, destructors, conversion operators

DemaFilter(double ialpha, double ibeta)
Double exponential moving average filter.

Public functions

auto filter(double ireading) -> double override
Filters a value, like a sensor reading.
auto getOutput() const -> double override
Returns the previous output from filter.
void setGains(double ialpha, double ibeta) virtual
Set filter gains.

Protected variables

double alpha
double beta
double outputS
double lastOutputS
double outputB
double lastOutputB

Function documentation

okapi::DemaFilter::DemaFilter(double ialpha, double ibeta)

Double exponential moving average filter.

Parameters
ialpha alpha gain
ibeta beta gain

double okapi::DemaFilter::filter(double ireading) override

Filters a value, like a sensor reading.

Returns filtered result

double okapi::DemaFilter::getOutput() const override

Returns the previous output from filter.

Returns the previous output from filter

void okapi::DemaFilter::setGains(double ialpha, double ibeta) virtual

Set filter gains.

Parameters
ialpha alpha gain
ibeta beta gain