Inside the device

How your voice becomes numbers, 8,000 times a second

Pulse code modulation, or PCM, is how a phone turns your voice into numbers. The phone's sound chip measures the current from its microphone 8,000 times a second, rounds each measurement to one of 256 steps and writes it down as 8 bits, which makes 64,000 bits a second. An internet phone then sends the numbers in packets, and the phone at the other end turns them back into sound.

Inside your phone's sound chip2 thousandths of a second+1270-127StepsMeasurement+86110101108 bitsFinn00:12160numbersYou00:12
Try it
Purple: your voiceKey
  • Purple: your voice

A call with Finn · 8,000 measurements a second

Press Speak, then try HD voice or speak softly.Tap Speak, then try HD voice or speak softly.

Anatomy of digital voice: two thousandths of a second of your voice inside a phone's sound chip, much enlarged, between your mobile and Finn's. The drawing is not to scale and shows only a few of the steps.

  1. Follow one call

    Press Play to watch the call, or scroll down and the drawing follows you one step at a time. Try it, under the drawing, makes your own call.Press Play to watch the call, or Next to go one step at a time. Try it, under the drawing, makes your own call.

  2. Step 1 of 6

    You speak into your phone

    Your voice pushes the air in small waves, hundreds of times a second. The microphone in your phone turns them into an electric current that rises and falls with your voice. On the panel, the purple line is that current over two thousandths of a second. The rail in the middle is silence.

    Why not send the current itself?

    For most of the 20th century, phone lines did. They carried a copy of the current from end to end, every stretch of wire added a little noise, and every amplifier made the noise louder along with your voice.

    In 1938, Alec Reeves, an engineer in Paris, filed a patent for another way: send numbers instead of the wave. His aim was speech practically free from any background noise. A number arrives or it does not, and noise on the line does not change it.

    Sources: US patent 2,272,070: Reeves, Electric signaling system (1942)

  3. Step 2 of 6

    The chip measures it 8,000 times a second

    Your phone's sound chip measures the current at regular moments: 8,000 times a second, one measurement every 125 millionths of a second. Each copper rod is one measurement, as tall as the current at that moment. Between two rods, the chip measures nothing. This is sampling, and 8,000 a second is the phone's sampling rate.

    Why 8,000, and is that enough?

    In 1949, the mathematician Claude Shannon proved that a wave with no note higher than a given frequency is completely determined by measurements taken at twice that frequency. Measure more than twice as often as the highest note, and nothing is lost.

    A phone line carries sounds from 300 to 3,400 hertz, the band ITU-T sets for a phone channel. 8,000 measurements a second cover notes up to 4,000 hertz, a margin above the band. A filter takes the higher sounds out first: a tone above 4,600 hertz must come out at least 25 decibels weaker, or it would come back as a false, lower note.

    Sources: Proceedings of the IRE: Shannon, Communication in the presence of noise (1949); ITU-T G.712: transmission performance characteristics of pulse code modulation channels (2001); ITU-T G.711: pulse code modulation of voice frequencies (1988)

  4. Step 3 of 6

    Each measurement is rounded to a step

    The chip cannot write down every height. It rounds each measurement to the nearest of 256 steps, 128 above the rail and 128 below, and the rods move to their steps. Engineers call this rounding quantization. The steps sit close together near silence and further apart for loud sounds, so a quiet voice loses as little to the rounding as a loud one.

    Why are the steps not evenly spaced?

    Even steps would spend most of them on loud sounds. On the Bell System's first digital phone lines, the loudest sound a channel handled was about 1,000 times stronger than the quietest, and a compressor squeezed that range into far fewer levels, in an almost logarithmic relationship.

    A phone's codec, its set of rules for turning sound into numbers, does the same. ITU-T G.711, the codec phones have used since 1972, uses one of two rules, the A-law or the μ-law. Countries chose one or the other. Between two countries that chose differently, the line carries the A-law, and the μ-law country converts.

    Sources: Bell System Technical Journal: the T1 carrier system (1965); ITU-T G.711: pulse code modulation of voice frequencies (1988)

  5. Step 4 of 6

    Each step becomes 8 bits

    Each step has a number, 0 to 127 above the rail or 0 to 127 below it, and the chip writes it down in 8 bits, ones and zeros. The first bit says above or below the rail, the other seven say how far. The display reads out the fourth rod: step +86. 8 bits, 8,000 times a second, make 64,000 bits a second.

    How much is that?

    A minute of your voice is 480,000 bytes, about half a megabyte, in each direction. The same 64,000 bits a second have been the rate of a phone channel since ITU-T G.711 in 1972.

    The first digital phone lines, the Bell System's T1 from 1962, used 7 bits per measurement at the same 8,000 a second, and carried 24 calls at once over pairs of copper wires.

    Sources: ITU-T G.711: pulse code modulation of voice frequencies (1988); Bell System Technical Journal: the T1 carrier system (1965)

  6. Step 5 of 6

    160 numbers go into a packet

    A phone on the internet does not send each number on its own. Every 20 thousandths of a second, it puts the last 160 numbers into one packet, labels it with Finn's address and sends it. That makes 50 packets a second in each direction.

    Why not send each number on its own?

    Every packet needs labels: where it goes, where it fits in the call and when its sound was recorded. Sent one by one, the labels would weigh more than your voice. The IETF's profile for sound over the internet sets 20 milliseconds of sound per packet by default, so with G.711 each packet carries 160 bytes of voice.

    Longer packets would spend less on labels, but the same profile warns that they add delay and make a lost packet more noticeable.

    Sources: IETF RFC 3551: RTP profile for audio and video conferences (2003); IETF RFC 3550: RTP, a transport protocol for real-time applications (2003)

  7. Step 6 of 6

    Finn's phone turns the numbers back into sound

    Finn's phone reads the numbers in order and sets each one back to its height, 8,000 times a second. Then it smooths the steps into a wave, the wave drives the earpiece, and Finn hears you. The new wave is close to yours but not the same: the rounding leaves small errors behind, a faint noise that engineers call quantization noise.

    Why does HD voice sound clearer?

    It measures twice as often. ITU-T G.722, from 1988, takes 16,000 measurements a second and carries sounds from 50 to 7,000 hertz, against 300 to 3,400 on a phone line, in the same 64,000 bits a second. To fit, it splits the sound into a low and a high band and writes down only how each measurement differs from what it expected, which takes fewer bits. A 20-millisecond packet then holds 320 measurements in the same 160 bytes. Press HD voice under the drawing to see the extra rods.

    Apps can go further. Opus, the IETF's codec from 2012, measures up to 48,000 times a second for music, but never codes sound above 20,000 hertz, the generally accepted upper limit of human hearing.

    Sources: ITU-T G.722: 7 kHz audio coding within 64 kbit/s (1988); IETF RFC 3551: RTP profile for audio and video conferences (2003); IETF RFC 6716: definition of the Opus audio codec (2012); Bell System Technical Journal: the T1 carrier system (1965)

How many measurements a second

A codec is the set of rules a phone uses to turn sound into numbers and back. It needs at least two measurements for each wave of a sound, so the highest note it carries is a little under half its rate. The more measurements a second, the higher the notes that get through.

Measurements a second, by codec

  • Phone lineITU-T G.711, 1972: sounds from 300 to 3,400 hertz

    8,000
  • HD voiceITU-T G.722, 1988: sounds from 50 to 7,000 hertz

    16,000
  • Opus, full bandIETF, 2012: sounds up to 20,000 hertz

    48,000

300 to 3,400 hertz is the band ITU-T sets for a phone channel. Twice the highest note is Shannon's rule from 1949.

ITU-T G.711; ITU-T G.722; IETF RFC 6716; ITU-T G.712

How it came to be

  1. 1938

    Numbers instead of a wave

    Alec Reeves, an engineer in Paris, files a patent in France for pulse code modulation. The idea is to measure the wave at set moments, round each measurement to the nearest of a fixed set of values and send it as a code, so that speech arrives practically free from any background noise.

    US patent 2,272,070: Reeves, Electric signaling system (1942)

  2. 1949

    Twice the highest note

    Claude Shannon publishes the proof that a wave is completely determined by measurements taken at twice its highest frequency. Harry Nyquist had pointed to the same number in 1928.

    Proceedings of the IRE: Shannon, Communication in the presence of noise (1949)

  3. 1962

    The first digital phone lines

    Western Electric begins to make T1 for the Bell System. One line carries 24 calls, each measured 8,000 times a second, each measurement in 7 bits.

    Bell System Technical Journal: the T1 carrier system (1965)

  4. 1972

    One codec for the world's phones

    The ITU sets G.711 in Geneva: 8,000 measurements a second and 8 bits each, by the A-law or the μ-law.

    ITU-T G.711: pulse code modulation of voice frequencies (1988)

  5. 1988

    HD voice

    The ITU sets G.722 in Melbourne: 16,000 measurements a second, for sounds from 50 to 7,000 hertz, in the same 64,000 bits a second.

    ITU-T G.722: 7 kHz audio coding within 64 kbit/s (1988)

  6. 2012

    A codec for the internet

    The IETF publishes Opus, a codec for internet calls and music that runs from 8,000 to 48,000 measurements a second.

    IETF RFC 6716: definition of the Opus audio codec (2012)

Where Voxbi fits

Voxbi, a cloud phone system hosted in the European Union, uses HD codecs in its apps, so calls over Wi-Fi, 4G or 5G carry more of your voice.

See it in Voxbi

Keep exploring