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