Kalman filter · estimation

Finding the signal by trusting less.

A sensor gives you a noisy dot every tick — the true position is somewhere in the cloud, never exactly where you measured. A Kalman filter fuses two beliefs at each step: where its motion model predicted the object would be, and where the new measurement says it is. It weighs them by how much it trusts each, and the result tracks the truth far better than the raw measurements ever could.

State

tick0
phase
uncertainty √tr Ppos
estimate error
raw meas. error

Controls

Legend

true path — the hidden ground truth
measurements — noisy sensor dots
estimate — the filtered track
covariance — 2σ uncertainty ellipse

Each tick runs two steps. Predict: push the estimate forward with a constant-velocity model, x ← Fx, and let the uncertainty grow, P ← FPFᵀ + Q — with no new data the ellipse swells. Update: a measurement z arrives; the filter forms the Kalman gain K, which is large when the estimate is shakier than the sensor and small when it's more confident, then nudges the estimate toward the measurement by K and shrinks the ellipse. Turn measurement noise up and the filter leans on its model, smoothing hard but lagging; turn it down and it snaps to every dot. That single trade-off — model versus measurement — is the whole idea, and it's what fuses GPS with an accelerometer in your phone, tracks aircraft on radar, and keeps a robot localized as it drives.