Extended kalman filter basics

The Extended Kalman Filter, or EKF, is a state estimation algorithm used when the system or the sensor model is nonlinear. It is a natural extension of the standard Kalman Filter, which assumes linear dynamics and linear measurements.

Why do we need EKF?

In robotics and autonomous driving, many important relationships are nonlinear. For example, a radar sensor may measure range, angle, and radial velocity instead of simple Cartesian coordinates. A robot may also rotate while moving, which creates nonlinear motion equations.

Main idea

EKF still follows the same two-step structure as the standard Kalman Filter:

  • Prediction: estimate the next state based on the motion model
  • Update: correct the estimate using the sensor measurement

The difference is that EKF linearizes the nonlinear functions around the current estimate by using Jacobian matrices.

Where EKF is used

  • Robot localization
  • Sensor fusion with radar, lidar, and IMU
  • Mobile robot tracking
  • Autonomous vehicle state estimation

A simplified workflow

1. Predict x(k|k-1) using the motion model
2. Predict covariance P(k|k-1)
3. Compute Jacobian matrices
4. Compare expected measurement with real measurement
5. Update the state and covariance

Strengths and limitations

EKF works well when the system is only mildly nonlinear and the estimate remains close to reality. However, if the model is strongly nonlinear or the initial estimate is poor, EKF may diverge.

Final thoughts

EKF remains one of the most important filters in robotics and autonomous systems because it provides a practical compromise between mathematical tractability and real-world usefulness.

Kalman filter basics

The Kalman filter is one of the most useful estimation tools in engineering. It helps us estimate the true state of a system when measurements are noisy and the underlying process cannot be observed perfectly. If you work with robotics, tracking, control, navigation, or sensor fusion, sooner or later you will meet the Kalman filter.

The Core Problem

Real systems are noisy. GPS readings jump, IMU signals drift, wheel odometry accumulates error, and camera measurements are imperfect. Yet decision-making systems still need a reliable estimate of position, speed, heading, or some other internal state.

The Kalman filter solves this by combining two ideas:

  • Prediction: estimate what the state should be based on the previous state and a system model.
  • Correction: update that estimate using a new measurement.

The Intuition

If your model is good but the measurement is noisy, trust the model more. If the model is uncertain but the sensor is accurate, trust the measurement more. The Kalman filter computes this balance mathematically through the covariance terms.

A Simple Example

Imagine tracking the 1D position of a vehicle. At each time step, you predict where it should be using its previous velocity. Then a GPS reading arrives. The filter blends the prediction and the measurement to produce a better estimate than either source alone.

Main Steps

  1. Predict the next state.
  2. Predict the new uncertainty.
  3. Receive a measurement.
  4. Compute the Kalman gain.
  5. Correct the state estimate.
  6. Update the uncertainty.

Where It Is Used

  • robot localization,
  • tracking moving objects,
  • sensor fusion between GPS, IMU, and odometry,
  • financial time-series smoothing,
  • control systems and navigation.

Limitations

The standard Kalman filter assumes a linear system and Gaussian noise. Real systems are often nonlinear, which is why engineers also use the Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF).

Final Thoughts

The Kalman filter matters because it gives engineers a structured way to reason under uncertainty. Once you understand the prediction-correction cycle, many estimation problems become easier to think about and implement.