modm API documentation
|
#include <modm/math/filter/median.hpp>
Public Member Functions | |
Median (const T &initialValue=0) | |
Constructor. More... | |
void | append (const T &input) |
Append new value. | |
void | udpate () |
calculate median | |
const T | getValue () const |
Get median value. | |
Median filter.
Calculates the median of a input set. Useful for eliminating spikes from the input. Adds a group delay of N/2 ticks for the signal.
Implementation are available for N = 3, 5, 7 and 9. To find the median the signal values will be partly sorted, but only as much as needed to find the median.
T | Input type |
N | Number of samples |
modm::filter::Median< T, N >::Median | ( | const T & | initialValue = 0 | ) |
Constructor.
initialValue | Value will be set for the complete input buffer. |