# Audio and Room Acoustics

*The minimum-phase / allpass decomposition is what separates the parts
of a loudspeaker or a room that can be equalised from the parts that
cannot — a direct application of Kramers–Kronig in the audio domain.*

This chapter uses the **engineering convention** `e^{+jωt}` (standard
in DSP and audio), with causal responses analytic for Re s ≥ 0 (Chapter
16). We'll mostly work in discrete time on the unit circle, using the
discrete K-K / Hilbert pair from Chapter 19.

## Loudspeaker transfer functions

An ideal moving-coil driver, modelled electromechanically with a single
resonant mode and viscous damping, has a minimum-phase transfer
function from voltage to cone acceleration: all its zeros of H(z) lie
inside the unit disk. For such a driver, the phase response is
completely determined by the magnitude response via the discrete K-K
pair

```
∠H(e^{jω}) = −(1/2π) P ∫_{−π}^{π}  ln|H(e^{jω′})| · cot((ω′ − ω)/2) dω′
```

and inverse filtering with a minimum-phase IIR equaliser simultaneously
corrects magnitude **and** phase. One EQ, both fixed — this is the
fundamental reason driver-level EQ is so effective.

Departures from minimum-phase arise when mechanical compliance and
acoustic loading introduce additional resonances whose damping
trajectories cross the unit circle in the z-plane. Woofers approaching
their excursion limit and tweeters with break-up modes above their
pass-band both exhibit measurable non-minimum-phase behaviour.

## Crossovers: where magnitude and phase part company

A multi-way loudspeaker crossover sums the outputs of two or more
drivers, each with its own frequency response. Standard analogue
crossover topologies (Butterworth, Linkwitz–Riley) are *not* minimum-
phase when considered as the system from input voltage to combined
acoustic pressure at the listening point: the summation introduces
allpass behaviour where the two drivers overlap.

A Linkwitz–Riley 4th-order crossover, for example, has **flat summed
magnitude** but **non-flat phase**, with a 360° phase rotation through
the crossover region. That phase rotation is an allpass contribution
and cannot be removed by any causal minimum-phase EQ; removing it
requires an FIR filter with sufficient latency to realise a
non-causal inverse.

## Room impulse responses

A room impulse response (RIR) from a source to a microphone in a
reverberant space is generally **non-minimum-phase**. The physical
reason is that modal interference and multi-path reflections scatter
zeros of H(z) outside the unit disk: a reflection arriving at the
microphone later than the direct sound with greater amplitude puts a
zero at |z| > 1.

Any causal stable H(z) can be factored (Chapter 19) as

```
H(z) = H_min(z) · H_ap(z)
```

where H_min is minimum-phase and carries all the magnitude response,
and H_ap is allpass with |H_ap(e^{jω})| = 1. For a RIR:

- The **minimum-phase part** H_min is amenable to K-K reconstruction
  from magnitude alone, and is invertible with a stable causal filter.
  Room-EQ schemes that correct only the minimum-phase component give
  perceptually large improvements at modest latency.
- The **allpass part** H_ap contains the directional and reflective
  information; inverting it would require a non-causal filter or a
  delay. Any practical room correction that tries to flatten the full
  RIR must introduce latency proportional to the excess group delay of
  H_ap, typically tens of milliseconds.

This is the origin of the "listening-window vs power response" debate
in loudspeaker design — K-K reconstruction works for the axial minimum-
phase component, but the diffuse-field response and the reflections are
allpass-like and cannot be EQ-corrected universally.

## Psychoacoustics and group delay

The ear is remarkably tolerant of group-delay distortion. Blauert &
Laws (1978) established audibility thresholds for group delay:
roughly 2 ms within a critical band, rising to tens of ms across bands.
Above about 1 kHz the threshold is essentially constant at a few ms;
below 200 Hz it rises to 20–30 ms because the critical bands are
wider and the ear effectively averages across them.

Practically, this means a minimum-phase EQ for a non-minimum-phase
system — which fixes magnitude but leaves an allpass residual — is
**often inaudible** as a timing error even when the measured group-
delay ripple is 10 ms or more at bass frequencies. It is one reason
common room-EQ schemes (Dirac Live, Audyssey, ARC) succeed without
needing to tackle the allpass factor directly.

## Analytic signal and Hilbert envelope

The Hilbert transform, sibling of the K-K relation, is the workhorse of
audio envelope extraction. Given a real audio signal x(t), its analytic
signal is

```
x_a(t) = x(t) + j · ℋ[x](t)
```

The instantaneous amplitude |x_a(t)| is the Hilbert envelope, and
arg x_a(t) is the instantaneous phase. Modulation-domain analysis,
ring-modulator detection, single-sideband synthesis, and pitch-shifting
via complex demodulation all rely on a Hilbert transform (Chapter 28
covers the numerical implementation).

## Warped and Kautz filters for room modelling

Room modes cluster unevenly — densely at low frequencies, sparsely at
high — so uniform-frequency IIR modelling is inefficient. **Warped
filters** precompose the z-transform with an allpass warping map,
concentrating design resolution where the modes are. **Kautz filters**
generalise this to arbitrary pole sets matched to the modal structure
of the room: a Kautz filter with poles placed at measured mode
frequencies gives a compact, perceptually-adequate RIR model.

Both schemes preserve causality by construction — the warping or Kautz
basis is a causal allpass — and K-K enforcement on the derived modal
magnitudes reconstructs the corresponding minimum-phase part. The
**common-pole method** applies when multiple RIRs (different source or
receiver positions) share the same room modes: one set of poles, many
sets of residues.

## Summary for the practitioner

- If a driver or sub-system is minimum-phase, magnitude EQ fixes phase
  for free. Measure |H|, K-K-reconstruct phase, invert.
- If it is non-minimum-phase, decompose into H_min · H_ap. EQ H_min
  with IIR. Accept or compensate H_ap with FIR (and latency).
- Rooms are non-minimum-phase; EQ the minimum-phase part only, and
  lean on psychoacoustic tolerance of the allpass residual.
- Envelope extraction and SSB synthesis use the Hilbert transform —
  the same mathematical object as K-K, applied to audio signals rather
  than response functions.

## See also

- [19_minimum_phase_DSP.md](19_minimum_phase_DSP.md)
- [26_communications_channels.md](26_communications_channels.md)
- [28_discrete_hilbert_transform.md](28_discrete_hilbert_transform.md)

## References

- A. V. Oppenheim and R. W. Schafer, *Discrete-Time Signal Processing*,
  3rd ed., Pearson, 2010.
- H. Kuttruff, *Room Acoustics*, 6th ed., CRC Press, 2016.
- J. Blauert and P. Laws, "Group delay distortions in electroacoustical
  systems", *Journal of the Acoustical Society of America*, vol. 63,
  pp. 1478–1483, 1978.
- M. Karjalainen, P. A. A. Esquef, P. Antsalo, A. Mäkivirta,
  V. Välimäki, "Frequency-zooming ARMA modeling of resonant and
  reverberant systems", *JAES*, 2002.
