Inferensys

Glossary

Extended Kalman Filter (EKF)

The Extended Kalman Filter (EKF) is a nonlinear state estimation algorithm that linearizes system and measurement models around the current state to handle real-world, non-Gaussian sensor fusion problems in robotics and autonomous systems.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
REAL-TIME ROBOTIC PERCEPTION

What is Extended Kalman Filter (EKF)?

The Extended Kalman Filter is the cornerstone nonlinear state estimator for robotics, enabling real-time sensor fusion and localization where linear assumptions fail.

The Extended Kalman Filter (EKF) is a nonlinear variant of the Kalman filter that estimates the state of a dynamic system by linearizing its nonlinear process and measurement models around the current mean and covariance. It performs a predict-update cycle: first predicting the state forward using a motion model, then correcting the prediction with incoming sensor data. This allows robots to fuse data from sources like IMUs, cameras, and LiDAR for tasks such as localization and visual-inertial odometry (VIO) in real-time.

The EKF's core mechanism is the first-order Taylor expansion, which approximates nonlinear functions as linear at the current estimate. This introduces linearization error, making the filter suboptimal but computationally efficient for many robotic applications. It assumes noise is Gaussian and is foundational for algorithms like SLAM. For highly nonlinear or non-Gaussian problems, the Unscented Kalman Filter (UKF) or Particle Filter are often preferred alternatives.

NONLINEAR STATE ESTIMATION

Key Features of the Extended Kalman Filter

The Extended Kalman Filter (EKF) is the foundational algorithm for nonlinear state estimation in robotics and autonomous systems. It extends the classic Kalman Filter by linearizing nonlinear models around the current estimate, enabling real-time tracking in complex, dynamic environments.

01

Local Linearization via Jacobians

The core mechanism of the EKF is the first-order Taylor expansion of nonlinear system and measurement models. It calculates Jacobian matrices—partial derivatives of the models with respect to the state and noise variables—at the current state estimate. This linearization approximates the nonlinear functions as linear for a single prediction-update cycle, making the Kalman filter's mathematics applicable.

  • Process Model Jacobian (F): Linearizes the state transition function.
  • Measurement Model Jacobian (H): Linearizes the function that maps the state to sensor observations.
  • This approximation is valid only locally, around the current estimate, and must be recomputed at every time step.
02

Two-Step Predict-Update Cycle

The EKF maintains a Gaussian belief over the system state, characterized by a mean vector and a covariance matrix. It operates in a rigorous two-step recursive cycle:

1. Prediction (Time Update):

  • Projects the state mean and covariance forward using the nonlinear process model.
  • The covariance is propagated using the linearized Jacobian F to approximate how uncertainty grows due to system dynamics and process noise.

2. Update (Measurement Update):

  • When a sensor measurement arrives, the EKF computes the Kalman Gain, which optimally weights the confidence in the prediction versus the new observation.
  • The state and covariance are corrected using the innovation (the difference between the actual and predicted measurement), linearized via the Jacobian H.

This cycle runs continuously, fusing noisy sensor data with model predictions.

03

Handling Nonlinear Dynamics & Sensors

The EKF's primary utility is estimating state in systems where motion or observations are not straight-line relationships. Common robotics examples include:

  • Robot Pose Estimation: Tracking [x, y, theta] where the motion model involves trigonometric functions (sin, cos) for rotation.
  • Sensor Fusion: Combining data from inherently nonlinear sensors like a monocular camera (perspective projection), radar (range and bearing), or an IMU (orientation via quaternions or Euler angles).
  • Landmark-Based Navigation: Updating a robot's position based on measuring the angle and distance to known landmarks, a nonlinear function of the robot's (x, y) pose.

The EKF provides a mathematically sound framework to unify these diverse, nonlinear data sources into a single consistent state estimate.

04

Computational Efficiency for Real-Time Use

Despite its approximations, the EKF is favored in embedded and robotic systems for its predictable computational footprint. Its complexity is O(n^3) where n is the state dimension, which is often manageable for typical state vectors (e.g., 6-15 dimensions for a robot's pose, velocity, and sensor biases).

  • Deterministic Runtime: The number of matrix operations is fixed per cycle, crucial for real-time operating systems (RTOS) where deadline guarantees are required.
  • Comparison to Alternatives: It is significantly less computationally intensive than the Particle Filter, which requires maintaining and updating hundreds or thousands of samples, especially in high-dimensional state spaces.
  • This efficiency enables deployment on onboard computers in drones, autonomous vehicles, and mobile robots.
O(n³)
Computational Complexity
05

Assumptions and Limitations

The EKF's performance is bounded by its underlying assumptions. Violations can lead to divergence (the filter becoming wildly inaccurate). Key limitations include:

  • First-Order Approximation Error: The Taylor expansion truncates higher-order terms. If system nonlinearities are severe or uncertainty is large, this linearization error can be significant, causing the filter to become inconsistent (underestimating its own error).
  • Gaussian Noise Assumption: The EKF assumes all process and measurement noises are Gaussian. It struggles with multi-modal distributions or heavy-tailed noise.
  • Susceptibility to Initialization: A poor initial guess can cause the filter to linearize around the wrong point, leading to divergence.
  • These limitations motivate more advanced filters like the Unscented Kalman Filter (UKF) or Particle Filter for highly nonlinear or non-Gaussian problems.
06

Core Applications in Robotics

The EKF is a workhorse algorithm in several foundational robotics perception and control stacks:

  • Visual-Inertial Odometry (VIO): Fusing camera features with IMU data to track a robot's 6D pose and velocity. The IMU dynamics and camera projection models are nonlinear.
  • Sensor Fusion for Localization: Combining wheel odometry (which drifts), IMU data, and occasional absolute measurements from GPS or LiDAR scan-matching within a single EKF framework.
  • Simultaneous Localization and Mapping (EKF-SLAM): Maintaining a joint state vector containing both the robot's pose and the positions of observed landmarks in the map, with nonlinear relationships between them.
  • Target Tracking: Estimating the state (position, velocity) of other moving objects from sensor data, using nonlinear motion models like coordinated turn.
COMPARISON

EKF vs. Other Estimation Filters

A technical comparison of the Extended Kalman Filter against other common state estimation algorithms, highlighting their mathematical foundations, computational characteristics, and suitability for different robotic perception problems.

Feature / MetricExtended Kalman Filter (EKF)Linear Kalman Filter (KF)Unscented Kalman Filter (UKF)Particle Filter (PF)

Core Mathematical Approach

First-order Taylor series linearization of nonlinear models

Optimal recursive estimator for linear Gaussian systems

Deterministic sampling (unscented transform) to propagate mean & covariance

Sequential Monte Carlo sampling of the posterior distribution

Handles Nonlinear Models

Handles Non-Gaussian Noise

State Representation

Single Gaussian (mean & covariance)

Single Gaussian (mean & covariance)

Single Gaussian (mean & covariance)

Set of weighted particles (arbitrary distribution)

Computational Complexity

O(n³) for covariance update, n = state dimension

O(n³) for covariance update

O(n³), similar to EKF but often more function evaluations

O(N·n), N = number of particles, can be very high

Typical Real-Time Performance

< 1 ms to ~10 ms (for moderate state dimensions)

< 1 ms

~1.5x to 2x slower than equivalent EKF

10 ms to seconds, highly particle-dependent

Jacobian Calculation Required

Dimensionality Curse Impact

High - covariance matrices scale quadratically

High - covariance matrices scale quadratically

High - covariance matrices scale quadratically

Extreme - particle count grows exponentially with state dimension

Typical Use Case in Robotics

Sensor fusion (e.g., Visual-Inertial Odometry), GPS/INS, robot arm state estimation

Simple linear dynamic systems, textbook examples

Highly nonlinear systems where Jacobians are costly/unsuitable (e.g., certain orientation representations)

Non-Gaussian, multi-modal estimation (e.g., global localization, SLAM with loop closures)

Implementation & Tuning Difficulty

Medium - requires careful Jacobian derivation and validation

Low - well-defined, simple equations

Medium - simpler than EKF but requires tuning of sigma point parameters

High - requires careful design of proposal distribution, resampling, and particle management

Theoretical Guarantee

Suboptimal approximation; can diverge with strong nonlinearities

Optimal for linear Gaussian case

Better approximation than EKF for moderate nonlinearities; no formal optimality

Asymptotically optimal as particle count → ∞

EXTENDED KALMAN FILTER

Frequently Asked Questions

The Extended Kalman Filter (EKF) is a cornerstone algorithm for state estimation in nonlinear systems, such as robotics and autonomous vehicles. These questions address its core mechanics, applications, and limitations.

The Extended Kalman Filter is a nonlinear state estimation algorithm that linearizes a system's dynamics and measurement models around the current state estimate to recursively predict and update the state of a system.

It works in a two-step recursive cycle:

  1. Prediction Step: The filter uses a nonlinear process model, f(x), to project the current state estimate and its uncertainty (covariance) forward in time. Since f(x) is nonlinear, the EKF uses a first-order Taylor expansion (the Jacobian matrix, F) to linearize the model around the prior estimate for covariance propagation.
  2. Update Step: When a new sensor measurement arrives, the filter uses a potentially nonlinear measurement model, h(x), to predict what the measurement should be. This model is also linearized via its Jacobian, H. The difference between the actual and predicted measurement (the innovation) is then used to correct the state prediction, weighted by the Kalman Gain. The Kalman Gain optimally balances the uncertainty in the prediction with the uncertainty in the new measurement.
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.