SignChange Filter

template<typename T>
struct SignChange

Filter that only accepts values when the sign changes (positive/negative).

This filter propagates changes only when the value transitions between positive and negative (or vice versa), detecting zero crossings.

Since

v0.1.0

// Example: Detect zero crossings in a signal
Signal<float, 10, SignChange<float>> waveform(0.0);

Warning

Only accepts arithmetic types (integral and floating-point).

Template Parameters:
typename T

Arithmetic type.

Public Functions

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

See Also