---
title: "Sharing spectrum: FDMA, TDMA, CDMA and OFDM"
heading: How many users share one band by dividing it in frequency, in time or by code, the processing gain of spread spectrum, and OFDM's overlapping but orthogonal subcarriers with the cyclic prefix that protects them from echoes, worked through for Wi-Fi
eyebrow: D4 · Lesson 7 · Sharing spectrum
xp: 40
---

::: hook
Radio spectrum is shared by everyone in range, so every system must decide how its users divide it. Early phone networks gave each call its own frequency. Later ones gave each call its own time slot, or let everyone transmit at once and told them apart by code. Today's Wi-Fi and 5G split a channel into hundreds of narrow subcarriers that overlap in frequency yet don't interfere, a trick called OFDM, and hand groups of them to different users. Each scheme is an answer to the same question: how to keep many signals separable at the receiver.
:::

::: play
- The spectra of five neighboring OFDM subcarriers, each a sinc shape $\operatorname{sinc}(f/\Delta f - k)$, overlapping heavily.
- At each subcarrier's center frequency (the marker), every other subcarrier's spectrum passes through zero: they're **orthogonal**, so the receiver separates them perfectly.
- A frequency offset ε (as a fraction of the spacing) moves the sampling point off the zeros: the wanted subcarrier shrinks and its neighbors leak in.
:::

```sim plot
view: graph
x: f = -2..6
y: A = -0.3..1.1
slider: e = 0..0.5 step 0.01 = 0
plot: sinc(f) | samples: 600 | label: subcarrier 0
plot: sinc(f - 1) | samples: 600 | color: ch2 | label: subcarrier 1
plot: sinc(f - 2) | samples: 600 | color: ch3 | label: subcarrier 2
plot: sinc(f - 3) | samples: 600 | color: ch4 | label: subcarrier 3
plot: sinc(f - 4) | samples: 600 | color: ch5 | label: subcarrier 4
marker: x = 2 + e | label: receiver samples subcarrier 2 here
readout: wanted amplitude = sinc(e) | digits: 3
readout: leakage from each neighbor = abs(sinc(1 - e)) | digits: 3
```

::: predict
## 802.11a Wi-Fi splits a 20 MHz channel into 64 subcarriers. How far apart are they, and how long is each OFDM symbol before its guard interval?

- [ ] 20 MHz apart, 50 ns
- [x] 312.5 kHz apart, 3.2 µs
- [ ] 64 kHz apart, 15.6 µs
- [ ] 1 MHz apart, 1 µs

::: reveal
20 MHz/64 = 312.5 kHz, and orthogonal subcarriers need a symbol lasting exactly one over the spacing: 3.2 µs. A 0.8 µs **cyclic prefix** makes each symbol 4 µs, enough to absorb echoes whose paths differ by up to 240 m.
:::
:::

::: nameit
## Dividing by frequency, time and code

- **FDMA** gives each user a separate frequency channel, with guard bands between. The number of channels is the total bandwidth over the channel spacing.
- **TDMA** gives each user a repeating time slot on a shared channel; GSM put 8 calls on each 200 kHz carrier.
- **CDMA** lets all users transmit at once over the whole band, each multiplying its bits by a fast pseudo-random **chip** sequence. The receiver multiplies by the same sequence, which collapses the wanted signal back to its narrow bandwidth and spreads everyone else's into noise. The **processing gain** is the chip rate over the bit rate, $G_p = R_c/R_b$, which is how far below the noise a CDMA signal can be received. GPS works this way.

## OFDM

**Orthogonal frequency-division multiplexing** sends N slow symbols in parallel on subcarriers spaced $\Delta f = B/N$ apart. Each lasts $T = 1/\Delta f$, which makes the subcarriers orthogonal: over one symbol, each completes a whole number of cycles more than its neighbor, so their product averages to zero. An inverse FFT makes all N at once, and an FFT separates them.

Long symbols suffer little from echoes, and a **cyclic prefix**, a copy of each symbol's end placed before it, absorbs echoes shorter than the prefix completely, so each subcarrier needs only a one-tap equalizer. The cost is the prefix's share of the time. OFDM is sensitive to frequency offsets, which break the orthogonality.

**OFDMA** (Wi-Fi 6, 4G and 5G) gives different users different groups of subcarriers in different time slots.
:::

::: example
## What does 802.11a's fastest mode, 64-QAM with rate-3/4 coding on 48 data subcarriers, deliver?

::: solution
1. **Bits per symbol.**
   $$48 \times 6 \times 3/4 = 216\ \text{bits}$$
   in each 4 µs symbol.
2. **Data rate.**
   $$216/4\ \text{µs} = 54\ \text{Mb/s}$$
3. **Prefix cost.**
   $$0.8/4 = 20\%$$
   of the airtime.

**Answer:** it delivers 54 Mb/s.
:::
:::

::: example
## A CDMA phone system uses 1.2288 million chips per second for 9.6 kb/s voice. What's its processing gain? And with an offset of a tenth of the subcarrier spacing, how badly does OFDM suffer?

::: solution
1. **Processing gain.**
   $$1\,228\,800/9600 = 128$$
   or 21.1 dB.
2. **Wanted subcarrier.** It falls to
   $$\text{sinc}(0.1) = 0.984$$
   of its amplitude.
3. **Each neighbor.** It leaks in at
   $$|\text{sinc}(0.9)| = 0.109$$
4. **All neighbors together.** They leak in
   $$1 - \text{sinc}^2(0.1) = 3.2\%$$
   of the power, limiting the SNR to about 15 dB.

**Answer:** the processing gain is 128 (21.1 dB), and the offset limits OFDM's SNR to about 15 dB.
:::
:::

::: example
## 802.11a's subcarriers are 312.5 kHz apart, with a 0.8 µs cyclic prefix. How long is each symbol's useful part, and how much path difference can the prefix absorb?

::: solution
1. **Useful part.**
   $$1/312.5\ \text{kHz} = 3.2\ \text{µs}$$
   plus 0.8 µs of prefix for 4 µs in all.
2. **Path difference.** Echoes delayed up to 0.8 µs fall inside the prefix:
   $$0.8\ \text{µs} \times 3 \times 10^8 = 240\ \text{m}$$
3. **Effect.** Those echoes cause no interference between symbols.

**Answer:** the useful part lasts 3.2 µs, and the prefix absorbs path differences up to 240 m.
:::
:::

::: check
given: B = 5 | 20 | 80; N = 64 | 256 | 1024
answer: B*1e3/N
unit: kHz
tolerance: 0.5%

## An OFDM system divides {B} MHz into {N} subcarriers. What's the subcarrier spacing?

::: right
Right. B/N = {answer} kHz.
:::

::: misses
- [any] Not yet. Bandwidth over the number of subcarriers.
:::
:::

::: check
given: d = 15 | 78.125 | 312.5; c = 0.07 | 0.25
answer: (1 + c)*1000/d
unit: µs
tolerance: 0.5%

## OFDM subcarriers are {d} kHz apart, and the cyclic prefix adds {c} of the symbol's length. How long is each symbol with its prefix?

::: right
Right. $(1 + c)/\Delta f$ = {answer} µs.
:::

::: misses
- [1000/d] Add the prefix.
- [any] Not yet. The symbol lasts $1/\Delta f$, then add the prefix.
:::
:::

::: check
given: n = 48 | 234 | 980; b = 2 | 4 | 6; r = 0.5 | 0.75; T = 4 | 13.6
answer: n*b*r/T
unit: Mb/s
tolerance: 0.5%

## An OFDM link has {n} data subcarriers, {b} bits per subcarrier symbol, code rate {r} and a {T} µs symbol with its prefix. What's its data rate?

::: right
Right. $nbr/T$ = {answer} Mb/s.
:::

::: misses
- [n*b/T] Include the code rate.
- [any] Not yet. Bits per OFDM symbol over the symbol time.
:::
:::

::: check
given: c = 1.2288 | 3.84 | 10.23; b = 9.6 | 50 | 128
answer: 10*log(c*1e6/(b*1e3))
unit: dB
tolerance: 0.5%

## A spread-spectrum link sends {c} million chips per second for {b} kb/s of data. What's its processing gain?

::: right
Right. $10\log_{10}(R_c/R_b)$ = {answer} dB.
:::

::: misses
- [c*1e6/(b*1e3)] Express it in decibels.
- [any] Not yet. Chip rate over bit rate.
:::
:::

::: check
kind: parts
given: n = 48 | 52 | 234; k = 2 | 4 | 6; c = 0.5 | 0.75; T = 4 | 16

## An OFDM system has {n} data subcarriers, {k} bits per subcarrier, rate-{c} coding and a {T} µs symbol.

::: part
answer: n*k*c/T
unit: Mb/s
tolerance: 0.5%

### What data rate does it carry?

::: misses
- [n*k/T] Count only the information bits: multiply by the code rate.
- [any] Subcarriers × bits × rate ÷ symbol time.
:::
:::

::: part
answer: n*k*c
unit: bits
tolerance: 0.5%

### How many data bits does each symbol carry?

::: misses
- [any] Subcarriers × bits × rate.
:::
:::
:::

::: check
kind: parts
given: c = 1.2288 | 3.84; r = 9.6 | 12.2

## A CDMA system spreads {r} kb/s of voice over {c} million chips per second.

::: part
answer: c*1e6/(r*1e3)
tolerance: 0.5%

### What is the processing gain?

::: misses
- [any] Chip rate ÷ bit rate.
:::
:::

::: part
answer: 10*log(c*1e6/(r*1e3))
unit: dB
tolerance: 0.5%

### In decibels?

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

::: explain
## How can OFDM's subcarriers overlap in frequency without interfering?

::: model
Each subcarrier is a tone that lasts exactly one symbol time, and the subcarriers are spaced at exactly one over that time, so over a symbol each one completes a whole number of cycles more than its neighbor. Multiplying any two different subcarriers together and averaging over the symbol therefore gives exactly zero, which is what the receiver's FFT does when it measures each subcarrier. In the frequency domain, each subcarrier's spectrum is a sinc shape whose zeros fall precisely at every other subcarrier's center, so although the spectra overlap, each subcarrier is measured where all the others are zero. A frequency offset shifts those sampling points off the zeros and lets the neighbors leak in.
:::
:::

::: practice

::: check
given: B = 1 | 400; N = 64 | 128 | 256 | 512 | 1024 | 2048 | 4096
answer: B*1e3/N
unit: kHz
tolerance: 0.5%

## Subcarrier spacing: {B} MHz, {N} subcarriers?

::: misses
- [any] B/N.
:::
:::

::: check
given: c = 1 | 50; b = 1 | 500
answer: 10*log(c*1e6/(b*1e3))
unit: dB
tolerance: 0.5%

## Processing gain: {c} Mcps, {b} kb/s?

::: misses
- [any] $10\log(R_c/R_b)$.
:::
:::
:::
