---
title: Noise spectra and detecting signals
heading: Spectrum level and band level, octave and third-octave bands, adding band levels, detection as a choice between two overlapping distributions, the detectability index and receiver operating characteristics, and the detection thresholds of correlation and energy detectors
eyebrow: S16 · Lesson 31 · Noise spectra and detecting signals
xp: 50
---

::: hook
A sonar operator listens for a faint propeller in the roar of the sea; a technician listens for a bearing's whine in a factory; your ear picks out a voice at a party. Each is the same problem: decide whether a signal is present in noise, accepting some chance of missing it and some chance of a false alarm. How much signal does detection take, and why does knowing exactly what you're listening for help so much?
:::

::: play
- The detector's output with noise alone and with signal plus noise are two bell curves one detectability index d′ apart (in units of their spread). Any threshold trades false alarms for detections.
- The curve is the receiver operating characteristic (ROC): probability of detection against probability of false alarm as the threshold sweeps. The dot is the operating point at the threshold you set.
- Larger d′ bows the curve toward the top-left corner, where detection is near certain with few false alarms. At d′ = 0 the curve is the diagonal: guessing.
:::

```sim plot
view: complex
range: 1.1
axes: false alarm, detection
slider: d = 0..4 = 2
slider: x = -2..5 = 2.05
curve: Q(u) + j*Q(u - d) | over: u = -6..8 | label: ROC
curve: u + j*u | over: u = 0..1 | dashed | color: ch3 | label: chance
dot: Q(x) + j*Q(x - d) | label: operating point
readout: false-alarm probability = Q(x) | digits: 3
readout: detection probability = Q(x - d) | digits: 3
```

::: predict
## A noise has a pressure spectrum level of 40 dB (re 20 µPa in 1 Hz), flat with frequency. What's its level in the octave band centered on 1 kHz?

- [ ] 40 dB
- [ ] 43 dB
- [x] 68.5 dB
- [ ] 70 dB

::: reveal
The octave band at 1 kHz runs from 707 to 1414 Hz, 707 Hz wide. Each hertz contributes the same power, so the band level is 40 + 10 log 707 = 68.5 dB. A band level is always a spectrum level plus ten times the log of the bandwidth.
:::
:::

::: nameit
## Spectrum level and band level

For a noise, the intensity is spread over frequency with a spectral density 𝓘 (watts per square meter per hertz). Its decibel measure in a 1 Hz band is the **intensity spectrum level** ISL, or in pressure terms the **pressure spectrum level** PSL. Over a band of width w where the spectrum is flat,

$$\text{SPL}_\text{band} = \text{PSL} + 10\log w$$

Analyzers use constant-bandwidth filters or proportional bands with a fixed ratio of edge frequencies: **octave bands** ($f_2/f_1 = 2$) and **third-octave bands** ($f_2/f_1 = 2^{1/3}$), centered at the geometric mean $f_c = \sqrt{f_1f_2}$. An octave band is $f_c/\sqrt2 = 0.707f_c$ wide, a third-octave band $0.232f_c$. Band levels combine by adding intensities: $L = 10\log\sum 10^{L_i/10}$.

## Detection as a decision

Each observation produces a number, and the detector compares it with a threshold. With noise alone the number is spread around one mean; with a signal present, around a higher mean. For Gaussian spreads of equal width σ, the separation in units of σ is the **detectability index** d′. A threshold x (in units of σ above the noise mean) gives

$$P(\text{FA}) = Q(x), \qquad P(\text{D}) = Q(x - d')$$

The **receiver operating characteristic** plots P(D) against P(FA) as the threshold moves. A system specified by both probabilities, such as P(D) = 0.5 at P(FA) = 0.02, needs a particular d′, here about 2.

## Detection thresholds

The **detection threshold** is the signal-to-noise ratio, in the receiver's bandwidth w, needed to reach the required d′ after processing for a time τ:

- **Correlation detection**, for a signal known exactly, cross-correlates the input with a copy: $d'^2 = 2w\tau\,S/N$, so DT = $10\log\left(d'^2/2w\tau\right)$.
- **Energy (square-law) detection**, for a signal of unknown form, measures power: $d' = \sqrt{w\tau}\,S/N$ (for S/N ≪ 1 and wτ ≫ 1), so DT = $5\log\left(d'^2/w\tau\right)$.

Both improve with a longer look and a wider band, but the correlator improves twice as fast in decibels, because it adds signal coherently. The sonar equations of lesson 43 use DT as their pass mark.
:::

::: example
## A flat noise has a PSL of 40 dB. Find its octave-band and third-octave-band levels at 1 kHz, and the total of three bands at 65, 68 and 62 dB.

::: solution
1. **Octave band.**
   $$\begin{aligned} w &= 1000/\sqrt{2} \\ &= 707\ \text{Hz} \\ L &= 40 + 28.5 \\ &= 68.5\ \text{dB} \end{aligned}$$
2. **Third-octave band.**
   $$\begin{aligned} w &= 0.232 \times 1000 \\ &= 232\ \text{Hz} \\ L &= 40 + 23.6 \\ &= 63.6\ \text{dB} \end{aligned}$$
   4.8 dB lower because it's about a third as wide.
3. **Three bands.** They add by intensity:
   $$\begin{aligned} L &= 10\log(10^{6.5} + 10^{6.8} \\ &\qquad + 10^{6.2}) \\ &= 70.4\ \text{dB} \end{aligned}$$
   only 2.4 dB above the loudest band.

**Answer:** 68.5 dB in the octave band and 63.6 dB in the third-octave band, and the three bands total 70.4 dB.
:::
:::

::: example
## A listener must detect a tone with d′ = 2 through a 100 Hz-wide channel, observing for 0.5 s. What signal-to-noise ratio does an energy detector need, and what would a correlator need?

::: solution
1. **Energy detector.** For square-law detection:
   $$\begin{aligned} \text{DT} &= 5\log\frac{2^2}{100 \times 0.5} \\ &= 5\log 0.08 \\ &= -5.5\ \text{dB} \end{aligned}$$
   The signal power can be 0.28 of the noise power in the band.
2. **Against the spectrum level.** Since the band level is the PSL plus 20 dB here, the tone must be
   $$20 - 5.5 = 14.5\ \text{dB}$$
   above the noise's spectrum level.
3. **Correlator.** A correlator, which knows the signal's waveform, needs
   $$\begin{aligned} \text{DT} &= 10\log(4/100) \\ &= -14\ \text{dB} \end{aligned}$$
   8.5 dB less.
4. **Why sonars correlate.** That's Kinsler's example; it's why active sonars, which know the pulse they sent, correlate against it.

**Answer:** an energy detector needs a signal-to-noise ratio of −5.5 dB in the band (14.5 dB above the spectrum level), and a correlator needs −14 dB.
:::
:::

::: example
## A noise spectrum is estimated by averaging 16 independent periodograms. How uncertain is each band's level, roughly at 95% confidence?

::: solution
1. **One periodogram.** A single periodogram's estimate at each frequency has a standard deviation equal to its mean (it's exponentially distributed).
2. **Average 16.** Averaging K independent ones divides that by √K:
   $$\begin{aligned} \sigma/\mu &= 1/\sqrt{16} \\ &= 25\% \end{aligned}$$
3. **Confidence interval.** Two standard deviations either side, 1 ± 0.5 in power, is
   $$\begin{aligned} 10\log 1.5 &= +1.8\ \text{dB} \\ 10\log 0.5 &= -3.0\ \text{dB} \end{aligned}$$
4. **The trade.** Halving the uncertainty needs four times as many averages, so analyzers trade measurement time for confidence, the same trade as an energy detector's.

**Answer:** each band's level is uncertain by roughly +1.8 dB and −3.0 dB.
:::
:::

::: check
given: P = 20 | 35 | 50; f = 250 | 1000 | 4000
answer: P + 10*log(f/sqrt(2))
unit: dB
tolerance: 0.1%

## A flat noise has a pressure spectrum level of {P} dB. What's its level in the octave band centered at {f} Hz?

::: right
Right. Bandwidth $f_c/\sqrt2$, so {answer} dB.
:::

::: misses
- [P + 10*log(f)] The bandwidth is $f_c/\sqrt2$, not $f_c$.
- [P + 10*log(f/2)] The octave band runs from $f_c/\sqrt2$ to $\sqrt2 f_c$.
- [any] Not yet. Band level = PSL + 10 log w.
:::
:::

::: check
given: f = 125 | 500 | 2000 | 8000
answer: f*(2^(1/6) - 2^(-1/6))
unit: Hz
tolerance: 0.5%

## How wide is the third-octave band centered at {f} Hz?

::: right
Right. From $f_c 2^{-1/6}$ to $f_c 2^{1/6}$: {answer} Hz.
:::

::: misses
- [f/3] A third-octave band's edges are a factor of $2^{1/3}$ apart, centered geometrically.
- [any] Not yet. The edges are $f_c\,2^{\pm 1/6}$.
:::
:::

::: check
given: a = 60 | 70; b = 63 | 66 | 70; c = 58 | 65
answer: 10*log(10^(a/10) + 10^(b/10) + 10^(c/10))
unit: dB
tolerance: 0.1%

## Three bands measure {a}, {b} and {c} dB. What's the overall level?

::: right
Right. Add intensities: {answer} dB.
:::

::: misses
- [a + b + c] Decibels don't add; intensities do.
- [any] Not yet. $10\log\sum 10^{L/10}$.
:::
:::

::: check
given: x = 1.5 | 2 | 2.5; d = 1 | 2 | 3
answer: Q(x - d)
tolerance: 0.5%

## A detector's threshold sits {x}σ above the noise mean, and the signal shifts the mean by d′ = {d}. What's the probability of detection?

::: right
Right. $Q(x - d')$ = {answer}.
:::

::: misses
- [Q(x)] That's the false-alarm probability.
- [Q(x + d)] The signal moves the distribution up, toward the threshold.
- [any] Not yet. Measure the threshold from the signal-plus-noise mean.
:::
:::

::: check
given: d = 1.5 | 2 | 3; w = 50 | 100 | 500; t = 0.1 | 0.5 | 2
answer: 5*log(d^2/(w*t))
unit: dB
tolerance: 1%

## An energy detector needs d′ = {d} with bandwidth {w} Hz and integration time {t} s. What's its detection threshold?

::: right
Right. DT = $5\log(d'^2/w\tau)$ = {answer} dB.
:::

::: misses
- [10*log(d^2/(2*w*t))] That's for a correlator, which knows the signal's form.
- [10*log(d^2/(w*t))] Square-law detection improves at 5 dB per decade of wτ, so the factor is 5.
- [any] Not yet. DT = $5\log(d'^2/w\tau)$.
:::
:::

::: check
given: d = 1.5 | 2 | 3; w = 50 | 100 | 500; t = 0.1 | 0.5 | 2
answer: 10*log(d^2/(2*w*t))
unit: dB
tolerance: 1%

## The same task (d′ = {d}, {w} Hz, {t} s) with a correlator that knows the signal exactly. What's the detection threshold?

::: right
Right. DT = $10\log(d'^2/2w\tau)$ = {answer} dB.
:::

::: misses
- [5*log(d^2/(w*t))] That's the energy detector.
- [any] Not yet. DT = $10\log(d'^2/2w\tau)$.
:::
:::

::: check
kind: parts
given: K = 4 | 16 | 100; e = 1 | 0.5

## A spectrum estimate averages {K} independent periodograms.

::: part
answer: 10*log(1 + 2/sqrt(K))
unit: dB
tolerance: 0.5%

### How far above the true level does a two-standard-deviation error reach?

::: misses
- [10*log(1 + 1/sqrt(K))] Two standard deviations, each $1/\sqrt K$ of the mean.
- [any] $10\log(1 + 2/\sqrt K)$.
:::
:::

::: part
answer: (2/(10^(e/10) - 1))^2
unit: averages
tolerance: 0.5%

### How many averages would keep that upper error to {e} dB?

::: misses
- [any] Solve $10\log(1 + 2/\sqrt K) = e$.
:::
:::
:::

::: check
kind: derivation
vars: P = 0..80, f = 31.5..16000

## A flat noise has pressure spectrum level P dB re 1 Hz.

::: step
answer: P + 10*log(0.7071*f)

### What is its level in the octave band centered at f?
:::

::: step
answer: P + 10*log(0.2316*f)

### And in the third-octave band?
:::

::: right
Right. Wider bands collect more of a flat spectrum, 3 dB per doubling of width.
:::
:::

::: explain
## Why does a correlator need a lower signal-to-noise ratio than an energy detector, and why does both detectors' threshold fall as they listen longer?

::: model
Listening longer and over a wider band gives the detector more independent samples of the noise: about wτ of them. A correlator multiplies the input by a copy of the expected signal and adds up the products. The signal's products all have the same sign and add in amplitude, while the noise's products have random signs and add only as the square root of their number, so the output's signal-to-noise ratio grows in proportion to wτ, and d′² ∝ 2wτ S/N. An energy detector doesn't know the waveform, so it squares the input and averages. The signal then raises the average power only slightly, and averaging reduces the power's fluctuation as $1/\sqrt{w\tau}$, so d′ grows only as $\sqrt{w\tau}$ times S/N. In decibels the correlator's threshold falls 10 dB per decade of wτ and the energy detector's only 5.
:::
:::

::: practice

::: check
given: P = 0..60; f = 63..8000
answer: P + 10*log(f/sqrt(2))
unit: dB
tolerance: 0.1%

## Octave-band level: PSL {P} dB at {f} Hz?

::: misses
- [any] PSL + 10 log($f_c/\sqrt2$).
:::
:::

::: check
given: d = 0.5..4; w = 10..1000; t = 0.05..10
answer: 5*log(d^2/(w*t))
unit: dB
tolerance: 1%

## Energy-detector DT: d′ = {d}, w = {w} Hz, τ = {t} s?

::: misses
- [any] $5\log(d'^2/w\tau)$.
:::
:::

::: check
given: x = 0..4; d = 0..4
answer: Q(x - d)
tolerance: 0.5%

## P(D) with threshold {x}σ and d′ = {d}?

::: misses
- [any] $Q(x - d')$.
:::
:::
:::
