Smoothing filter
Kalman
Models the movement, not just the numbers
Carries an estimate of where the joint is and how fast it is moving, and weighs each new reading against where the movement was already heading. A backward pass then re-reads every estimate knowing what came afterwards.
- Noise remaining
- 0.84° of 2.34°
- Peak flattening
- 0.00°
- Phase lag
- 0 frames
- Single-frame spike
- 18–33° survives
Measured on our own test signals at 24fps: a clean sine wave, that wave with ±4° of random noise, and that wave with one frame knocked 108° out of place. These describe how the filter behaves — they are not a validation of markerless measurement against marker-based capture.
How it works
Every other filter here treats the signal as a set of numbers to be averaged. This one holds a small model of the movement — a position and a velocity — and at each frame asks how much to believe the measurement against how much to believe the model's own prediction.
That balance is not fixed. When readings agree with the prediction, the filter leans on them; when a reading is wildly out of step with a joint that was moving smoothly, it is largely ignored. The effect is that a run of bad frames is carried through on momentum rather than averaged in.
A Kalman filter on its own lags, because at any frame it has only seen the past. The backward pass fixes that: it walks the clip in reverse and revises each estimate in the light of what happened next, which is what makes it usable for measurement rather than only for live tracking.
Reach for it when
- Tracking drops out for a stretch of frames rather than one — the model carries the movement through the gap.
- You want the most noise removed of anything here, with no cost to the peaks.
- The movement is smooth and continuous, which a constant-velocity model describes well.
What it costs
It has the most assumptions built into it. Where the movement genuinely does change velocity abruptly — an impact, a sudden reversal — a model expecting smoothness will round that corner off. It also has the most parameters, which is a way of saying the most ways to be set wrong.
What we actually run
So the page and the code say the same thing.
- Constant-velocity model: the state is the joint angle and its angular rate, and only the angle is measured.
- Rauch–Tung–Striebel backward smoothing after the forward pass, which is what makes it zero-lag.
- Process noise of 2000, 700 and 200 deg/s² at the three strengths — a smaller number means trusting the model over the data — against an assumed 1.5° of noise on each reading.
- Works without a frame rate, falling back to a nominal step, though it is more faithful with one.
The research behind it
Kalman, R. E. (1960). A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1), 35–45.
The original recursive estimator: combine what the model predicts with what was measured, weighted by how much each is trusted.
doi:10.1115/1.3662552
Rauch, H. E., Tung, F., & Striebel, C. T. (1965). Maximum likelihood estimates of linear dynamic systems. AIAA Journal, 3(8), 1445–1450.
The backward pass we use. A Kalman filter alone lags, because it has only seen the past; this re-reads every estimate knowing what came next.
doi:10.2514/3.3166
De Groote, F., De Laet, T., Jonkers, I., & De Schutter, J. (2008). Kalman smoothing improves the estimation of joint kinematics and kinetics in marker-based human gait analysis. Journal of Biomechanics, 41(16), 3390–3398.
Applies exactly this combination to joint kinematics, and compares it with the low-pass filtering that is the field's default.
doi:10.1016/j.jbiomech.2008.09.035