An interactive, single-page visualization of Bayesian filtering for 1-D terrain-aided navigation. An aircraft flies left to right at a constant altitude (5000 ft) over hilly terrain. A downward-looking radar altimeter measures altitude-above-ground (AGL) with Gaussian noise.
Because the filter knows the terrain map, each noisy reading constrains where the aircraft can be. The demo estimates the aircraft's horizontal position with two filters you can switch between:
- Histogram filter — discretizes position into bins; belief is a probability mass per bin.
- Particle filter — represents belief with weighted particles (sequential importance resampling).
A flat lake at sea level in the middle of the terrain is the key teaching moment: altimeter readings there are ambiguous, so — with some process (speed) noise — the belief visibly spreads out, then re-localizes once the aircraft reaches distinctive terrain again.
Just open index.html:
Model parameters
- Filter — Histogram or Particle.
- Bins / Particles — resolution of the belief (4–400).
- Sensor noise σ — radar altimeter noise (ft).
- Speed noise σ — process noise on the aircraft's speed (kt).
Animation
- ◀ / ▶ — step backward / forward in time (exact, frame-by-frame).
- Play / Pause, Reset.
- Animation speed — playback rate.
- Time — scrub to any timestep.
Keyboard: Space play/pause, ← / → step, R reset. A light/dark toggle is
at the bottom of the page.
The status readout shows time, true ground speed, true vs. measured AGL, and the true vs. estimated position with the estimate error and belief spread. On the chart, the green bar marks the filter's mean estimate, the violet beam is the altimeter measurement, and the bottom panel shows the terrain, lake, and aircraft.
Inspired by this video. To learn more about Bayesian filtering and decision making, see Algorithms for Decision Making.
MIT.