import matplotlib
if not hasattr(matplotlib.RcParams, "_get"):
matplotlib.RcParams._get = dict.get
15.1 Psychoacoustics#
Acoustics concerns the physics of sound in the natural world. Psychoacoustics concerns our perception of sound. How does our perception relate to the physics? Let’s start with two dimensions that we have studied closely: frequency and amplitude. Our perceptions of pitch and loudness are roughly proportional to the logarithms of their physical counterparts:
These logarithmic relationships are not limited to hearing. They are a common phenomenon across our senses, for example, our perception of the brightness of light and the heaviness of weights.
Why might this be the case? One hypothesis is that the sounds of our everyday environment are spread fairly evenly across this logarithmic space. They range from about \(20\) Hz to \(20{,}000\) Hz (three orders of magnitude) in frequency, and from about \(0\) dB SPL to \(120\) dB SPL (six orders of magnitude) in pressure. A logarithmic perception may have evolved to put all of these sounds on a level playing field. For example, here are some familiar sounds, drawn in linear units (Hertz and Pascals) and in logarithmic units (octaves and decibels):
Fig. 120 Familiar sounds in linear units (left) and logarithmic units (right). In linear units, nearly every sound is crowded near zero. In logarithmic units, they spread evenly across the range of human hearing. The placements are approximate, since each sound spans a range of frequencies and levels.#
Next, let’s take a closer look at each of these two dimensions.
Perception of amplitude#
We first studied our perception of amplitude when we introduced the decibel in Chapter 7. As a reminder, the decibel measures an amplitude \(a\) relative to a reference amplitude \(a_0\):
We will use two conventions for the reference:
dBFS (decibels relative to full scale) uses the loudest amplitude that a digital system can represent, \(a_0 = 1\) (unitless). Well-behaved digital audio has negative dBFS values.
dB SPL (sound pressure level) uses the quietest pressure that a human can perceive, \(p_0 = 20\) μPa, so \(\text{dB SPL} = 20 \log_{10}(p / p_0)\). Perceivable sounds have positive dB SPL values.
How much dynamic range do your own ears have? The test below estimates it (note: this is not a proper hearing test and is sensitive to your current listening environment). Put in your headphones and start with your volume low. First, press the \(-3\) dB and \(+3\) dB buttons until the reference tone (\(1000\) Hz) is loud, but not uncomfortable. Then, press start, and answer whether you hear each tone. Behind the scenes, the test uses a binary search to find the quietest level you can hear:
Your result depends on your ears, but also on your headphones, your volume setting, and the background noise of your room.
Perception of frequency#
The range of human hearing in frequency is roughly \(20\) Hz to \(20\) kHz. This range varies across species. For example, elephants can hear (and produce) sounds well below \(20\) Hz, dogs can hear up to about \(45\) kHz, and some bats can hear up to about \(200\) kHz.
Within this range, our perception of pitch is organized around the octave, a doubling of frequency, as we discussed in Chapter 4. How many octaves does human hearing span? If \(N\) is the number of octaves, then
Here are tones at each octave from \(20\) Hz upwards. Many headphones and laptop speakers can’t reproduce the lowest few, and many listeners (especially adults) can’t hear the highest:
Sine tones spaced by octaves, spanning the range of human hearing, at about \(-18\) dBFS.
What is the highest frequency that you can hear? The test below estimates it, again with a binary search. As before, put in your headphones, set the reference tone (\(1000\) Hz) to a comfortable level, and then answer whether you hear each tone. Avoid headphones with active noise cancellation (such as AirPods), which can unintentionally distort the test tones.
The upper limit of hearing declines with age, typically starting in our twenties. And as with the previous test, your headphones or speakers may roll off before your ears do.
Equal-loudness contours#
Psychoacoustics goes well beyond the logarithmic relationships of pitch and loudness to frequency and amplitude. For example, these dimensions also interact with one another. Two tones with the same amplitude, but different frequencies, can have very different perceived loudness.
Equal-loudness contours describe these interactions. They chart the perceived loudness of a sine tone, measured in a unit called the phon, as a function of both its frequency and its sound pressure level (in dB SPL). Each contour connects the frequency and level combinations that listeners perceive as equally loud. They were first measured by Harvey Fletcher and Wilden Munson in 1933 [FM33], and are sometimes called Fletcher-Munson curves. The contours below are from a more recent international standard [InternationalOfStandardization03]:
Fig. 121 Equal-loudness contours, following ISO 226:2003. Each curve connects the levels at which sine tones of different frequencies sound equally loud. The dashed curve is the threshold of hearing, the quietest audible level at each frequency.#
By construction, at \(1000\) Hz, the loudness in phons equals the level in dB SPL. But at other frequencies, achieving the same loudness requires a different level. For example, a \(100\) Hz tone needs about \(64\) dB SPL to sound as loud as a \(1000\) Hz tone at \(40\) dB SPL. Meanwhile, our ears are most sensitive around \(3\) to \(4\) kHz, where the contours reach their minima.
Listen for yourself. Set your volume so that the \(1000\) Hz tone at \(-20\) dBFS is comfortable, then compare the other frequencies at the same levels. Here, the reference (\(1000\) Hz at \(-20\) dBFS) stands in for \(+0\) phons, so \(1000\) Hz at \(-40\) dBFS is \(-20\) phons. Beside each tone is its approximate loudness relative to the reference, read from the contours (assuming the reference plays at a typical listening level of about \(60\) dB SPL):
Frequency |
\(-20\) dBFS |
\(-40\) dBFS |
|---|---|---|
\(1000\) Hz (reference) |
||
\(3150\) Hz |
||
\(250\) Hz |
||
\(100\) Hz |
||
\(10000\) Hz |
The \(3150\) Hz tones should sound slightly louder than the reference, while the low and high tones should sound much quieter. Notice that the effect is stronger at the quieter level, where the contours are steeper. (Your headphones also have their own frequency response, which colors this comparison.)
Important
We are more sensitive to amplitude at some frequencies than at others. As we will see later in this chapter, codecs can spend fewer bits on the frequencies where we are less sensitive.
Perception of intervals#
Another, more sophisticated psychoacoustic phenomenon is our perception of combinations of frequencies. Consider two sine tones with frequencies \(f_a < f_b\). Their interval is the ratio of their frequencies, \(\frac{f_b}{f_a}\). We encountered several intervals in Chapter 3 and Chapter 4. Depending on the interval, we perceive very different phenomena:
Harmonics (timbre): when \(\frac{f_b}{f_a} = k \in \mathbb{Z}^+\), \(f_b\) is an integer multiple of \(f_a\). The two tones tend to fuse into a single tone, with a richer timbre.
Steps: when \(\frac{f_b}{f_a} = 2^{\frac{k}{12}}\), where \(k \in \mathbb{Z}\), the two tones are \(k\) steps apart, the basic unit of pitch in Western music.
Polyphony: more generally, when \(\frac{f_b}{f_a} \notin \mathbb{Z}^+\), we tend to hear two distinct tones at once. (Most steps are a special case of polyphony.)
Beating: when the two frequencies are very close, for example, \(f_b - f_a < 10\) Hz, we hear a single tone whose loudness pulses \(f_b - f_a\) times per second. This is the same phenomenon as ring modulation, from Chapter 6.
Here are examples of each, with \(f_a = 220\) Hz. In each, we play the lower tone, then the upper tone, then both together:
Just intervals#
So far, we have studied the scenario where \(\frac{f_b}{f_a} \in \mathbb{Z}^+\) (harmonics). We haven’t discussed the more general scenario where the interval is a rational number, \(\frac{f_b}{f_a} = \frac{n}{m} \in \mathbb{Q}\), where \(n, m \in \mathbb{Z}^+\). A rational interval means that \(f_b\) completes \(n\) cycles for every \(m\) cycles of \(f_a\), so the two waves line up again every \(m\) periods of \(f_a\) (assuming \(\frac{n}{m}\) is in lowest terms).
We often write a rational interval \(\frac{n}{m}\) as \(n{:}m\). Rational intervals with small, co-prime \(n\) and \(m\) form the basis of musical harmony (not to be confused with harmonics). These are called just intervals. Several of them have names, which we list in the table below. Here are three, played with tones that have a few harmonics each (lower, upper, then both), followed by a ratio with larger \(n\) and \(m\) for contrast:
5:4 (a major third), 220 Hz and 275 Hz
3:2 (a perfect fifth), 220 Hz and 330 Hz
4:3 (a perfect fourth), 220 Hz and 293.3 Hz
16:15 (a minor second), 220 Hz and 234.7 Hz
Three just intervals above \(220\) Hz, which sound pleasant, or consonant, and a more complex ratio, which sounds rough, or dissonant.
Tuning#
In Chapter 4, we saw that the Western system of steps divides the octave into \(12\) equal steps. This system is organized around two psychoacoustic principles: (1) the equal division of the octave, and (2) the incorporation of just intervals. But these two principles are at odds. Just intervals are rational, while equal divisions of the octave are irrational, since \(2^{\frac{k}{n}}\) is irrational unless \(n\) divides \(k\). How can we reconcile them?
Definition 51 (Equal divisions of the octave)
An \(n\) equal divisions of the octave (\(n\)-EDO) tuning system divides the octave into \(n\) equal steps, each of which multiplies frequency by \(2^{\frac{1}{n}}\). So raising a frequency by \(k\) steps multiplies it by \(2^{\frac{k}{n}}\).
The idea is to pick \(n\) so that some step of the system lands close to each important just interval. We measure “close” with the relative difference between the two ratios. For example, the perfect fourth is \(\frac{4}{3} \approx 1.3333\), and \(5\) steps of 12-EDO is \(2^{\frac{5}{12}} \approx 1.3348\), a relative difference of just \(100 \cdot \frac{1.3348 - 1.3333}{1.3333} \approx +0.11\%\).
The figure below measures, for each \(n\), the mean relative difference between five important just intervals (\(6{:}5\), \(5{:}4\), \(4{:}3\), \(3{:}2\), and \(5{:}3\)) and their nearest steps in \(n\)-EDO:
Fig. 122 The mean relative difference (in percent) between the just intervals \(6{:}5\), \(5{:}4\), \(4{:}3\), \(3{:}2\), and \(5{:}3\) and the nearest steps of \(n\)-EDO.#
\(n = 12\) is a local minimum. It is not the global minimum, since larger values like \(19\) and \(31\) approximate these intervals even better. But \(12\) strikes a good balance between closely approximating important intervals and keeping the number of steps per octave small, which makes instruments practical to build and play. In particular, 12-EDO approximates the perfect fifth and fourth extremely well, within about \(0.1\%\):
Interval |
Just ratio |
Nearest 12-EDO steps |
12-EDO ratio |
Difference |
|---|---|---|---|---|
Unison |
\(1{:}1 = 1\) |
\(0\) |
\(2^{0/12} = 1\) |
\(0\%\) |
Minor third |
\(6{:}5 = 1.2\) |
\(3\) |
\(2^{3/12} \approx 1.189\) |
\(-0.90\%\) |
Major third |
\(5{:}4 = 1.25\) |
\(4\) |
\(2^{4/12} \approx 1.260\) |
\(+0.79\%\) |
Perfect fourth |
\(4{:}3 \approx 1.333\) |
\(5\) |
\(2^{5/12} \approx 1.335\) |
\(+0.11\%\) |
Perfect fifth |
\(3{:}2 = 1.5\) |
\(7\) |
\(2^{7/12} \approx 1.498\) |
\(-0.11\%\) |
Major sixth |
\(5{:}3 \approx 1.667\) |
\(9\) |
\(2^{9/12} \approx 1.682\) |
\(+0.91\%\) |
Octave |
\(2{:}1 = 2\) |
\(12\) |
\(2^{12/12} = 2\) |
\(0\%\) |
The thirds and sixth are off by nearly \(1\%\). Can you hear the difference? Below are a just major third and a 12-EDO major third, played with tones that have a few harmonics. The waveforms show just the sum of the two fundamentals. The just third repeats exactly every \(4\) periods of \(f_a\) (dashed lines), while the 12-EDO third never quite repeats:

