---
title: Resonance and Q
heading: How sharp a peak is, in one number
eyebrow: C4 · Lesson 6 · Resonance and Q
xp: 50
---

::: hook
Q, the quality factor, turns up everywhere a system resonates: a filter's sharpness, a bell's ring, a quartz crystal's precision, a bridge's sway. It has several equivalent meanings. In the frequency domain it's the center frequency divided by the bandwidth. In the time domain it's roughly how many cycles a struck resonator rings for. In energy terms it compares the energy stored with the energy lost each cycle. All three describe the same thing.

::: play
- A second-order band-pass, centered at $f_0$. The markers show its −3 dB edges.
- Raise Q from 1 to 20. How does the width between the markers change?
- At high Q, the peak looks symmetric on the log axis. At low Q, is it?
:::
:::

```sim plot
view: bode
x: f = 10..100k Hz log
slider: f0 = 100..10k = 1k Hz log
slider: Q = 0.5..30 = 5 log
H: (j*f/(Q*f0))/(1 - (f/f0)^2 + j*f/(Q*f0))
marker: x = f0*(sqrt(1 + 1/(4*Q^2)) - 1/(2*Q)) | label: lower edge
marker: x = f0*(sqrt(1 + 1/(4*Q^2)) + 1/(2*Q)) | label: upper edge
readout: bandwidth = f0/Q Hz
readout: ring time constant in cycles = Q/pi
```

::: predict
## A guitar string rings at 220 Hz with Q = 1000. Roughly how long does its sound take to fade by a factor of e?

- [ ] About 5 ms
- [ ] About 0.1 s
- [x] About 1.4 s
- [ ] About 1 minute

::: reveal
About 1.4 s. The amplitude decays as $e^{-t/\tau}$ with $\tau = Q/(\pi f_0) = 1000/(\pi \times 220) \approx 1.4$ s, which is about $Q/\pi \approx 320$ cycles. A high-Q resonator is a sharp filter and a long ringer at the same time: you can't have a narrow frequency response without a long memory in time.
:::
:::

::: nameit
## Three meanings of Q

**Frequency.** For a band-pass (or the current in a series RLC circuit):

$$Q = \frac{f_0}{\Delta f}$$

with $\Delta f$ the distance between the −3 dB points. The edges sit at $f_0\left(\sqrt{1 + \frac{1}{4Q^2}} \pm \frac{1}{2Q}\right)$, which for high Q is simply $f_0 \pm \Delta f/2$.

**Time.** A resonator left to ring decays as $e^{-\alpha t}$ with $\alpha = \omega_0/(2Q)$. The amplitude falls by a factor of e in $\tau = 2Q/\omega_0 = Q/(\pi f_0)$, which is $Q/\pi$ cycles.

**Energy.**

$$Q = 2\pi\frac{\text{energy stored}}{\text{energy lost per cycle}}$$

A high Q means little is lost on each swing.

**In circuits.** For series RLC, $Q = \frac1R\sqrt{L/C}$ (C3.12). For a second-order low-pass, $|H(f_0)| = Q$, so Q above $1/\sqrt2$ means a bump in the response:

| Q | Low-pass response near $f_0$ | Step response |
|---|---|---|
| 0.5 | gentle, droops early (critically damped) | no overshoot |
| 0.707 | maximally flat (Butterworth) | 4% overshoot |
| 2 | 6 dB peak | rings for a few cycles |
| 10 | 20 dB spike | rings for many cycles |

**Typical values.** LC circuits: tens to a few hundred. Quartz crystals: $10^4$ to $10^6$. A loudspeaker in its box: around 0.7, by design.
:::


::: example
## A series RLC circuit has R = 10 Ω, L = 1 mH and C = 100 nF. Find $f_0$, Q and the bandwidth.

::: solution
1. **Resonant frequency.**
   $$\begin{aligned} f_0 &= \frac{1}{2\pi\sqrt{LC}} \\ &= 15.9\ \text{kHz} \end{aligned}$$
2. **Q.**
   $$\begin{aligned} Q &= \frac1R\sqrt{L/C} \\ &= \frac{1}{10}\sqrt{10^4} \\ &= 10 \end{aligned}$$
3. **Bandwidth.**
   $$\begin{aligned} B &= \frac{f_0}{Q} \\ &= 1.59\ \text{kHz} \end{aligned}$$

**Answer:** $f_0$ = 15.9 kHz, Q = 10 and the bandwidth is 1.59 kHz.
:::
:::

::: example
## A 32.768 kHz watch crystal has Q = 50,000. How narrow is its resonance, and how long does it ring?

::: solution
1. **Bandwidth.**
   $$\begin{aligned} B &= \frac{f_0}{Q} \\ &= 0.66\ \text{Hz} \end{aligned}$$
2. **Ringing time constant.** The ringing decays with time constant
   $$\begin{aligned} \tau &= \frac{Q}{\pi f_0} \\ &= 0.49\ \text{s} \end{aligned}$$
3. **Cycles.** That's about
   $$\frac{Q}{\pi} = 16{,}000\ \text{cycles}$$

**Answer:** the resonance is 0.66 Hz wide, and the ringing decays with a 0.49 s time constant, about 16,000 cycles.
:::
:::

::: example
## A tank stores 1 µJ and loses 6.283 nJ each cycle. What's its Q, and how many cycles does its ringing take to fall to 1/e of its amplitude?

::: solution
1. **Q from energy.** Q is 2π times the energy stored over the energy lost per cycle:
   $$\begin{aligned} Q &= 2\pi\frac{10^{-6}}{6.283 \times 10^{-9}} \\ &= 1000 \end{aligned}$$
2. **How the ringing decays.** The energy decays as $e^{-2\pi n/Q}$ after n cycles, so the amplitude decays as
   $$e^{-\pi n/Q}$$
3. **Cycles to 1/e.** The amplitude falls to 1/e after
   $$\begin{aligned} n &= \frac{Q}{\pi} \\ &= 318\ \text{cycles} \end{aligned}$$
4. **Any resonator.** The energy definition works for any resonator, mechanical or optical, where there's no R, L or C to plug into a formula.

**Answer:** Q = 1000, and the ringing takes 318 cycles to fall to 1/e.
:::
:::

::: check
given: f0 = 1 | 10 | 100; df = 0.1 | 0.5 | 2
answer: f0/df
tolerance: 0.5%

## A resonance at {f0} kHz has a −3 dB bandwidth of {df} kHz. What is its Q?

::: right
Right. $Q = f_0/\Delta f$ = {answer}.
:::

::: misses
- [df/f0] Center over width.
- [any] Not yet. $Q = f_0/\Delta f$.
:::
:::

::: check
given: f0 = 1 | 5; Q = 1 | 2 | 4
answer: f0*(sqrt(1 + 1/(4*Q^2)) - 1/(2*Q))
unit: kHz
tolerance: 0.5%

## A band-pass at {f0} kHz has Q = {Q}. Where is its lower −3 dB edge?

::: right
Right. $f_0\left(\sqrt{1 + 1/4Q^2} - 1/2Q\right)$ = {answer}.
:::

::: misses
- [f0 - f0/(2*Q)] That's the high-Q approximation; at this Q, use the exact formula.
- [f0 - f0/Q] The full bandwidth is $f_0/Q$; each edge is about half of that away.
- [any] Not yet. $f_- = f_0\left(\sqrt{1 + \frac{1}{4Q^2}} - \frac{1}{2Q}\right)$.
:::
:::

::: check
given: f0 = 100 | 440 | 1000; Q = 50 | 200 | 1000
answer: Q/(pi*f0)*1000
unit: ms
tolerance: 0.5%

## A resonator at {f0} Hz with Q = {Q} is struck. How long until its amplitude falls by a factor of e?

::: right
Right. $\tau = Q/(\pi f_0)$ = {answer}.
:::

::: misses
- [Q/f0*1000] That's Q cycles; the e-folding takes $Q/\pi$ cycles.
- [2*Q/(pi*f0)*1000] $\tau = 2Q/\omega_0 = Q/(\pi f_0)$.
- [any] Not yet. $\tau = 2Q/\omega_0$.
:::
:::

::: check
given: W = 10 | 50 | 100; L = 0.1 | 0.5 | 1
answer: 2*pi*W/L
tolerance: 0.5%

## A resonator stores {W} µJ, and loses {L} µJ each cycle. What is its Q?

::: right
Right. $2\pi \times$ stored ÷ lost per cycle = {answer}.
:::

::: misses
- [W/L] Include the 2π.
- [any] Not yet. $Q = 2\pi W/W_\text{lost}$.
:::
:::

::: check
given: Q = 2 | 5 | 10 | 20
answer: 20*log10(Q)
unit: dB
tolerance: 0.5%

## A second-order low-pass has Q = {Q}. By how many dB does its response at $f_0$ stand above its DC gain?

::: right
Right. $|H(f_0)| = Q$: {answer}.
:::

::: misses
- [Q] Convert to dB.
- [10*log10(Q)] A voltage ratio in dB is $20\log_{10}$.
- [any] Not yet. $20\log_{10}Q$.
:::
:::

::: check
kind: parts
given: E = 1 | 10; d = 1 | 10; f = 1 | 10

## A resonator at {f} MHz stores {E} µJ and loses {d} nJ each cycle.

::: part
answer: 2*pi*E*1000/d
tolerance: 0.5%

### What's its Q?

::: misses
- [E*1000/d] Q is 2π times the ratio.
- [any] $Q = 2\pi\frac{E}{\Delta E}$.
:::
:::

::: part
answer: f*1e6/(2*pi*E*1000/d)/1000
unit: kHz
tolerance: 0.5%

### What's its bandwidth?

::: misses
- [any] $\frac{f_0}{Q}$.
:::
:::
:::

::: check
kind: derivation
vars: E = 0.000000001..1, P = 0.000000001..1, w = 1000..1000000000

## A resonator at angular frequency w stores energy E and loses power P.

::: step
answer: w*E/P

### What's its Q?
:::

::: step
answer: E/P

### With what time constant does its energy decay?
:::

::: step
answer: P/E/(2*pi)

### What's its bandwidth in hertz?
:::

::: right
Right. A long-lived resonator is a narrow one: bandwidth times energy lifetime is $\frac{1}{2\pi}$.
:::
:::

::: explain
## Why does a resonator with a very narrow frequency response also ring for a long time after being struck?

::: model
Both come from how little energy the resonator loses per cycle. A narrow response means it responds strongly only near one frequency, which happens when losses are small, because then small pushes at the right frequency build up over many cycles. Small losses also mean that once excited, the stored energy drains away slowly, so the oscillation persists for many cycles. Q measures exactly that ratio of stored to lost energy, so it sets both the bandwidth, $f_0/Q$, and the ringing time, about $Q/\pi$ cycles to fall by e.
:::
:::

::: practice

::: check
given: f0 = 10 | 20; Q = 5 | 10
answer: f0/Q
unit: kHz
tolerance: 0.5%

## Bandwidth for {f0} kHz and Q = {Q}?

::: misses
- [any] $f_0/Q$.
:::
:::

::: check
given: Q = 31.4 | 62.8 | 314
answer: Q/pi
tolerance: 1%

## Roughly how many cycles does a Q = {Q} resonator ring before falling by e?

::: misses
- [Q] It's Q/π.
- [any] $Q/\pi$.
:::
:::

::: check
given: Q = 0.5 | 0.707 | 1
answer: 20*log10(Q)
unit: dB
tolerance: 1%

## Low-pass with Q = {Q}: gain at $f_0$ relative to DC, in dB?

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