Sylib
A C++ Library For V5
Loading...
Searching...
No Matches
sylib::MedianFilter Class Reference

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...
 

Detailed Description

Median Filter.

Constructor & Destructor Documentation

◆ MedianFilter()

sylib::MedianFilter::MedianFilter ( int  sampleSize,
int  meanSizeEven,
int  meanSizeOdd 
)

Creates a Median filter.

Parameters
sampleSizeThe number of previous values to consider. A higher number will result in a more stable value, but with more lag.
meanSizeEvenThe number of median values to average when the sample size is even
meanSizeOddThe number of median values to average when the sample size is odd

Member Function Documentation

◆ filter()

double sylib::MedianFilter::filter ( double  rawValue)

Filters an input value.

Parameters
rawValueThe raw input value to filter
Returns
Filter output

◆ getCurrentValue()

double sylib::MedianFilter::getCurrentValue ( ) const

Gets the current filter output without providing a new input value.

Returns
Filter output

◆ getEvenCenterSize()

int sylib::MedianFilter::getEvenCenterSize ( ) const

Gets the number of median values to average when the sample size is even.

Returns
Center size

◆ getOddCenterSize()

int sylib::MedianFilter::getOddCenterSize ( ) const

Gets the number of median values to average when the sample size is odd.

Returns
Center size

◆ getQueueLength()

int sylib::MedianFilter::getQueueLength ( ) const

ets the current length of the queue of previous values

Returns
Queue length

◆ getQueueMaxLength()

int sylib::MedianFilter::getQueueMaxLength ( ) const

Gets the current sum of queue values.

Returns
Sum of values