---
title: Cavity resonators
heading: A closed metal box rings at frequencies set by its size
eyebrow: C10 · Lesson 39 · Cavity resonators
xp: 40
---

::: hook
Close off both ends of a waveguide and the waves bounce back and forth between them. Only frequencies that fit a whole number of half-waves along every side survive, and at those the box stores energy far longer than any lumped LC circuit could, because its walls are the only loss. Cavities set the frequency of microwave oscillators, filter radar and satellite signals, measure material properties, and heat food in every kitchen.
:::

::: play
- The curves are the resonant frequencies of the lowest modes of a rectangular box a × b × d, against its length d, with b the shortest side.
- The lowest mode, TE₁₀₁, is a waveguide's TE₁₀ mode with one half-wave along d. Lengthen the box and every mode moves down.
- The readout is the TE₁₀₁ frequency at the slider's length. A 25 mm section of WR-90 rings at 8.89 GHz.
:::

```sim plot
view: graph
x: d = 10..60 mm
y: f = 0..25 GHz
slider: a = 15..40 step 0.1 = 22.86 mm
slider: b = 5..15 step 0.1 = 10.16 mm
slider: L = 10..60 step 0.5 = 25 mm
plot: 149.9*sqrt(1/a^2 + 1/d^2) | label: TE₁₀₁
plot: 149.9*sqrt(1/a^2 + 4/d^2) | label: TE₁₀₂
plot: 149.9*sqrt(4/a^2 + 1/d^2) | label: TE₂₀₁
plot: 149.9*sqrt(1/b^2 + 1/d^2) | dashed | label: TE₀₁₁
readout: TE₁₀₁ at length L, GHz = 149.9*sqrt(1/a^2 + 1/L^2) | digits: 4
```

::: predict
## A cavity rings at 8.885 GHz and its response falls to half power 0.75 MHz either side. What is its Q?

- [ ] About 12
- [ ] About 600
- [x] About 5900
- [ ] About 600,000

::: reveal
About 5900: Q = $f_0/\Delta f$ = 8.885 GHz/1.5 MHz. A lumped LC circuit at that frequency would struggle to reach 100. Copper walls lose so little that the field rings for thousands of cycles.
:::
:::

::: nameit
## Resonant frequencies

A box of sides a, b and d, with perfectly conducting walls, supports modes with m, n and p half-waves along the three sides:

$$f_{mnp} = \frac c2\sqrt{\left(\frac ma\right)^2 + \left(\frac nb\right)^2 + \left(\frac pd\right)^2}$$

(times $1/\sqrt{\varepsilon_r}$ if it's filled with a dielectric). For a box with b < a < d, the lowest is TE₁₀₁. Higher modes crowd closer together as the frequency rises: in a large box the number of modes below f grows as about $\frac{8\pi}{3}Vf^3/c^3$, counting both polarizations.

## Q

A resonator's quality factor compares the energy it stores with the energy it loses per cycle:

$$Q = \omega_0\frac{\text{energy stored}}{\text{power lost}} = \frac{f_0}{\Delta f}$$

where Δf is the full bandwidth between the half-power points. Wall losses scale with the skin depth δ, so roughly $Q \sim V/(S\delta)$: volume over surface area, divided by skin depth. Copper cavities at microwave frequencies reach Q of several thousand; superconducting ones, 10⁹ or more.

## Coupling

A cavity is used through a probe, a loop or an iris, which lets energy in and out and so adds its own loss. The **loaded Q** combines both:

$$\frac{1}{Q_L} = \frac{1}{Q_0} + \frac{1}{Q_\text{ext}}$$

At **critical coupling**, $Q_\text{ext} = Q_0$: all the incident power is absorbed at resonance and $Q_L = Q_0/2$.
:::

::: example
## Find the TE₁₀₁ frequency of a 25 mm long section of WR-90 (a = 22.86 mm, b = 10.16 mm), and the next mode above it.

::: solution
1. **TE₁₀₁ frequency.** With sizes in millimeters,
   $$\begin{aligned} f_{101} &= 149.9\sqrt{\frac{1}{22.86^2} + \frac{1}{25^2}} \\ &= 149.9\sqrt{0.001914 + 0.0016} \\ &= 149.9 \times 0.0593 \\ &= 8.885\ \text{GHz} \end{aligned}$$
2. **The next modes.** Next is TE₁₀₂ at 13.67 GHz, then TE₂₀₁ at 14.42 GHz.
3. **What that allows.** A filter or oscillator using TE₁₀₁ has clean spectrum up to 13.6 GHz.

**Answer:** TE₁₀₁ resonates at 8.885 GHz, and the next mode is TE₁₀₂ at 13.67 GHz.
:::
:::

::: example
## The same cavity, coupled critically to a waveguide, shows a loaded bandwidth of 3 MHz. What are its loaded and unloaded Q?

::: solution
1. **Loaded Q.**
   $$\begin{aligned} Q_L &= \frac{8.885\ \text{GHz}}{3\ \text{MHz}} \\ &= 2962 \end{aligned}$$
2. **Unloaded Q.** At critical coupling $Q_\text{ext} = Q_0$, so $Q_L = Q_0/2$ and
   $$Q_0 = 5923$$
   the 1.5 MHz bandwidth the cavity would have with no coupling at all.

**Answer:** $Q_L$ = 2962 and $Q_0$ = 5923.
:::
:::

::: example
## A microwave oven's cavity is 30 × 30 × 20 cm. About how many modes resonate below 2.5 GHz, and why does the oven have a turntable?

::: solution
1. **Count the modes.** The volume is 0.018 m³:
   $$\begin{aligned} N &= \frac{8\pi}{3} \times 0.018 \times \frac{(2.5 \times 10^9)^3}{c^3} \\ &= 87 \end{aligned}$$
2. **What that does.** Near 2.45 GHz many modes overlap, each with its own pattern of hot and cold spots a few centimeters apart.
3. **The turntable.** The turntable (or a stirrer fan in the roof) moves the food through those patterns so it heats evenly.

**Answer:** about 87 modes resonate below 2.5 GHz, and the turntable moves the food through their hot and cold spots.
:::
:::

::: check
kind: parts
given: a = 22.86 | 40 | 58.17; d = 20 | 30 | 50

## A rectangular cavity is a = {a} mm wide, d = {d} mm long and shallow (b < both).

::: part
answer: 149.9*sqrt(1/a^2 + 1/d^2)
unit: GHz
tolerance: 0.5%

### What is its TE₁₀₁ frequency?

::: misses
- [any] $\frac c2\sqrt{1/a^2 + 1/d^2}$.
:::
:::

::: part
answer: 149.9*sqrt(1/a^2 + 4/d^2)
unit: GHz
tolerance: 0.5%

### And TE₁₀₂?

::: misses
- [any] Two half-waves along d.
:::
:::
:::

::: check
kind: parts
given: f = 2.45 | 8.9 | 24; w = 0.5 | 2 | 10

## A cavity resonates at {f} GHz with a half-power bandwidth of {w} MHz.

::: part
answer: f*1000/w
tolerance: 0.5%

### What is its Q?

::: misses
- [any] $f_0/\Delta f$.
:::
:::

::: part
answer: f*1000/w/(2*pi*f*1e9)*1e9
unit: ns
tolerance: 0.5%

### How long does its stored energy take to fall to 1/e, $Q/\omega_0$?

::: misses
- [any] $\tau = Q/\omega_0$.
:::
:::
:::

::: check
kind: parts
given: Q0 = 2000 | 6000; Qe = 1000 | 6000 | 20000

## A cavity with unloaded Q = {Q0} is coupled with external Q = {Qe}.

::: part
answer: 1/(1/Q0 + 1/Qe)
tolerance: 0.5%

### What is its loaded Q?

::: misses
- [any] $1/Q_L = 1/Q_0 + 1/Q_\text{ext}$.
:::
:::

::: part
answer: Q0/Qe
tolerance: 0.5%

### What is the coupling coefficient $Q_0/Q_\text{ext}$ (1 is critical)?

::: misses
- [any] The ratio.
:::
:::
:::

::: check
kind: parts
given: V = 1 | 18 | 50; f = 2.45 | 5

## A {V} liter cavity is considered below {f} GHz.

::: part
answer: 8*pi/3*V*0.001*(f*1e9)^3/2.998e8^3
tolerance: 1%

### About how many modes resonate below that frequency?

::: misses
- [any] $\frac{8\pi}{3}Vf^3/c^3$, with V in cubic meters.
:::
:::

::: part
answer: 8*pi*V*0.001*(f*1e9)^2/2.998e8^3*1e6
tolerance: 1%

### About how many modes per megahertz are there near {f} GHz?

::: misses
- [any] The derivative: $8\pi Vf^2/c^3$.
:::
:::
:::

::: check
kind: parts
given: a = 22.86 | 40; d = 25 | 40; e = 2.1 | 9.8

## A cavity a = {a} mm by d = {d} mm (shallow) is filled with a dielectric of $\varepsilon_r$ = {e}.

::: part
answer: 149.9*sqrt(1/a^2 + 1/d^2)/sqrt(e)
unit: GHz
tolerance: 0.5%

### What is its TE₁₀₁ frequency now?

::: misses
- [149.9*sqrt(1/a^2 + 1/d^2)] The dielectric slows the waves by $\sqrt{\varepsilon_r}$.
- [any] The empty value over $\sqrt{\varepsilon_r}$.
:::
:::

::: part
answer: 1/sqrt(e)
tolerance: 0.5%

### By what factor did filling it scale the frequency?

::: misses
- [any] $1/\sqrt{\varepsilon_r}$.
:::
:::
:::

::: check
kind: derivation
vars: a = 0.005..0.5, d = 0.005..0.5, c = 290000000..310000000

## A box with b smallest has its lowest mode with one half-wave along a and one along d; c is the speed of light.

::: step
answer: c/2*sqrt(1/a^2 + 1/d^2)

### What is that mode's frequency?
:::

::: step
answer: c/(2*a)

### What does it approach as d grows very long?
:::

::: right
Right. A very long box is just a waveguide, and its lowest resonance approaches the TE₁₀ cutoff.
:::
:::

::: check
kind: choice

## Why does a copper cavity reach a far higher Q than a coil and capacitor at the same frequency?

- [ ] Copper has no resistance at microwave frequencies
- [x] Its fields are enclosed, so it doesn't radiate, and its current spreads over large wall areas, so the loss per unit of stored energy is tiny
- [ ] The cavity stores no magnetic energy
- [ ] Cavities resonate at lower frequencies

::: misses
- [1] Copper has resistance, concentrated in a skin depth; the cavity just spreads the current over a large area.
- [3] It stores magnetic energy too; at resonance, half and half on average.
- [4] Cavities are used precisely at high frequencies.
:::
:::

::: check
kind: python

## Write `modes_below(a, b, d, fmax)`: count the resonant modes of an empty a × b × d box below fmax, by listing every TE mode (p ≥ 1, m and n not both 0) and TM mode (m ≥ 1, n ≥ 1, p ≥ 0) with indices up to 19.

```python starter
def modes_below(a, b, d, fmax):
    return 1
```

```python solution
import math

def modes_below(a, b, d, fmax):
    c, count = 2.998e8, 0
    for m in range(20):
        for n in range(20):
            for p in range(20):
                f = c / 2 * math.sqrt((m / a) ** 2 + (n / b) ** 2 + (p / d) ** 2)
                if f == 0 or f >= fmax:
                    continue
                if p >= 1 and not (m == 0 and n == 0):
                    count += 1
                if m >= 1 and n >= 1:
                    count += 1
    return count
```

```python tests
assert modes_below(0.02286, 0.01016, 0.025, 14e9) == 2, f"WR-90 cavity below 14 GHz: TE101 and TE102, got {modes_below(0.02286, 0.01016, 0.025, 14e9)}."
assert modes_below(0.02286, 0.01016, 0.025, 16e9) == 4, "Below 16 GHz, TE201 and TE011 join them."
assert modes_below(0.3, 0.3, 0.2, 2.5e9) == 79, f"The oven cavity below 2.5 GHz: 79 modes, got {modes_below(0.3, 0.3, 0.2, 2.5e9)}."
```

::: right
Right. The oven has 79 modes below 2.5 GHz; the smooth formula's 87 is an approximation that gets better as the count grows.
:::
:::

::: explain
## Why do the resonant frequencies of a closed box depend on its size in all three directions?

::: model
Inside a closed metal box a wave reflects off every wall, so a field pattern can persist only if it fits: the tangential electric field must vanish at each wall, which requires a whole number of half-waves along each side. A mode with m, n and p half-waves along the three sides needs a wavenumber whose components are $m\pi/a$, $n\pi/b$ and $p\pi/d$, and the frequency follows from the length of that wavevector, $f = \frac{c}{2\pi}\lvert\mathbf k\rvert$. So every dimension enters, and the allowed frequencies form a discrete set that gets denser as frequency rises.
:::
:::

::: practice
::: check
given: a = 30 | 50; d = 30 | 60
answer: 149.9*sqrt(1/a^2 + 1/d^2)
unit: GHz
tolerance: 0.5%

## TE₁₀₁ of a {a} × {d} mm cavity (shallow)?

::: misses
- [any] $\frac c2\sqrt{1/a^2 + 1/d^2}$.
:::
:::

::: check
given: f = 3 | 10; w = 1 | 4
answer: f*1000/w
tolerance: 0.5%

## Q of a {f} GHz resonance {w} MHz wide?

::: misses
- [any] $f_0/\Delta f$.
:::
:::

::: check
given: Q0 = 3000 | 8000; Qe = 2000 | 8000
answer: 1/(1/Q0 + 1/Qe)
tolerance: 0.5%

## Loaded Q with $Q_0$ = {Q0}, $Q_\text{ext}$ = {Qe}?

::: misses
- [any] $1/Q_L = 1/Q_0 + 1/Q_\text{ext}$.
:::
:::
:::
