Sylib
A C++ Library For V5
|
Extrema Filter. More...
#include <math.hpp>
Public Member Functions | |
RangeExtremaFilter (int sampleSize) | |
Creates an Extrema filter that returns the largest absolute value of recent inputs. More... | |
double | filter (double rawValue) |
Filters an input value. More... | |
int | getQueueLength () const |
Gets the current length of the queue of previous values. More... | |
int | getQueueMaxLength () const |
Gets the number of median values to average when the sample size is even. More... | |
double | getCurrentValue () const |
Gets the current filter output without providing a new input value. More... | |
Extrema Filter.
sylib::RangeExtremaFilter::RangeExtremaFilter | ( | int | sampleSize | ) |
Creates an Extrema filter that returns the largest absolute value of recent inputs.
sampleSize | The number of previous values to consider. A higher number will result in a more stable value, but with more lag. |
double sylib::RangeExtremaFilter::filter | ( | double | rawValue | ) |
Filters an input value.
rawValue | The raw input value to filter |
double sylib::RangeExtremaFilter::getCurrentValue | ( | ) | const |
Gets the current filter output without providing a new input value.
int sylib::RangeExtremaFilter::getQueueLength | ( | ) | const |
Gets the current length of the queue of previous values.
int sylib::RangeExtremaFilter::getQueueMaxLength | ( | ) | const |
Gets the number of median values to average when the sample size is even.