OneEuroFilter class

One Euro filter for low-latency smoothing of a noisy 1D signal sampled at an irregular rate.

It adapts its cutoff frequency to the signal's speed: heavy smoothing (low cutoff) when the value changes slowly, and low lag (high cutoff) when it changes quickly. This makes it well suited to smoothing per-frame landmark coordinates without introducing visible lag during fast motion.

Tune with minCutoff (raise to reduce jitter at rest) and beta (raise to reduce lag during fast motion). See https://gery.casiez.net/1euro/.

Constructors

OneEuroFilter({double minCutoff = 1.0, double beta = 0.1, double dCutoff = 1.0})

Properties

beta → double
Speed coefficient; how aggressively the cutoff rises with signal speed.
final
dCutoff → double
Cutoff frequency used to smooth the derivative estimate.
final
hashCode → int
The hash code for this object.
no setterinherited
minCutoff → double
Minimum cutoff frequency; the floor on smoothing when the signal is slow.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

filter(double x, double tSec) → double
Filters sample x taken at time tSec (seconds) and returns the smoothed value. The first sample is returned unchanged.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Clears the filter's history so the next sample is returned unchanged.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited