How to Use This Pack
This is the full script of a 100-minute session in eight timed parts. Read it as a narrative: the mathematics is derived in place, every symbol is introduced at first use, and the Stop and convince yourself boxes are the questions I would put to the room before moving on. The deck (slides.md) paces the same material live; the workbook (workbook.ipynb) is the executable half — deterministic (seed 7), fully offline, and the source of every quantitative claim below. Numbers from the lab's own experiments are simulation results, labelled in-silico wherever they appear; nothing in this week's lab material is a hardware measurement.
Week 1 ended with a model and a warning. The model was the log-distance path-loss rule — received power is a reference level minus a steady fade with distance, plus a random shadowing nudge — and the warning was that the nudge is large, spatial, and immune to waiting. This week we stop treating the model as given physics and start treating it as a measurement instrument: something with parameters you must fit from data, a calibration that goes stale, and failure modes you can reproduce in twenty lines of NumPy. To get there we will go back to 1946 and build the model from a sphere and an antenna aperture, walk it through the cellular-planning tradition that made it empirical, and then spend the second half of the session watching it break in the specific, reproducible ways that indoor deployments break it.
A few new words join the Week 1 vocabulary, and they will each earn their keep within the hour:
- Least squares — fitting a line by choosing the slope and intercept that make the squared vertical misses as small as possible. Because the path-loss model is a straight line on a log-distance axis, this is all the fitting machinery the model needs.
- Residual — what is left after subtracting the fitted line from each measurement. The spread of the residuals is the fit's own estimate of the shadowing spread \sigma.
- Bias vs scatter — scatter is error that changes from reading to reading; bias is error that stays. Averaging attacks scatter only. This distinction does most of the work this week.
- Lever arm — the spread of your calibration points along the log-distance axis. A slope fitted over a short lever arm is at the mercy of noise; the same number of points spread wide pins the slope down.
Part 1 · The Problem Nobody Ordered (0:00–0:12)
In April 2020, engineers at Google and Apple were handed a question that sounds like a homework exercise and turned out to be a research frontier: given the Bluetooth signal strength your phone hears from a stranger's phone, were the two of you within two metres of each other for fifteen minutes? The COVID-19 Exposure Notification framework — the joint Google/Apple protocol that most national contact-tracing apps built on — had exactly one physical observable to work with: the received signal strength (RSSI) of BLE advertisements. Epidemiologists needed distance. The protocol had decibels.
You already know, from Week 1, roughly how that conversion is supposed to work: received power falls with distance, so a weaker signal means a farther phone. The Exposure Notification teams knew it too, and did the engineering seriously — per-device calibration tables for each phone model's transmit power and receiver offset, attenuation buckets instead of raw metres, duration weighting. And yet, when independent researchers took phones onto trams, into offices and supermarkets, and measured how well the received signal actually predicted the two-metre threshold, the results were sobering. On a tram, the metal walls reflected the signal so thoroughly that attenuation barely correlated with distance at all. A phone in a back pocket, with a human body on the line between devices, could look farther away than a phone ten metres off with clear air between. Two phones in adjacent shopping baskets could look like an epidemiological contact; two commuters facing each other could look safe.
Nothing in that failure was a software bug. Every one of those effects — the reflecting tram, the absorbing body, the pocket — is a term this lecture will give a name, a probability distribution, and a decibel budget. The Exposure Notification episode is what it looks like when the world's two largest phone companies meet log-normal shadowing on a deadline, and it is the cleanest possible motivation for the week: the model that turns decibels into metres is genuinely useful, genuinely simple, and genuinely treacherous, and the difference between useful and treacherous is knowing exactly which of its three parameters you can trust, for how long, and in which rooms.
So here is the plan for the next hundred minutes. First we derive the model's clean ancestor from first principles — free-space propagation, 1946, one formula, no fitted constants. Then we let rooms ruin it, and meet the empirical tradition (Okumura, Hata, forty years of cellular planning) that responded by measuring the ruin and fitting straight lines through it. That gives us the log-distance model and its three parameters. The second half treats those parameters as living quantities: what a decibel of error costs in metres (an exact, slightly shocking formula), how the parameters are fitted (least squares, derived), and the three ways the fit decays in the field — obstruction mixtures, the averaging floor, and a recalibration strategy that made things worse than doing nothing. The lab's own experiments run through the whole second half as the research thread.
Part 2 · Free Space, 1946 (0:12–0:28)
A sphere, an aperture, and one page in the Proceedings of the IRE
Every path-loss model in every localisation paper descends from a one-page note. In 1946, Harald T. Friis of Bell Telephone Laboratories published A Note on a Simple Transmission Formula — a deliberate simplification by a microwave engineer tired of transmission formulas with obscure constants in them, meant to be rederivable at a whiteboard. We will honour the intent by doing exactly that.
Start with an isotropic transmitter — an idealised point source radiating power P_t watts equally in all directions. At distance d, that power has spread over a sphere of surface area 4\pi d^2, so the power density (watts per square metre) crossing the sphere is
That inverse-square law is not radio physics; it is geometry — the same law as for light, sound in open air, or paint from a spray can. If the transmit antenna is directional, it concentrates the same power into a preferred direction; we capture that with a dimensionless gain G_t (G_t = 1 for the isotropic case), so S(d) = P_t G_t / (4\pi d^2).
The receiving antenna now sits in this power flow and harvests some of it. The natural way to describe a harvester is by an area: the effective aperture A_e, defined so that the received power is the power density times the aperture,
The one genuinely deep fact in this derivation — the part Friis contributed rather than borrowed — is that an antenna's effective aperture is tied to its gain and to the wavelength \lambda by
a relation that follows from reciprocity and thermodynamic arguments and holds for any antenna, from a half-wave dipole to a dish. Note what it says: for a fixed gain, the capture area scales with \lambda^2. Shorter wavelengths — higher frequencies — present a smaller collecting area to the same power flow. Substituting,
This is the Friis transmission equation. Check the dimensions before trusting it: \lambda/(4\pi d) is a length over a length, dimensionless, so P_r carries the units of P_t, as it must. Check the behaviour: received power falls as 1/d^2 (the sphere), grows as \lambda^2 (the aperture), and scales linearly with both gains. The frequency dependence is worth pausing on, because it is routinely misread: free space does not absorb 2.4 GHz more than 900 MHz. The loss term is an antenna effect — at a higher frequency, an antenna of the same gain is physically smaller and intercepts less of the passing wave.
Into decibels
Radio engineering works in decibels because the quantities span many orders of magnitude and because chains of multiplicative effects become sums. Taking 10\log_{10} of the Friis equation, with powers in dBm (decibels relative to one milliwatt) and gains in dB:
The last term is the free-space path loss. Split it to expose the distance dependence:
a straight line in \log_{10} d with slope 20 dB per decade — equivalently, writing 20 = 10 \times 2, a path-loss exponent of exactly n = 2. In free space, n = 2 is a theorem, not a fit.
Now put BLE numbers in, from the workbook's Appendix A (all deterministic, reproduce them on paper): at 2.44 GHz — the middle of the 2.4 GHz ISM band BLE lives in — the wavelength is \lambda = c/f = 12.3 cm, and the free-space path loss at the 1 m reference distance is 40.2 dB. A 0 dBm transmitter with isotropic antennas would therefore deliver −40.2 dBm at one metre. And the slope: every doubling of distance costs 10\,n\log_{10}2 \approx 3n dB — 6.0 dB per octave at n=2, 9.0 at n=3, 12.0 at n=4 (Appendix A again). These are the anchor numbers for everything that follows; commit 40 dB and 6 dB-per-doubling to memory.
One number should already bother you. Our canonical indoor reference from Week 1 is P(d_0) = -59 dBm at 1 m — a full 18.8 dB below the free-space ideal. Where did nineteen decibels go at one metre of clear air? Into everything the Friis idealisation excluded: the phone's antenna is not isotropic and not lossless, it is detuned by the hand and the case, the transmit power is not exactly 0 dBm, and even at 1 m the floor and your torso are already part of the channel. That 18.8 dB gap is the first lesson in why the reference power is calibrated, never computed.
Part 3 · Rooms Are Not Free Space (0:28–0:45)
Okumura measures, Hata fits: the empirical turn
Friis holds beautifully between two antennas on towers with nothing in between. Almost nowhere else. The first community to hit this at industrial scale was cellular planning. In 1968, Yoshihisa Okumura and colleagues at Japan's electrical communication laboratory published an enormous measurement campaign around Tokyo: vans with calibrated receivers, transmitters on towers, thousands of kilometres of drive tests across frequencies from the low hundreds of MHz upward, terrain from open fields to dense urban canyons. The output was not a formula but curves — median received power versus distance, parameterised by frequency, antenna heights, and environment class. Okumura's answer to "what does the city do to the signal?" was: measure the city.
Curves are awkward inside planning software, so in 1980 Masaharu Hata fitted closed-form expressions to them — the Okumura–Hata model, still shipped in planning tools today. Two features of the fit matter to us. First, the fitted median loss is, to a good approximation, linear in \log_{10} d — the free-space form survives contact with a city; only the slope changes, and it changes upward: the fitted equivalents of our exponent n come out well above 2 in urban terrain. Second, the scatter of individual measurements about the median curve is itself lawful: roughly Gaussian in decibels, with a standard deviation planning practice takes to be of the order of several dB, larger in cluttered environments. The model that emerged from this tradition — a straight line in log-distance plus Gaussian-in-dB scatter — is exactly the model this course uses, and it is worth knowing that it was earned with petrol and patience, not derived.
The log-distance model, assembled symbol by symbol
Here is the generalisation, with every symbol given its passport:
- PL(d) — the path loss at distance d, in dB: transmit power minus received power. Equivalently we work directly with received power P(d) = P(d_0) - 10n\log_{10}(d/d_0) + X_\sigma; the two forms differ only in sign convention and where the hardware constants hide.
- d_0 — a reference distance, conventionally 1 m indoors. All the messy near-field and hardware effects are swept into the measured value at d_0; the model only claims to describe how loss grows beyond it.
- PL(d_0) (or P(d_0)) — the calibrated loss (or power) at the reference distance. This is the parameter the 18.8 dB gap taught us to measure rather than compute.
- n — the path-loss exponent: the slope of the line, in units of "times 10 dB per decade". Free space says exactly 2; indoor measurement campaigns report values typically between 2 and 4 — above 2 when walls and furniture absorb, occasionally below 2 in corridors, which duct the signal like a lossy waveguide and hand you more power than the sphere would.
- X_\sigma — the shadowing term: a zero-mean Gaussian random variable in dB, with standard deviation \sigma, typically 4–8 dB indoors. It captures everything position-specific the line cannot: this wall, that cabinet, the particular constructive or destructive layering of reflections at this exact spot.
Why should the leftover be Gaussian in dB, of all things? Because of what a dB is. A signal that reaches the receiver has typically crossed a sequence of partial obstructions and reflections, each of which multiplies the power by some random factor — a wall passes 20 %, a doorframe diffracts 60 %, a bookshelf scatters 80 %. In decibels those multiplications become additions, and a sum of many small independent random terms is pushed toward a Gaussian by the central limit theorem. Gaussian in the log domain means log-normal in the linear domain — hence the name log-normal shadowing, and hence the heavy right tail you saw in Week 1's error CDF: a symmetric bell in dB is a skewed distribution in milliwatts and metres.
Note carefully what kind of randomness X_\sigma is. It is frozen in space: stand still, and your X_\sigma is a fixed number, your personal offset from the model, for as long as the furniture and the people hold still. It is random only across positions. That is why Week 1 insisted that waiting does not help — a distinction we will make quantitative in Part 7.
RADAR, 2000: the model walks indoors
The model crossed the building threshold in a paper you should know by name. In 2000, Paramvir Bahl and Venkata Padmanabhan of Microsoft Research published RADAR, the first system to locate a person indoors from WiFi signal strength alone — three ordinary 802.11 base stations on one office floor, a laptop, and a lot of care. RADAR tried both of the strategies this course will teach. Its empirical method — recording the signal signature at a grid of surveyed points and matching against them at run time, the ancestor of Week 4's fingerprinting — achieved median errors of a few metres. Its model-based method fitted exactly our log-distance model to the building, augmented with a per-wall attenuation term (count the walls on the line to the base station, charge each one a fitted fee in dB), and came out somewhat worse but far cheaper to deploy: no survey, just parameters. Both numbers were honest, both methods survive today, and the tension between them — survey cost against model bias — is Week 4's opening question, not a settled verdict in either direction.
For this week, RADAR matters because of what its authors had to do to make the model fit at all: fit n per building, add wall terms per building, and accept a residual scatter that no amount of modelling removed. The log-distance model indoors is not one model; it is a template that each building instantiates with its own parameters — which is exactly why the rest of this lecture is about fitting, and about what happens to a fit when the building changes its mind.
Part 4 · The Exact Price of a Decibel (0:45–0:57)
Week 1 linearised the strength-to-distance inversion and got \sigma_d \approx 0.46\,d at the canonical n = 3, \sigma = 6 dB. The linearisation was honest but it hides the structure. Keep the inversion exact this time. Solve the mean model for distance — start from the received-power form, drop the shadowing term (this is the mean model, the one a deployed system actually inverts), and unwrap the logarithm step by step:
Now let the observation carry a shadowing error of \varepsilon dB — the reading is \varepsilon dB below what the mean model predicts at the true distance, i.e. P_\text{obs} = P(d_0) - 10n\log_{10}(d_\text{true}/d_0) - \varepsilon. Substitute and watch the mean-model terms cancel:
In words: a decibel error does not add metres to the estimate — it multiplies the distance by 10^{\varepsilon/(10n)}. Three consequences fall out of this one line.
First, only the ratio \varepsilon / n matters. A 4 dB error under free-space fading (n = 2) and a 6 dB error under the canonical indoor fade (n = 3) produce exactly the same distance factor, because both have \varepsilon/n = 2. The workbook prints both: \times 1.585. A steeper fade is, perversely, good news for ranging — the same shadowing costs fewer metres because each metre of distance moves more decibels.
Second, the growth is exponential. Doubling the shadowing from 4 to 8 dB at n = 2 does not double the error factor — it squares it: 1.585^2 = 2.512, printed by the workbook as \times 2.512. The typical indoor range quoted in the literature — \sigma of 4–8 dB, n of 2–4 — therefore spans a factor-of-several range in ranging quality, and the bad corner (high \sigma, low n: open-plan spaces with heavy shadowing) is disproportionately bad.
Third, the multiplier is symmetric in dB but not in metres: +\varepsilon multiplies where -\varepsilon divides, so exponentiating a symmetric dB error produces the right-skewed, heavy-tailed metre error whose CDF Week 1 made the course's reporting convention.

Hold this multiplier against the Exposure Notification story from Part 1. The two-metre epidemiological threshold, seen through a \times 1.585 one-sigma factor, is a band from roughly 1.3 m to 3.2 m at one standard deviation, in a well-characterised environment — and a tram is not a well-characterised environment. The engineers were not careless; the observable is coarse. That is the sober frame for everything RSSI ranging does: the question is never "is it exact" but "is the factor small enough for the decision at hand".
Part 5 · Fitting the Instrument (0:57–1:10)
Least squares, derived in four lines
The path-loss model has three parameters, and the fitting procedure is deliberately unglamorous. Because received power is linear in \log_{10} d, define for each calibration reading i:
and the model says y_i = a + b\,x_i + X_{\sigma,i} with intercept a = P(d_0) and slope b = -10n. Least squares chooses \hat a, \hat b to minimise the summed squared misses J(a,b) = \sum_i (y_i - a - b x_i)^2. Setting the two partial derivatives to zero,
and solving the pair (divide the first by the sample size to get \bar y = a + b\bar x, substitute into the second) gives the classical closed form:
Then \hat n = -\hat b/10, \hat P(d_0) = \hat a, and the residual standard deviation \hat\sigma = \operatorname{std}(y_i - \hat a - \hat b x_i) estimates the third parameter. One more line of the standard theory, and it is the line this whole week pivots on: the variance of the fitted slope is
where S_{xx} = \sum_i (x_i - \bar x)^2 is the spread of the calibration points along the log-distance axis — the lever arm from the vocabulary list. Noise \sigma you do not control; S_{xx} you control completely, by choosing where to stand when you calibrate. Keep \operatorname{Var}(\hat b) = \sigma^2/S_{xx} in view; it returns in Part 7 with money on the table.
This is exactly the calibration procedure reported in the empirical literature — measure RSSI at a ladder of known distances, curve-fit, read off the parameters per environment and per technology (sadowski2020_f2ba ↗), with variants that estimate the transmit power jointly when it is unknown (roy2022_18d3 ↗).
The workbook stages it on synthetic ground truth so the answer key is known: a ten-distance calibration ladder from 1 to 16 m, 25 readings per distance, true parameters P(d_0) = -59 dBm, n = 3, line-of-sight \sigma = 4 dB. The least-squares fit returns \hat P_0 = -59.76 dBm, \hat n = 2.978, \hat\sigma = 3.63 dB — all three parameters recovered closely from 250 clean readings.

Which of the three parameters matters most? Not the two the fit nails. P(d_0) and n set the mean curve, and errors in them produce systematic, correctable distortion. It is \sigma — the parameter that is not even a coefficient, just the width of what the model refuses to explain — that passes through the Part 4 multiplier and bounds the accuracy of every distance the model will ever emit.
A calibration byte ships in a billion phones
The reference-power parameter is so load-bearing that in 2013 Apple wrote it into a wire protocol. The iBeacon advertisement format — announced at WWDC 2013 and the trigger for the mid-2010s wave of beacon deployments — reserves one byte, Measured Power, defined as the RSSI the beacon expects a receiver to see at one metre. Every deployed iBeacon is supposed to be calibrated at install time: hold a phone a metre away, average the readings, write the byte. That byte is P(d_0), shipped inside every advertisement so that any receiver can run the inversion of Part 4 without a site survey.
And the protocol's designers, notably, did not promise metres. iBeacon's API reports proximity classes — immediate, near, far, unknown — an engineering admission, baked into the interface, that one calibrated parameter out of three buys you zone-grade ranging, not coordinates. The museum audio-guide that wakes up when you approach a painting, the retail app that greets you at the entrance: these are Measured-Power-plus-multiplier systems operating honestly within a zone-sized error budget. Where deployments overreached the byte — treating far as a distance rather than a label — they rediscovered \sigma and n the hard way: no per-building exponent, no shadowing spread, and no way to notice when the January calibration stopped describing the June store.
Part 6 · Drift: The Room That Changes (1:10–1:22)
One model, two propagation regimes
Real rooms mix propagation conditions. Some anchor-to-phone paths are clear; others pass through a wall, a cabinet, or a person. An obstructed reading is not "the same model plus more noise" — it carries a systematic extra loss (the wall) plus extra spread (what the wall is made of, what stands beside it). A deployed system fits one model to the pooled mixture, because it cannot know which readings were obstructed.
The workbook rebuilds the Part 5 sweep with 40 % of readings obstructed (mean extra loss 7 dB, spread 4 dB) and refits. The pooled fit returns \hat n = 2.949 and \hat\sigma = 5.67 dB — against 2.978 and 3.63 dB for the line-of-sight fit. The exponent absorbs part of the wall loss; the residual spread absorbs the rest, growing by roughly half. Passed through the multiplier at n = 3, the one-sigma distance factor widens from \times 1.32 to \times 1.54.

This is the drift mechanism of the week's title, and it is worth stating carefully because nothing about the radio changed. The transmit power did not sag; the antenna did not age. The mixture of propagation conditions changed — a door now closed, a shelf now full, a room now occupied — and the single-model fit silently re-distributed the discrepancy into its parameters. A fit made in an empty room on a Sunday describes a different mixture than the same room on a working Tuesday, which is why the parameters measured by careful calibration studies differ room by room and technology by technology even under one roof (sadowski2020_f2ba ↗), and why the model's own literature flags fingerprint and parameter staleness in changing environments as a standing problem (guo2020_267f ↗). Calibration does not survive contact with furniture.
Reread the Exposure Notification postmortem in this vocabulary and it stops being a mystery. The tram is an obstruction and reflection mixture taken to an extreme — a metal box where the "line" between phones is the least important path the signal takes. The body-in-pocket effect is a 40 %-obstructed sweep where the obstruction is water and the fraction depends on how people carry phones. The framework's per-device calibration tables were a serious attack on P(d_0) spread — the one parameter you can tabulate per phone model — but no table of devices can tabulate the room.
The road not taken: systems that refused to play
It is worth knowing that some of the earliest indoor location systems looked at this amplitude-versus-distance game and simply declined to play. At Olivetti Research (later AT&T Laboratories Cambridge), the lineage that began with the infrared Active Badge (Want and Hopper's team, early 1990s; room-level presence from worn badges) culminated in the Active Bat (Ward, Jones and Hopper, 1997 onward): a wearable transmitter chirps ultrasound on an RF cue, a grid of ceiling receivers measures times of flight, and positions come out at centimetre grade — accuracy the log-distance model will never deliver, bought with a ceiling full of wired receivers. MIT's Cricket (Priyantha, Chakraborty and Balakrishnan, MobiCom 2000) kept the ultrasound-plus-RF idea but inverted the architecture for privacy — beacons chirp, your device listens and ranges itself from the RF-to-ultrasound lag, and the infrastructure never learns where you are.
The modern descendant of this refusal ships in your pocket. Apple's AirTag (2021) and the U1/U2 ultra-wideband chips range by time of flight over ~500 MHz of bandwidth: distance from a clock, not an amplitude. A propagation delay does not care whether the path lost 4 dB or 12 dB on the way, so UWB's Precision Finding dodges the log-normal multiplier by construction — at the cost of dedicated silicon, wide spectrum, and its own failure mode (a blocked direct path delays the first arrival, biasing ToF long, which is Week 1's NLOS story). The pattern to internalise: Bat, Cricket and AirTag all pay a hardware or infrastructure premium specifically to avoid the parameter \sigma. This course's working signal — plain BLE RSSI on hardware that is already everywhere — chooses the opposite corner of the trade, which is precisely why it must take \sigma seriously enough to model, fit, and re-fit it.
Part 7 · Averaging, and the Recalibration That Backfired (1:22–1:34)
What averaging buys — and the floor it cannot break
Week 1 argued qualitatively that averaging cannot remove shadowing. This week the workbook puts numbers on exactly where averaging stops helping — because the temptation is real: BLE beacons chirp several times a second, so a phone can cheaply average tens of packets.
Decompose the error in a received reading into two parts. Fading scatter is per-packet, temporal: interference patterns shift, the channel flickers, each packet lands slightly differently (modelled at 3 dB here). Shadowing is the frozen spatial offset of Part 3: fixed for as long as neither you nor the furniture moves. Averaging N packets divides the first by \sqrt N — the standard error of a mean of independent draws — and does precisely nothing to the second, because the second is the same number in every packet. Nor does averaging touch any bias from a wrong exponent or an unmodelled wall. Scatter versus bias, exactly as the vocabulary list promised.
The workbook holds a receiver at a true 8 m and sweeps N from 1 to 256 across 400 shadowing positions. With temporal fading alone, the RMS ranging error falls from 1.84 m at N=1 to 0.22 m at N=64 — the clean \sqrt N story. With shadowing included, the same averaging moves the error only from 3.60 m to 2.67 m, where it flattens onto the shadowing floor of 2.67 m and stays.

The practical reading: averaging is worth roughly the gap between the two curves at N=1 — real, cheap, and bounded. Everything below the floor belongs to the other levers this course pulls later: geometry (more anchors, Week 3) and calibration maintenance (Week 9).
Cheap recalibration can be worse than none
If the model drifts, the obvious response is to re-fit it — and the obvious economy is to re-fit it cheaply: a handful of fresh readings at a few convenient spots, an affine correction, done. The lab tested exactly this in silico, and the result is this week's cautionary centrepiece. In a cross-geometry transfer experiment — a model fitted in one room geometry, deployed in another — re-anchoring the model with an affine fit on K = 3 calibration points produced a worse model than not recalibrating at all: a cross-geometry error multiplier of 2.39× with K=3 against 1.48× zero-shot. An affine re-anchoring cannot fix a geometry-mismatched model; it can only re-scale it, and with three noisy points it re-scales it wrongly.
The workbook reproduces the mechanism on synthetic data, where every quantity is inspectable. An environment with true parameters (P_0, n) = (-60.5\ \text{dBm}, 3.25) is served by a deployed model fitted elsewhere, (-59\ \text{dBm}, 3.0). Recalibration draws K noisy readings (\sigma = 6 dB) at points clustered near the anchor — 1 to 2 m, where taking calibration measurements is convenient — and refits the line; evaluation happens at 4–14 m, where positioning actually matters. Over 600 trials, the median relative ranging error comes out:
| Strategy | Median relative error |
|---|---|
| Zero-shot (mismatched model, no recal) | 0.40 |
| K=3, clustered 1–2 m | 0.63 |
| K=6, spread 1–12 m | 0.31 |
| K=12, spread 1–12 m | 0.31 |
The clustered three-point recalibration is markedly worse than the mismatched model it replaced — the same direction as the lab's in-silico 2.39× vs 1.48× — while six points spread over the operating range already beat both. And you have already derived the mechanism: it is \operatorname{Var}(\hat b) = \sigma^2 / S_{xx} from Part 5, with numbers attached. Three points spanning 1–2 m cover about 0.3 decades of log-distance, so S_{xx} is tiny and 6 dB of shadowing noise swings the fitted exponent wildly; the model then extrapolates that swing out to 14 m, where the eval band lives. The workbook's second exercise makes the point surgically: the same K=3, moved to 1, 4, and 12 m — roughly ten times the lever arm — drops the median error from 0.63 to 0.35. Calibration value is measured in decades of distance covered, not in points collected.

Week 9 turns this from a warning into a schedule: when to recalibrate, with what spatial dose, at what cost. This week establishes the constraint any such schedule must respect.
Part 8 · The Lab Thread, and Three Channels (1:34–1:40)
What the lab's BLE anchors actually resolve
The course's working signal is BLE strength, so it is fair to ask what the lab's own BLE anchors have demonstrably resolved — and where they saturate. Three in-silico results, quoted with their limits.
Presence is robust. In the lab's multiroom simulation, a co-registered BLE anchor separates occupied from empty with effect sizes of Cohen's d = 2.3–3.7 — distributions so far apart that presence detection is essentially solved in that setting. But the same anchor saturates on graded headcount: two people versus five people barely move the observable once someone is present. Presence is not counting, and neither is identification — the anchors register that someone's advertisements are present, never who; the count-without-identify property is a design constraint the course keeps, not a defect to engineer away.
Aggregation geometry matters more than raw signal. In the same family of experiments, concentrating anchor observations at a hub recovered a graded trend with crowd size — the per-person slope moving from +0.08 to −0.48 dB/person — where dispersed placement resolved no trend at all. The information was in the air in both cases; only one aggregation geometry extracted it. Placement and pooling, not radio sensitivity, made the difference — an echo, at system scale, of this week's lever-arm lesson.
Fingerprint separability, precisely scoped. In one in-silico comparison, BLE location fingerprints measured ~2.49× more separable than sparse CSI links in the same layout. The scope matters: that is one measured comparison, in one simulated setting, against sparse CSI links — not a general claim that fingerprinting beats model-based geometry, which Week 4 treats on its own terms alongside its survey cost. What the number does support is more modest: the per-anchor offsets this week treats as calibration nuisance are informative structure — the same device diversity that corrupts a pooled LDPL fit is what a fingerprint exploits.
Preview: three channels, three models
One BLE fact belongs in the path-loss week rather than the BLE week. BLE advertising hops across three channels — 37 (2402 MHz), 38 (2426 MHz), 39 (2480 MHz) — spread across the 2.4 GHz band edge to edge. The received mean differs per channel: antenna responses and channel conditions are frequency-dependent, and measurements with channel-resolving receivers show distinct per-channel RSSI means and variances, with the pooled stream noisier than any single channel (iannizzotto2022_1c98 ↗). Most commodity receivers do not report which channel a packet arrived on (iannizzotto2023_86c7 ↗) — so a deployed system pools three shifted distributions and fits one model to the mixture. Structurally, this is Part 6 again: a hidden mixture absorbed as fake \sigma.
The workbook renders the effect with illustrative offsets (±4 dB across channels, 4 dB per-channel spread): the pooled stream measures 5.2 dB against the per-channel 4 dB, widening the distance multiplier from \times 1.36 to \times 1.48 at n=3. Systems with channel-resolving hardware exploit this in reverse — modelling each advertising channel separately and selecting among them, which is precisely the channel-diversity strategy of the BLE positioning literature (cantnpaterna2017_8af8 ↗). Per-device transmit-power and antenna spread shifts P(d_0) the same way, device by device — every phone model is its own reference level, which is exactly why the Exposure Notification framework shipped per-model calibration tables and why iBeacon made Measured Power a per-beacon byte rather than a constant. Week 8 measures all of this properly; here it stands as the final entry in the week's catalogue of drift sources.

Key Results and Where to Reproduce Them
Result 0 — Free-space anchors. At 2.44 GHz: \lambda = 12.3 cm; FSPL(1 m) = 40.2 dB (so 0 dBm TX → −40.2 dBm at 1 m, isotropic); gap to the canonical indoor P(d_0) = -59 dBm: 18.8 dB; per-octave loss 6.0 / 9.0 / 12.0 dB at n = 2 / 3 / 4. Reproduce in workbook Appendix A (deterministic).
Result 1 — The distance multiplier. A shadowing error of \varepsilon dB multiplies the distance estimate by 10^{\varepsilon/(10n)}: ×1.585 at \sigma/n = 2 (4 dB at n=2; 6 dB at n=3), ×2.512 at 8 dB and n=2. Reproduce in workbook Cell 4 (prints the multiplier table).
Result 2 — Least-squares fit. From 250 clean synthetic readings: \hat P_0 = -59.76 dBm, \hat n = 2.978, \hat\sigma = 3.63 dB against truths (-59, 3, 4). Reproduce in workbook Cell 6.
Result 3 — Obstruction inflation. Pooling 40 % obstructed readings inflates \hat\sigma from 3.63 to 5.67 dB and biases \hat n to 2.949; the one-sigma multiplier widens from ×1.32 to ×1.54. Reproduce in workbook Cell 8.
Result 4 — Averaging floor. At 8 m, 64-packet averaging cuts temporal-only error 1.84 m → 0.22 m but realistic error only 3.60 m → the 2.67 m shadowing floor. Reproduce in workbook Cell 10.
Result 5 — Recalibration overfit. Synthetic mechanism: zero-shot median relative error 0.40; K=3 clustered recal 0.63; K=6 spread 0.31. Pinned lab in-silico cross-geometry result, same direction: K=3 affine recal 2.39× vs zero-shot 1.48×. Reproduce in workbook Cell 12 (the lab numbers are pinned constants; the mechanism is recomputed).
Result 6 — Channel pooling. Pooling three channels with ±4 dB illustrative offsets inflates apparent spread from 4 to 5.2 dB (multiplier ×1.36 → ×1.48 at n=3). Reproduce in workbook Cell 14.
What You Can Now Do
By the end of this week you can:
- Derive the Friis equation from a sphere and an aperture, compute FSPL at any frequency and distance, and explain why n=2 is a theorem in free space and a fitted parameter everywhere else.
- State why a dB error is a distance factor, compute 10^{\sigma/(10n)} for any parameter pair, and explain why only the ratio \sigma/n matters.
- Fit (P(d_0), n, \sigma) from a calibration sweep by least squares on a log-distance axis — including deriving the estimator and its slope variance \sigma^2/S_{xx} — and identify \sigma as the parameter that bounds accuracy.
- Name the indoor drift mechanism — a changing mixture of propagation conditions absorbed by a single-model fit — predict its signature (inflated \hat\sigma, biased \hat n), and recognise it in deployed-system postmortems from RADAR's per-building fits to the Exposure Notification calibration tables.
- Partition ranging error into scatter and bias, compute the floor that packet averaging cannot cross, and say what levers remain below it.
- Apply the minimum-spatial-dose rule: judge a proposed recalibration by the decades of log-distance it covers (S_{xx}), not the number of points it collects.
Week 3 takes the step this week has been preparing: from one noisy range to a position. Three anchors, three stretchy circles, and a new actor — geometry — that decides whether the intersection is a point or a smear. The bridge in one line: you now know exactly how wrong one range is; next week decides how much that wrongness costs at the position fix, and the answer depends on where the anchors stand.
Exam-Style Questions
Q1 (derivation). Starting from the received-power form of the log-distance model, derive the exact relation between a shadowing error of \varepsilon dB and the resulting distance estimate. Then evaluate the one-sigma multiplier for (a) \sigma = 8 dB, n = 4 and (b) \sigma = 8 dB, n = 2, and explain in one sentence why the two differ the way they do. Model answer sketch: invert the mean model, substitute P_\text{obs} = P_\text{mean}(d_\text{true}) - \varepsilon, cancel to \hat d = d_\text{true} 10^{\varepsilon/(10n)}. (a) \sigma/n = 2 → ×1.585; (b) \sigma/n = 4 → ×2.512 (workbook Cell 4). Only the ratio \sigma/n enters, and the dependence is exponential, so halving n at fixed \sigma squares the factor.
Q2 (Friis). Derive the free-space path-loss expression \text{FSPL}(d) = 20\log_{10}(4\pi d/\lambda) from the Friis equation, stating the physical origin of each factor. Compute FSPL at 1 m for 2.44 GHz, and give two distinct physical reasons why a real BLE beacon's measured 1 m reference power sits well below the free-space prediction. Model answer sketch: sphere → P_t G_t/(4\pi d^2); aperture A_e = G_r\lambda^2/4\pi; combine, take -10\log_{10} of the loss factor. At 2.44 GHz, \lambda = 12.3 cm, FSPL(1 m) = 40.2 dB (workbook Appendix A). Reasons for the ~19 dB gap to -59 dBm: non-isotropic lossy antennas / detuning by casing and hand; TX power below nominal; the environment (floor, body) already present at 1 m. Any two, physically argued.
Q3 (fit corruption). A facilities team calibrates a beacon system in an empty building over a weekend and obtains \hat n = 2.98, \hat\sigma = 3.6 dB. Six months later a monitoring script refits from live data and reports \hat n = 2.95, \hat\sigma = 5.7 dB. The team concludes the beacons are failing and orders replacements. Argue against the purchase order: what mechanism explains the numbers without any hardware change, what signature distinguishes it, and what would you measure to confirm? Model answer sketch: obstruction-mixture drift (workbook Cell 8): pooling LOS and obstructed readings inflates \hat\sigma (3.63 → 5.67 dB in the synthetic reproduction) and mildly biases \hat n; the room's propagation mixture changed (occupancy, furniture, doors), not the radios. Confirm by conditioning the refit on time-of-day/occupancy, or by a small LOS-only re-sweep: if LOS residuals still show ~3.6 dB, the hardware is fine.
Q4 (averaging floor). With 3 dB per-packet fading and 4 dB shadowing at a true 8 m (n=3), averaging 64 packets improves RMS error from 3.60 m only to 2.67 m. Explain, using the scatter/bias decomposition, why the improvement stalls; state what the 2.67 m floor consists of; and name two interventions that go below it, saying for each why it works where averaging fails. Model answer sketch: averaging divides temporal scatter by \sqrt N but shadowing is a frozen spatial offset — identical in every packet, hence untouched (Cell 10). The floor is the shadowing-induced distance error alone. Below it: spatial diversity (moving/multiple anchors re-draws X_\sigma, turning bias into scatter that can be averaged); re-fitting the model or fusing another modality (attacks the bias itself). Week 3's geometry is the systematic version.
Q5 (lever arm). Using \operatorname{Var}(\hat b) = \sigma^2/S_{xx}, explain quantitatively why K=3 calibration points at 1–2 m produced a worse model (median relative error 0.63) than no recalibration (0.40), while the same three points at 1, 4, 12 m scored 0.35. Why did K=12 spread points not improve on K=6 (both 0.31)? Model answer sketch: clustered points span ~0.3 decades → tiny S_{xx} → slope variance explodes under 6 dB noise; the error is then amplified by extrapolation to the 4–14 m eval band. Spreading to 1–12 m multiplies the lever arm ~10×, collapsing slope variance (workbook Cells 12, Exercise 2). Beyond K=6, S_{xx} (and the 1/K noise averaging) is already large enough that shadowing \sigma, not slope variance, dominates — the returns saturate.
Q6 (systems synthesis). iBeacon ships a per-beacon Measured Power byte; the Exposure Notification framework shipped per-device-model calibration tables; the Active Bat and AirTag range by time of flight. Place each design on the three-parameter map of this week (P(d_0), n, \sigma): which parameter does each attack, which does it ignore, and what failure mode does the ignored parameter predict? Model answer sketch: iBeacon calibrates P(d_0) per beacon, ignores n and \sigma → honest only at zone granularity (immediate/near/far). Exposure Notification tabulates P(d_0) spread across device models, cannot tabulate the room's \sigma → tram/pocket failures. ToF systems sidestep the amplitude model entirely — no \sigma multiplier — paying in hardware/infrastructure and inheriting NLOS delay bias instead.
Further Reading
Annotated; vault notes are wikilinked, classics are cited by name and year.
- sadowski2020_f2ba ↗ — the Part 5 calibration procedure done on real hardware: per-room, per-technology curve fits of (C, n) across three scenarios, and the orientation effects that motivate careful measurement protocol.
- roy2022_18d3 ↗ — the LDPL model in survey form, including joint estimation of transmit power and exponent when neither is known.
- guo2020_267f ↗ — the log-normal model's role in model-based positioning and the standing problem of fingerprint/parameter staleness in changing environments.
- cantnpaterna2017_8af8 ↗ — BLE advertising on channels 37/38/39 and per-channel modelling as a deliberate design choice; the channel-diversity strategy previewed in Part 8.
- iannizzotto2022_1c98 ↗ — measured per-channel RSSI differences and the variance cost of channel-blind pooling.
- iannizzotto2023_86c7 ↗ — why commodity receivers cannot attribute packets to advertising channels, and what that does to RSSI variability.
- fallani2026_04be ↗ — the multipath-shadowing limit on RSSI ranging, carried over from Week 1 as the theoretical frame for this week's \sigma-centric view.
- Friis, H. T., A Note on a Simple Transmission Formula, Proc. IRE, 1946 — one page; the free-space equation of Part 2 in its original aperture form, written explicitly to be rederivable.
- Okumura, Y. et al. (1968) and Hata, M. (1980) — the measurement campaign and the closed-form fits that founded the empirical path-loss tradition; read for how the log-distance form was earned, not assumed.
- Bahl, P., Padmanabhan, V., RADAR: An In-Building RF-Based User Location and Tracking System, IEEE INFOCOM, 2000 — the first WiFi RSSI localisation system; both the fingerprinting and the wall-attenuation path-loss model of Part 3, with honest error reporting.
- Priyantha, N., Chakraborty, A., Balakrishnan, H., The Cricket Location-Support System, MobiCom, 2000 — RF-plus-ultrasound ranging with a privacy-preserving architecture; together with Ward, Jones and Hopper's Active Bat (1997), the road-not-taken contrast of Part 6.
- Apple, iBeacon (2013) and the Google/Apple Exposure Notification framework (2020) — two industrial deployments of this week's model: P(d_0) as a protocol byte, and the RSSI-to-proximity problem at population scale. For the empirical critique of the latter, look for the Trinity College Dublin RSSI measurement studies (Leith and Farrell, 2020).