Categories
Learning & Teaching Music

A Painful Lesson in Sampling Rates

Van SamplenAn audio sampling rate is the frequency at which an audio signal has been captured. You can think of it like the frame rate in movies, capturing a series of photographs from which a seemingly smooth film can be generated. The sampling rate for CDs is 44.1kHz (that’s 44,100 samples per second between you and me), but other sampling rates exist 48kHz, 96Kz, 192Khz etc. It’s a contentious issue – beyond the scope of this wee post – about how high is high enough and why that may be the case but it is vital to ensure that whatever rate an audio file is recorded at, that’s the rate that it should be played back (unless you want the speed and pitch of the original recording to change of course). Essentially its like a record player and a record. A record may have been produced at 33rpm, and to ensure you hear the intended pitch and speed the record player has to spin at the same speed. Simple.

So what happens if we spin a record (or playback a digital audio file) at a higher rate than it was recorded? Well it’s pitch becomes higher and its speed increases. Play back at a slower rate and its lower in pitch and, well, slower.

What’s more, if we play a file (or record) at twice its intended rate (a 44.1kHz file at 88.2kHz), its duration is halved (of course) and its pitch goes up an octave. In contrast, a file played back at half of its recorded rate drops an octave (you can hear this used musically in loop pedals).

An octave (derived from halving or doubling a frequency) has a kind of musical equivalence. (It’s called the Law of Octave Equivalence no less), but what of other frequency relationships? Here things get a bit complicated.  Our experience of pitch is logarithmic, so that the multiplication of a frequency produces a particular musical interval. Double a frequency it goes up an octave, halve it it goes down an octave, multiply by  ≈1.059463 and the pitch goes up one (equal-tempered) semitone. This catchy number is actually the 12th root of 2, which makes sense if you think about it. Multiply it by itself 12 times and it reaches 2, because there are 12 ‘equal’ jumps between in each octave in the 12-tone equal-tempered system.

To help us understand this, let’s imagine an octave as a physical vertical object, then we can slice it into a number of equal slices (say a tower block with a number of equal storeys). Again, I say ‘equal’ because each slice is the same musical interval but that in fact means that it is the same multiplication every time (that’s the whole logarithmic thing). The convention is to divide the octave into 1200 cents. Why are they called cents if there are 1200 of them? It makes no cents HAHA – well because often the octave is divided in 12 big slices (known as semitones or half steps) and each of them has 100 cents. So 100 cents is a semitone (in the US half-step), 200 cents is a tone (whole-step), 700 cents is a perfect 5th and so on.

So how can we calculate the resulting musical interval from a dispcrepancy in sampling rates?

We use this equation.

cents = 1200 × log2 (f2 / f1)

That’s it.

So, imagine an audio file was recorded at 44.1kHz (f1) and played back at 48kHz (f2), the cents difference would be

1200 × log2 (48000 / 44100)

This comes to ≈146.7 cents, which is just shy of one and a half semitones. A no-person’s land in most musical situations, and if you were trying to play along on the guitar you could go up one fret (one semitone) and still be a quarter tone flat, but 2 frets would be over a quarter tone sharp. Most ears forgive a few cents here and there, and a keen musician can bend into a few cents more but a 46.7 (or 53.2) cent differential is about as cold sweat nightmare of a musical situation imaginable. A bass player would face the same problems, and a keyboardist would have to resort to Herbie Hancock style pitch bends, or embark on a desperate hunt for the operating manual to readjust the tuning reference. Failing that they could run away at just the right speed to allow the doppler effect to drop the pitch.

Would you like to know what it sounds and feels like? Just ask Van Halen and their audience, who suffered this exact ordeal when a backing track (or keyboard triggered sample) recorded at 44.1kHz played back at 48kHz during a live performance of ‘Jump’ – not the most obscure of their tunes. Eddie desperately tries to adjust by shifting frets but is cursed by the mathematics.

Funny or painful, you decide. The jump that EVH desperately offers at 2:02 is fraught with all the tragedy of the human condition. But at the very least, this remains an important lesson in the importance of sampling rates, logarithmic scales and their relation to musical intervals. Thanks Van Halen!

Menu Title