← Back to overview

Kalman filter tuning

Traffic scenario

Live Kalman state

True speed—
Last measurement—
Estimate (speed)—
Estimate std (±1σ)—
Estimated trend—
Variance P₀₀—
Kalman gain K (speed)—
Time since measurement—

Accuracy so far

RMSE — Kalman estimate—
RMSE — raw sensor—
Estimate improvement—
State x = [speed, trend]. Every tick runs the real predict step x⁻=Fx, P⁻=FPFᵀ+Q. Each sensor reading runs the real update step: K=P⁻Hᵀ(HP⁻Hᵀ+R)⁻¹, x=x⁻+K(z−Hx⁻), P=(I−KH)P⁻(I−KH)ᵀ+KRKᵀ (Joseph form). Watch P₀₀ shrink on every update and grow during the predict-only gaps, especially during a sensor dropout.