Naked Science Forum

Non Life Sciences => Technology => Topic started by: JustCool on 23/02/2018 08:16:46

Title: Why Does Changing The Speed Of Digital Audio Change The Pitch?
Post by: JustCool on 23/02/2018 08:16:46
As a music producer and former DJ, I've never been able to wrap my brain around why the pitch control on the first DJ CD players behaved the same way as the pitch control on analog turntables.

That is, DJ turntables like the Technics 1200 included a pitch slider that changed the speed of the platter. Because the grooves in vinyl are direct representations of soundwaves that vibrate the needle, causing the grooves of the record to pass under the needle at a slower rate, say, decreases both the tempo of the music and the pitch because the individual vibrations of the needle happen more slowly, ultimately reproducing a lower frequency soundwave from the speaker.

However the information stored on CDs is digital—it only consists of 1s and 0s. That binary information describes the soundwave of the music at a given moment...44100 times per second in fact. When DJ CD players appeared on the market, I was surprised to find that the sliders affected the pitch of the music—and not just the tempo—because slowing the rotation of a CD should simply cause the 1s and 0s to be read with longer spaces in between. I see how this would slow the tempo, but how could a digital representation of audio change pitch unless the numbers themselves changed?

In time, DJ CD players (and digital audio workstations) have implemented time stretching capabilities that allow the user to make the pitch remain constant while the audio is slowed or sped up. This is achieved by repeating or deleting tiny snippets of sound. I understand why that processing is necessary, but I still can't wrap my brain around the basic fact that slowing the compact disc's read rate would change the pitch of the audio!
Title: Re: Why Does Changing The Speed Of Digital Audio Change The Pitch?
Post by: Colin2B on 23/02/2018 08:51:51
It’s because what is encoded on the disc at any point is the amplitude of the signal, not it’s pitch.
So when you slow down the disc the rate of the amplitude-changes, sent to the D-A converter, is also slowed down, so the pitch is reduced in frequency.
Title: Re: Why Does Changing The Speed Of Digital Audio Change The Pitch?
Post by: evan_au on 23/02/2018 10:01:23
Quote from: JustCool
pitch control on the first DJ CD players behaved the same way as the pitch control on analog turntables.
They both work in very similar ways (if you ignore the analogue vs digital aspect), because the pitch is tied to the physical speed of the disk:
Vinyl records work by transforming sound (=rapid air pressure variation) into left & right wobbles of the needle.
- On playback, the wobbles in the disk groove are translated into rapid air pressure variations, reproducing the sound.
- If you increase (or decrease) the playback speed, the air pressure variations will occur more frequently (or less frequently), increasing (or decreasing) the pitch of the sound and the tempo of the music.
- Vinyl records use constant angular velocity (constant revolutions per minute)

CDs work by measuring the sound (=rapid air pressure variation), transforming that into 16-bit numbers recorded 44,100 times per second, which are then impressed onto a polycarbonate disk with a reflective aluminium layer.
- On playback, the 1s & 0s in the disk are translated into rapid air pressure variations, reproducing the sound.
- If you increase (or decrease) the playback speed, these 16-bit numbers will occur more frequently (or less frequently), be assembled into measures of sound pressure more frequently (or less frequently), increasing (or decreasing) the pitch of the sound and the tempo of the music.
- The pitch is implicitly recorded in the rate that the samples are recorded
- CDs use constant linear velocity (constant samples per second)

Quote
how could a digital representation of audio change pitch unless the numbers themselves changed?
If the numbers changed (eg doubling every number), the pitch would remain the same, but the volume would increase.

To increase the pitch, you need to play back the numbers more often.

Quote
make the pitch remain constant while the audio is slowed or sped up
My MP3 podcast player is able to do this, but this is because MP3s represent sound in an entirely different way than CDs.

MP3 encoding measures the primary sound frequencies present in a piece of sound, and records information like:
- This sample of sound lasts for (say) 5ms
- It consists of 440Hz at -10dB
- and 880Hz at -15dB

If the player plays these two tones for only 2.5ms, the tempo will be sped up by a factor of 2, but the pitch will remain unchanged.

On the other hand, the player could play each tone at twice the frequency, but for a full 5ms. This changes the pitch but not the tempo.

This is simpler with MP3 because the pitch and duration (and amplitude) are recorded separately, and can be changed independently.
Title: Re: Why Does Changing The Speed Of Digital Audio Change The Pitch?
Post by: wolfekeeper on 23/02/2018 17:24:38
The pitch of a sound is entirely determined by how far apart in time the peaks are in the soundwave. When you play a sound faster, the peaks become closer together and the pitch goes up. When you play a sound slower, they're further apart, and the pitch goes down. And that's true whether you do it digitally or with analogue tapes or with vinyl.
Title: Re: Why Does Changing The Speed Of Digital Audio Change The Pitch?
Post by: alancalverd on 24/02/2018 00:40:11
Whilst you can deliberately modulate the frequency of pulses coming from the CD/DVD deck by altering the speed of rotation, most "civilian" players (as distinct from studio machines) incorporate a buffer to compensate for wow and flutter caused by unintended speed variations or track eccentricity.

The system is basically a linear stack that reads in at whatever frequency the bits are generated, and reads out at the other end of the stack at exactly 44100 bits/second. You can do all sorts of manipulations to feed back a read speed control signal or skip bits to prevent stack overflow or underflow.