OutlierRejection Filter

template<typename T, size_t StdDevs>
struct OutlierRejection

Filter that rejects outliers based on standard deviation.

This stateful filter builds statistics over time and rejects values that fall outside the specified number of standard deviations from the mean.

Since

v0.1.0

// Example: Reject values beyond 2 standard deviations
Signal<float, 10, OutlierRejection<float, 2>> data(0.0);

Note

Stateful filter. Builds statistics over time.

Warning

  • Only accepts floating-point types (float, double).

  • StdDevs must be greater than 0.

Template Parameters:
typename T

Floating-point type.

size_t StdDevs

Number of standard deviations for outlier threshold.

Public Functions

inline bool operator()(const T &old_value, const T &new_value) const

Public Members

mutable T mean = T()
mutable T m2 = T()
mutable size_t count = 0

See Also