WITOI was at the WITO Summit

Aussi en français
can.sys
/articles/The blue dot that guesses: how your GPS keeps going in the metro and in tunnels
ARTICLEdate : length : 7 min readnavigationsensorsestimation

The blue dot that guesses: how your GPS keeps going in the metro and in tunnels

Why, as an engineering student, I wanted to understand how my phone still knows where I am when the signal itself has disappeared.

The other day, on the metro, I glanced at my phone out of habit. The blue dot was there, sitting on the line, and it was moving. Calmly, station after station, as if nothing were out of the ordinary. Except we were ten meters underground, under tons of concrete, and no satellite signal reaches that far. The engineer in me woke up with a start: that blue dot shouldn't exist.

Because it's the first thing you learn about GPS: it needs to see the sky. Satellite signals reach the ground extremely weak: on the order of 10 to 15 dB below the ambient noise. A roof, a floor above you, some trees, and it's already compromised. A tunnel or a metro platform is a wall. As far as the satellites are concerned, you no longer exist.

And yet the dot keeps moving.

Spoiler: it isn't GPS. Underground, your phone has no idea where you really are. It does something far more interesting: it guesses. And it guesses well.

That's what I want to talk about.

I. The inconvenient truth: GPS doesn't work underground#

You have to start by accepting something a little humbling: in a tunnel, the blue dot is not a measurement. It's an estimate. Your phone has lost its source of truth, and rather than display "position unknown" (which would be honest but useless), it keeps telling a believable story based on the last thing it knew.

This technique has a name, and it's older than computing: dead reckoning. Sailors practiced it centuries before satellites. The principle fits in one sentence: if I know my last position, my heading and my speed, I can work out where I am now, without measuring anything new. You start from a known point, and you extrapolate.

Underground, your phone no longer measures anything. It propagates the last truth it had, and hopes the world hasn't changed too much in the meantime.

This is exactly the situation engineers call a GPS-denied environment: a place where the primary signal is denied. And it's an entire field of research, not a bug to fix. The real engineering question isn't "how do you make GPS work underground" (answer: you can't). It's: how do you produce a believable position once the reference signal is gone?

II. How the phone guesses: two scenarios, two tricks#

There are two very different cases: the tunnel by car, and the metro on foot. They're not the same problem, and the way the phone copes isn't the same either.

The tunnel, by car#

This is the easiest case, and there's a reason for it. Your phone, like the car, carries an inertial measurement unit (IMU): an accelerometer and a gyroscope that measure accelerations and rotations. Starting from your last known speed and heading, the system integrates this data and moves the dot forward "blind".

But the real lifesaver is map matching: in a tunnel, you can't leave the road. The software knows this, and it snaps your estimated position onto the route. You can only go forward or backward, so the error stays contained. The best recent systems, which combine inertial sensors with neural networks, keep the error below 0.5% of the distance traveled. Over a 2 km tunnel, that's ten meters. More than enough not to miss the exit.

The metro, on foot, underground#

Much harder. There's no road to snap back onto, and you're no longer a car driving along but a pedestrian walking. Here, the phone stacks up everything it can find:

  • Pedestrian dead reckoning (PDR): the accelerometer detects each step and estimates its length, and the gyroscope/magnetometer provides the direction. Previous position + one step in a given direction = next position.
  • Wi-Fi: the access points in stations have known positions. By measuring signal strength (fingerprinting), the phone locates itself relative to them.
  • Bluetooth beacons (BLE), increasingly installed in major hubs.
  • The barometer, sometimes, to guess which floor or level you're on.

None of these sources is reliable on its own: Wi-Fi fluctuates, steps drift. That's why, in the metro, the blue dot hesitates, jitters, and sometimes skips a whole station. It's accumulating error.

The common engine: sensor fusion#

What holds all of this together has a name: sensor fusion. And at the heart of sensor fusion, one tool has dominated for fifty years: the Kalman filter.

Its idea is simple and beautiful: it loops between two moves. It predicts where you should be, from a model and the previous state:

x^k∣k−1=Fk x^k−1∣k−1+Bk uk\hat{x}_{k|k-1} = F_k \, \hat{x}_{k-1|k-1} + B_k \, u_k

then it corrects using the incoming measurement, weighting each source by how much it trusts it:

x^k∣k=x^k∣k−1+Kk(zk−Hk x^k∣k−1)\hat{x}_{k|k} = \hat{x}_{k|k-1} + K_k \left( z_k - H_k \, \hat{x}_{k|k-1} \right)

The gain KkK_k is the referee: the more reliable the measurement is judged to be, the more it pulls the estimate toward it; the noisier it is, the more it trusts the model.

When no measurement arrives (underground), it keeps predicting on its own, and its uncertainty grows. When a measurement comes back (you exit the tunnel), it snaps back into place in one go.

III. The real engineering problem: estimating without measuring#

This is where the paper I have in hand gets interesting, provided you're honest about what it says and what it doesn't.

The paper describes a military system, the Theater Positioning System (TPS), designed specifically for GPS-denied environments: canyons, urban areas, underground, inside buildings. The same enemy as my blue dot in the metro: no more satellites.

But, and this is a crucial distinction, the military solution is not the one in your phone. TPS adds a second real signal: a low-frequency radio wave (around 100 kHz) broadcast by ground stations, which penetrates where GPS can't. So the military has a genuine backup measurement. Your phone has nothing of the kind underground: just its inertial sensors and its dead reckoning. That's the whole difference between having a plan B that measures and having a plan B that guesses.

What is strictly identical, on the other hand, is the math. All of the paper's machinery, a state model and a variant of the Kalman filter (they use a "stochastic approximation" which, elegantly, doesn't even need to know the noise statistics), is exactly the family of tools your phone runs for its blue dot. And the paper's central idea is worth stealing:

As long as GPS is available, you learn how the errors behave. When it disappears, you keep predicting from what you've learned.

The phone does a humbler version of the same thing: while GPS is there, it knows your speed and heading; when it cuts out, it propagates from there. The paper goes further: it models how the signal drifts in order to anticipate it better.

And the authors are honest about the limit my metro blue dot already gives away: when the backup system works alone, accuracy decreases. An estimate without a reference always ends up drifting. The dot that hesitates, that skips a station, is exactly that: an estimate accumulating error, just as the theory predicts. And the moment a real measurement comes back, the correction brings it back to the truth.

In the end, all of this comes down to a single gap: the one between measuring and estimating. A good navigation system knows when it's guessing. It quantifies how much it trusts itself. And it corrects itself as soon as reality comes back. In V&V terms, it couldn't be clearer: the blue dot runs on a model, and a model is never better than its last calibration.

Conclusion: thinking like an engineer#

The blue dot gives an impression of magic: it always knows where you are, even underground. It's exactly the opposite. It's an admission of ignorance, handled with elegance: a system that keeps up a believable story until the world confirms it.

Thinking about the object like an engineer means refusing to take that magic for granted. It means asking three very simple questions when you look at the blue dot: is it measuring or is it estimating? With what confidence? And when was its last correction against reality?

It's the same reflex as everywhere else: don't confuse the number on the screen with the truth, know where the information comes from and what it's worth. A dot on a map is not a position. It's a bet, more or less well informed, on a position. Most of the time, the bet is excellent. But it's a bet.

And the next time that dot jumps a station on the metro, you'll know it's not a malfunction. It's just your phone rediscovering where it is, and finally telling you.

To measure is to know where you are. To estimate is to stay credible when you no longer know.