Particle Filter Tracking

Tracks a moving object from noisy range-only readings taken by several fixed sensors using a particle filter, showing how the weighted particle cloud follows the target, or loses it.
Author

Dhruv Azad

Published

October 2, 2026

Three sensors at fixed positions each report only how far away a moving object is, not in which direction, and every reading is noisy. Below, the object’s true position traces a figure eight, and a particle filter tries to follow it using nothing but those readings. It keeps a cloud of guesses, the particles, weights each one by how well it explains the latest readings (bigger dots carry more weight), and takes their weighted average as its estimate.

Why do you think the particles are falling behind? Press play on the step slider to watch it happen.

NoteConvergence plots

A particle filter represents its belief about the object’s position as a cloud of weighted particles \(x_i^{(p)}\), and repeats the same steps for every new set of readings:

Start

\(N\) particles around the starting position, each with weight \(1/N\)

Predict

\(x_i^{(p)} = x_{i-1}^{(p)} + \varepsilon_i^{(p)}\)

\(\varepsilon_i^{(p)} \sim \mathcal N\bigl(0,\, \sigma_{\text{step}}^2 I\bigr)\)

Measure

\(z_{i,k}\): sensor \(k\)’s noisy distance to the object

Update

\(w_i^{(p)} \propto w_{i-1}^{(p)} \prod_k \mathcal N\bigl(z_{i,k};\, \lVert x_i^{(p)} - s_k \rVert,\, \sigma_{\text{filter}}^2\bigr)\)

weights normalized to sum to \(1\)

Estimate

\(\hat x_i = \sum_p w_i^{(p)} x_i^{(p)}\)

Resample

if \(\mathrm{ESS}_i = 1 \big/ \sum_p \bigl(w_i^{(p)}\bigr)^2 < \tau N\), draw \(N\) particles \(\propto w_i^{(p)}\), each with weight \(1/N\)

back to Predict

Here \(s_k\) is sensor \(k\)’s location. The four filter settings in the controls above the chart are \(\sigma_{\text{step}}\) (“Filter’s assumed process σ”), \(\sigma_{\text{filter}}\) (“Filter’s assumed sensor σ”), \(\tau\) (“Resample if ESS/N <”) and \(N\) (“Particles N”). \(\mathrm{ESS}_i\) is how many particles the weighted cloud is effectively worth.

Example 1: Why the particles fall behind. The predict step is a random walk: the particles don’t know which way the object is heading. The object moves between \(0.6\) and \(1.2\) along the figure eight each step, but with \(\sigma_{\text{step}} = 0.15\) the particles spread only about \(0.15\), so they can’t keep up. Raise “Filter’s assumed process σ” to about \(1\) and the cloud keeps pace. It is the same trade-off as the Kalman filter’s \(Q\) in 1D recursive filters.

References

Gordon, N. J., Salmond, D. J., and Smith, A. F. M. (1993). “Novel approach to nonlinear/non-Gaussian Bayesian state estimation.” IEE Proceedings F (Radar and Signal Processing), 140(2), 107–113. doi:10.1049/ip-f-2.1993.0015.