template<std::size_t n>
MedianFilter class
A filter which returns the median value of list of values.
Template parameters | |
---|---|
n | number of taps in the filter |
Contents
Base classes
- class Filter
Constructors, destructors, conversion operators
Public functions
Protected functions
- auto kth_smallset() -> double
- Algorithm from N.
Protected variables
- std::array<double, n> data
- std::size_t index
- double output
- const size_t middleIndex
Function documentation
template<std::size_t n>
double okapi:: MedianFilter<n>:: filter(const double ireading) override
Filters a value, like a sensor reading.
Parameters | |
---|---|
ireading | new measurement |
Returns | filtered result |
template<std::size_t n>
double okapi:: MedianFilter<n>:: getOutput() const override
Returns the previous output from filter.
Returns | the previous output from filter |
---|
template<std::size_t n>
double okapi:: MedianFilter<n>:: kth_smallset() protected
Algorithm from N.
Wirth’s book, implementation by N. Devillard.