---
title: Link budgets
heading: Adding up every gain and loss between transmitter and receiver
eyebrow: C10 · Lesson 44 · Link budgets
xp: 40
---

::: hook
Will the link work? Every radio system, from a garage-door opener to a deep-space probe, answers that question the same way: start with the transmitter's power in dBm, add the antenna gains, subtract the path loss and every other loss, and compare what's left with the noise at the receiver. Because everything is in decibels, the whole calculation is additions, and the result says how much margin there is against fading.
:::

::: play
- The solid curve is free-space path loss against distance, rising 20 dB per decade.
- The dashed curve is the two-ray model for antennas at heights $h_t$ and $h_r$ above flat ground: beyond the breakpoint distance $4h_th_r/\lambda$, the ground reflection cancels the direct wave and the loss rises 40 dB per decade.
- Raise the antennas: the breakpoint moves out and the link behaves like free space for longer. That's why base-station antennas sit on towers.
:::

```sim plot
view: graph
x: d = 1..10000 m log
y: L = 30..170 dB
slider: f = 0.1..6 step 0.1 = 0.9 GHz
slider: h = 1..50 step 0.5 = 1.5 m
plot: 20*log(4*pi*d/(0.2998/f)) | label: free space
plot: 20*log(4*pi*d/(0.2998/f))*step(4*h*h/(0.2998/f) - d) + (40*log(d) - 20*log(h*h))*step(d - 4*h*h/(0.2998/f)) | dashed | label: two-ray, both antennas at h
readout: breakpoint, m = 4*h*h/(0.2998/f) | digits: 4
```

::: predict
## A 2.4 GHz link sends 20 dBm through 2 dBi antennas at each end, 50 m apart in free space. About what power arrives?

- [ ] −10 dBm
- [x] −50 dBm
- [ ] −74 dBm
- [ ] −100 dBm

::: reveal
−50 dBm. The free-space path loss is $20\log_{10}(4\pi d/\lambda) = 74.0$ dB at 50 m (λ = 12.5 cm), so 20 + 2 + 2 − 74 = −50 dBm: ten nanowatts, but tens of decibels above a Wi-Fi receiver's noise floor.
:::
:::

::: nameit
## The budget

$$P_r = P_t + G_t + G_r - L_\text{path} - L_\text{other} \quad\text{(all in dB or dBm)}$$

$P_t + G_t$ is the **EIRP**, the power an isotropic antenna would need to produce the same field. The free-space path loss is

$$L_\text{fs} = 20\log_{10}\frac{4\pi d}{\lambda}$$

which grows 6 dB for each doubling of distance or frequency (for fixed-gain antennas). Other losses include cables, connectors, polarization mismatch, walls, rain and foliage.

## The noise floor

A receiver's noise, referred to its input, is

$$N = -174\text{ dBm/Hz} + 10\log_{10}B + NF$$

where −174 dBm/Hz is kT at 290 K, B the bandwidth in hertz and NF the receiver's noise figure. The SNR is $P_r - N$, and the **fade margin** is how far it exceeds the SNR the modulation needs.

## Ground and obstacles

Over flat ground the reflected wave arrives nearly opposite in phase. Beyond the **breakpoint** $d_b = 4h_th_r/\lambda$ the two waves nearly cancel and the loss follows $40\log_{10}d - 20\log_{10}(h_th_r)$: 40 dB per decade. The direct path also needs the first Fresnel zone, radius $\sqrt{\lambda d_1d_2/d}$, mostly clear of obstacles; a hill or building cutting into it adds diffraction loss.
:::

::: example
## Finish the predict question's Wi-Fi link: 20 MHz channel, 6 dB noise figure. What is the SNR?

::: solution
1. **Noise floor.**
   $$\begin{aligned} N &= -174 + 10\log_{10}(2 \times 10^7) + 6 \\ &= -174 + 73.0 + 6 \\ &= -95.0\ \text{dBm} \end{aligned}$$
2. **SNR.** With −50.0 dBm received,
   $$-50.0 - (-95.0) = 45\ \text{dB}$$
3. **What it buys.** That's enough for the densest modulation Wi-Fi offers, with about 15 dB to spare for walls and fading.

**Answer:** the SNR is 45 dB.
:::
:::

::: example
## Two 900 MHz handsets are held at 1.5 m. Where is the two-ray breakpoint, and what is the loss at 1 km compared with free space?

::: solution
1. **Breakpoint.** λ = 0.333 m, so
   $$\begin{aligned} d_b &= \frac{4 \times 1.5 \times 1.5}{0.333}\ \text{m} \\ &= 27\ \text{m} \end{aligned}$$
2. **Two-ray loss at 1 km.**
   $$\begin{aligned} L &= 40\log_{10}1000 - 20\log_{10}2.25 \\ &= 112.96\ \text{dB} \end{aligned}$$
3. **Compare with free space.** Free space loses 91.53 dB at 1 km, so the ground costs 21.4 dB.
4. **A taller antenna.** Raising one antenna to 30 m would push the breakpoint to 540 m and recover much of it.

**Answer:** the breakpoint is at 27 m, and at 1 km the loss is 112.96 dB against 91.53 dB in free space, 21.4 dB more.
:::
:::

::: example
## A link has 10 dB more SNR than its modulation needs. How much farther could it reach in free space, and over flat ground beyond the breakpoint?

::: solution
1. **In free space.** Loss rises 20 dB per decade, so 10 dB of margin allows
   $$10^{10/20} = 3.16$$
   times the distance.
2. **Beyond the breakpoint.** Loss rises 40 dB per decade, so it allows only
   $$10^{10/40} = 1.78$$
   times.
3. **Compare.** The same margin buys much less range near the ground.

**Answer:** 3.16 times the distance in free space, but only 1.78 times over flat ground beyond the breakpoint.
:::
:::

::: check
kind: parts
given: f = 0.9 | 2.4 | 5.8; d = 10 | 100 | 1000

## A {f} GHz link spans {d} m in free space.

::: part
answer: 20*log(4*pi*d/(0.2998/f))
unit: dB
tolerance: 0.5%

### What is the path loss?

::: misses
- [any] $20\log_{10}(4\pi d/\lambda)$.
:::
:::

::: part
answer: 20*log(4*pi*2*d/(0.2998/f)) - 20*log(4*pi*d/(0.2998/f))
unit: dB
tolerance: 0.5%

### How much more is it at twice the distance?

::: misses
- [any] $20\log_{10}2$.
:::
:::
:::

::: check
kind: parts
given: P = 0 | 20 | 30; Gt = 0 | 6 | 15; Gr = 2 | 10; L = 60 | 90 | 120

## A transmitter of {P} dBm uses a {Gt} dBi antenna; the receiver's antenna has {Gr} dBi, and the path loses {L} dB.

::: part
answer: P + Gt
unit: dBm
tolerance: 0.5%

### What is the EIRP?

::: misses
- [any] $P_t + G_t$.
:::
:::

::: part
answer: P + Gt + Gr - L
unit: dBm
tolerance: 0.5%

### What power arrives?

::: misses
- [any] Add gains, subtract losses.
:::
:::
:::

::: check
kind: parts
given: B = 0.0125 | 1 | 20; NF = 2 | 6 | 10

## A receiver has a {B} MHz bandwidth and a {NF} dB noise figure.

::: part
answer: -174 + 10*log(B*1e6) + NF
unit: dBm
tolerance: 0.5%

### What is its noise floor?

::: misses
- [any] $-174 + 10\log_{10}B + NF$.
:::
:::

::: part
answer: -174 + 10*log(B*1e6) + NF + 10
unit: dBm
tolerance: 0.5%

### What signal gives it 10 dB of SNR?

::: misses
- [any] Floor plus 10 dB.
:::
:::
:::

::: check
kind: parts
given: f = 0.45 | 0.9 | 2.4; ht = 1.5 | 10 | 30; hr = 1.5 | 2

## Antennas at {ht} m and {hr} m over flat ground, at {f} GHz.

::: part
answer: 4*ht*hr/(0.2998/f)
unit: m
tolerance: 0.5%

### Where is the two-ray breakpoint?

::: misses
- [any] $4h_th_r/\lambda$.
:::
:::

::: part
answer: 40*log(4*4*ht*hr/(0.2998/f)) - 20*log(ht*hr)
unit: dB
tolerance: 0.5%

### What is the two-ray loss at four times that distance?

::: misses
- [any] $40\log_{10}d - 20\log_{10}(h_th_r)$.
:::
:::
:::

::: check
kind: parts
given: m = 6 | 10 | 20

## A link has {m} dB of margin.

::: part
answer: 10^(m/20)
tolerance: 0.5%

### By what factor could the distance grow in free space?

::: misses
- [10^(m/40)] That's beyond the breakpoint; free space loses 20 dB per decade.
- [any] $10^{m/20}$.
:::
:::

::: part
answer: 10^(m/40)
tolerance: 0.5%

### And where loss rises 40 dB per decade?

::: misses
- [any] $10^{m/40}$.
:::
:::
:::

::: check
kind: parts
given: f = 2.4 | 5.8; d = 100 | 1000

## A {f} GHz link is {d} m long, with an obstacle halfway.

::: part
answer: sqrt(0.2998/f*(d/2)*(d/2)/d)
unit: m
tolerance: 0.5%

### What is the first Fresnel zone's radius at the midpoint?

::: misses
- [any] $\sqrt{\lambda d_1d_2/d}$.
:::
:::

::: part
answer: 0.6*sqrt(0.2998/f*(d/2)*(d/2)/d)
unit: m
tolerance: 0.5%

### How much clearance keeps 60% of it open?

::: misses
- [any] 0.6 times the radius.
:::
:::
:::

::: check
kind: derivation
vars: d = 1..100000, l = 0.001..10

## A link spans distance d at wavelength l.

::: step
answer: 20*log(4*pi*d/l)

### What is the free-space path loss in dB?
:::

::: step
answer: 20*log(4*pi*d/l) + 20*log(2)

### What is it at twice the frequency, with the same antennas' gains?
:::

::: right
Right. Higher frequency loses 6 dB per doubling with fixed-gain antennas, though fixed-size antennas gain it back.
:::
:::

::: check
kind: python

## Write `max_distance(allowed, f, ht, hr)`: the distance in meters at which the path loss reaches `allowed` dB, using free-space loss up to the two-ray breakpoint $4h_th_r/\lambda$ and $40\log_{10}d - 20\log_{10}(h_th_r)$ beyond it.

```python starter
import math

def max_distance(allowed, f, ht, hr):
    lam = 2.998e8 / f
    return lam / (4 * math.pi) * 10 ** (allowed / 20)
```

```python solution
import math

def max_distance(allowed, f, ht, hr):
    lam = 2.998e8 / f
    db = 4 * ht * hr / lam
    if allowed <= 20 * math.log10(4 * math.pi * db / lam):
        return lam / (4 * math.pi) * 10 ** (allowed / 20)
    return 10 ** ((allowed + 20 * math.log10(ht * hr)) / 40)
```

```python tests
assert abs(max_distance(100, 0.9e9, 1.5, 1.5) - 474.34) < 0.01, f"100 dB at 900 MHz with 1.5 m antennas: 474 m, got {max_distance(100, 0.9e9, 1.5, 1.5):.2f}."
assert abs(max_distance(60, 0.9e9, 1.5, 1.5) - 26.508) < 0.001, "60 dB is reached before the breakpoint, in free space: 26.5 m."
assert abs(max_distance(120, 2.4e9, 30, 2) - 7745.97) < 0.05, "A 30 m tower to a 2 m antenna, 120 dB: 7.75 km."
```

::: right
Right. A piecewise model needs a piecewise inverse, and the breakpoint decides which piece applies.
:::
:::

::: explain
## Why does path loss grow with frequency when free space itself doesn't absorb anything?

::: model
Free space loses nothing: the power simply spreads over a sphere, and the density falls as $1/d^2$ at every frequency. The frequency dependence comes from the receiving antenna. A fixed-gain antenna's effective area is $G\lambda^2/4\pi$, so at higher frequency the same kind of antenna is smaller and catches less of the spreading power. Path loss as conventionally defined includes that, which is why it carries a $\lambda^2$. With antennas of fixed physical size instead, their gains grow as $1/\lambda^2$ at both ends, and the link actually improves with frequency, which is how dishes and phased arrays make millimeter-wave links work.
:::
:::

::: practice
::: check
given: f = 1 | 5; d = 30 | 300
answer: 20*log(4*pi*d/(0.2998/f))
unit: dB
tolerance: 0.5%

## Free-space loss at {f} GHz over {d} m?

::: misses
- [any] $20\log_{10}(4\pi d/\lambda)$.
:::
:::

::: check
given: B = 0.2 | 40; NF = 3 | 8
answer: -174 + 10*log(B*1e6) + NF
unit: dBm
tolerance: 0.5%

## Noise floor, {B} MHz, NF {NF} dB?

::: misses
- [any] $-174 + 10\log_{10}B + NF$.
:::
:::

::: check
given: f = 0.9 | 1.8; h = 5 | 20
answer: 4*h*1.5/(0.2998/f)
unit: m
tolerance: 0.5%

## Breakpoint for antennas at {h} m and 1.5 m, {f} GHz?

::: misses
- [any] $4h_th_r/\lambda$.
:::
:::
:::
