The EKF & GNSS/INS Integration
Teach the filter to read raw pseudoranges, then let inertial sensors carry it through the tunnel
Why it matters
Every production GNSS receiver runs an EKF over raw measurements, and every system that must survive signal gaps — cars in tunnels, phones in cities, drones under bridges, aircraft on approach — fuses GNSS with inertial sensors this way. It is the single most widely deployed estimator in navigation.
Prerequisites
Two things the clean filter couldn't do
The Kalman filter you just tuned was beautiful, and it was cheating in two ways you may not have noticed.
First, it was handed a ready-made position fix every step — a neat with a tidy noise. But a receiver never measures position. It measures pseudoranges: distances to satellites, each a square root of squared coordinate differences. That is not a linear function of where you are, and the Kalman filter's whole elegant machinery assumed everything was linear.
Second, it assumed a fix always arrived. Drive into a tunnel, park under a bridge, thread an urban canyon, and the sky simply goes away. The clean filter, starved of measurements, would coast on dead reckoning — but with a constant-velocity model it has nothing but inertia to guess with, and it quietly goes blind.
This lesson removes both crutches. The result is the estimator that actually runs inside your phone and your car: the Extended Kalman Filter, fusing raw GNSS with an inertial measurement unit.
The idea, before any mathematics
Take the two problems in turn, because each has a disarmingly simple fix.
Nonlinear measurements. The filter's update needs to know "if I were here, what would the measurement be, and how does it change as I move?" For a pseudorange, the answer is almost obvious: if you step one metre toward a satellite, the range shrinks by one metre; step sideways, and it barely changes. So near your current guess, the curved range relationship looks like a straight ramp pointing along the line of sight. The EKF's entire trick is to stop insisting the world is linear and instead re-draw that straight ramp at your current best guess every single step. Linearise, update, repeat. That is the whole of "extended."
The vanishing sky. Give the filter a second source of truth that never needs satellites: an inertial measurement unit, which feels acceleration and rotation directly. The IMU does not know where you are — but it knows exactly how you are changing, and that is precisely what a prediction step wants. So let the IMU drive the prediction and let GNSS drive the update. When satellites are visible, each fix reins the estimate in. When they vanish, the filter keeps propagating on the IMU alone — dead reckoning — and simply grows less certain until the sky comes back.
The IMU answers "how am I moving?" and never needs the sky. GNSS answers "where am I, absolutely?" and needs it badly. Fuse them in one covariance and each covers the other's blind spot.
There is a catch that gives inertial navigation its entire character, and it is worth feeling in your gut. An IMU's errors accumulate. A tiny constant bias in measured acceleration, fed through two integrations to position, becomes an error that grows with the square of time. So dead reckoning is superb for seconds, good for a short tunnel, and hopeless for minutes alone. The quality of your IMU is, quite literally, how long you can survive without the sky — and that is what bounds the amber drift you are about to watch.
Seeing it
Picture a car on a curving road with GNSS locked on: the fused track sits welded to the centreline, a tight little uncertainty ellipse riding along with it. Then the road dives into a tunnel. The fixes stop. The track, now coasting on the IMU, begins to peel away from the true road — slowly at first, then faster — while the ellipse swells around it like a balloon, the filter's honest confession that it is guessing. The car bursts back into daylight, a fix arrives, and the estimate is yanked back onto the road as the balloon pops shut.
Try it yourself
The blue track is GNSS-aided; the amber track is coasting on inertial sensors alone. Scrub into the shaded tunnel and watch it drift.
- Status
- tracking
- Position error
- 61 cm
- Position σ
- 75 cm
- Est. clock bias
- 1200 m
While GNSS is visible the track is blue and welded to the road: each second the EKF linearises the raw pseudoranges about its current guess and corrects. Now scrub into the shaded tunnel. The pseudoranges vanish, the track turns amber, and the filter coasts — dead-reckoning on the IMU’s acceleration alone. Watch the estimate peel away from the road and the uncertainty ellipse balloon: with no measurement to check it, the filter grows honestly less sure. The instant GNSS returns, a few updates yank the estimate back and the ellipse snaps shut. Drag the outage length out and the drift compounds — dead reckoning error grows with the square of time. Then raise the IMU error: a cheap sensor drifts fast, a good one can coast for a surprisingly long time. That trade — how long you can survive without the sky — is exactly what you pay for in an inertial unit.
With GNSS present the track is blue and locked to the road. Scrub into the tunnel and it turns amber and drifts, the ellipse ballooning because nothing is checking the IMU. The moment GNSS returns, the estimate snaps back and the ellipse collapses. Now play the two levers that matter. Stretch the outage length: short gaps barely register, but the error grows with the square of time, so a long tunnel runs away. Then raise the IMU error: a cheap sensor sprints off the road, while a near-perfect one can coast a remarkably long way. That single trade — drift rate versus outage length — is the entire economics of an inertial unit, and it is why an aviation-grade IMU costs more than the aircraft's GNSS receiver.
Now the mathematics
Keep the Kalman rhythm exactly; only the models change. Carry the state
with position, velocity, and the receiver clock bias (in metres) as an explicit unknown, just as in single-point positioning.
Predict with the IMU. The measured acceleration is the control input that propagates the mean, and the covariance grows by the process noise (now set by the IMU's accuracy):
where is the constant-acceleration kinematics (, ) and is its Jacobian.
Update with raw pseudoranges. The measurement model for satellite is nonlinear:
The EKF does not use directly in the gain; it uses its Jacobian, the row of partial derivatives evaluated at the current estimate:
Look at what is: the line-of-sight unit vector to the satellite, with a for the clock. It is the identical geometry SPP linearised, and the identical object that dilution of precision measures. With the Jacobian in hand the update is letter-for-letter the Kalman update from before:
using the actual nonlinear for the innovation but the linearised for the gain. And is not invented either — it is the pseudorange error from the error budget. During an outage there simply is no : the update is skipped, keeps growing by each step, and that growth is the ballooning ellipse. Linearising a curve by its tangent is an approximation, and when the estimate is far from truth — a long, drifted outage — the approximation frays; that failure mode is why good initialisation and the UKF/particle-filter alternatives exist.
How this appears in engineering
This is the estimator of record for navigation. A standalone receiver runs an EKF over raw pseudoranges (and often carrier phase and Doppler), carrying the clock bias and drift as states and reporting a smooth position/velocity/time solution. Add inertial sensors and you choose an integration depth: loosely coupled fuses the GNSS position solution with the IMU (simple, but needs four satellites to produce that solution); tightly coupled fuses the raw pseudoranges — exactly the model above — so it benefits from even one or two satellites glimpsed between buildings; deeply coupled feeds the filter all the way back into the receiver's tracking loops. The deeper the coupling, the more gracefully the system degrades in hard environments.
The same structure, with more states, is how modern RTK and PPP engines are built — an EKF carrying carrier ambiguities and atmospheric terms. And the innovation keeps doing double duty as an integrity check: a pseudorange whose residual dwarfs what predicts is a likely multipath blunder or a spoofed signal, flagged and down-weighted before it corrupts the state.
Check your understanding
- The EKF uses the nonlinear to form the innovation but the linear to form the gain. Why each, and what would go wrong if you used the linear model for both?
- Write down the measurement Jacobian row for a pseudorange and say, in words, what each entry means geometrically. Which earlier concept is this exactly?
- A car enters a 30-second tunnel. Its position error at exit is four times what it was after a 15-second tunnel. What does that ratio tell you about the dominant IMU error?
- A tightly coupled receiver keeps improving its estimate in an urban canyon where only two satellites are ever visible at once, yet a loosely coupled one goes dead. Explain the difference.
Where to go next
You have now assembled the estimator that silently runs your daily life: a Kalman filter, extended to raw nonlinear measurements by linearising on the fly, and fused with inertial sensors so it survives the sky going dark. Every precise engine from here is an elaboration of it — RTK and PPP are EKFs carrying extra states, and the frontier (the UKF, factor-graph smoothing, deeply coupled tracking) is about linearising more faithfully and fusing more sensors. The rhythm, though, never changes: predict what you believe, measure what you can, and blend them by exactly how much each deserves to be trusted.
Common misconceptions
- The EKF is a different filter from the Kalman filter. It is the same predict/update rhythm; the only addition is linearising nonlinear models about the current estimate each step.
- GNSS/INS integration means averaging two position solutions. The IMU does not produce a position; it drives the prediction, and GNSS corrects it — fusion at the measurement level.
- Inertial navigation is drift-free. Unaided inertial position error grows without bound (with the square of time for a bias); GNSS updates are what keep it bounded.
Key takeaways
- The EKF linearises nonlinear models about the current estimate, then runs the KF equations.
- A pseudorange's Jacobian is the line-of-sight unit vector, the same geometry as SPP.
- IMU measurements drive the prediction; GNSS pseudoranges drive the update.
- During a GNSS outage the filter coasts on the IMU and its covariance grows.
- Unaided inertial drift grows with time; GNSS bounds it, and the two cover each other's gaps.