Course home · Next: Pitch and voicing
A microphone turns your voice into a long list of numbers. That list is far too big to send over a small radio channel. A vocoder doesn’t send the sound. It sends a short description of how you’re making the sound, and the receiver rebuilds a voice from the description.
When you talk, your lungs push air past your vocal cords and out through your mouth. That makes tiny, fast changes in air pressure. A microphone measures the pressure many times a second. Each measurement is called a sample.
The top graph shows 4 seconds of a man (call sign VE9QRP) reading aloud. The bottom graphs zoom in on two 40-millisecond moments:
Keep these two pictures in mind. They are the two “ingredients” sotto uses to rebuild every sound.
sotto works with 8,000 samples per second. That is enough to capture sounds up to 4,000 Hz (half the sample rate), which covers what you need to understand speech. It’s the same quality as an old-fashioned phone call.
Each sample is stored as a 16-bit number (a whole number from −32,768 to 32,767). So the raw voice is:
8,000 samples per second × 16 bits = 128,000 bits per second
The radio sotto is designed for (a Yaesu FTM-300D, using the System Fusion digital format) has room for only a few thousand bits per second of voice. A large part of that has to be spent protecting the voice from radio noise (chapter 6). That leaves sotto’s vocoder:
2,400 bits per second
That’s 53 times smaller than the raw voice. Ordinary compression (like a ZIP file) can’t come close to that. We need to be cleverer: we need to understand how speech is made.
Imagine describing a song to a friend instead of playing it: “a man humming a low note, getting a little louder, with his mouth shaped like ‘ah’”. If your friend is a good singer, they can perform something close to it. A vocoder does exactly that, 50 times a second.
Every 20 milliseconds (one frame), sotto’s encoder measures four things and sends them in 48 bits:
| What | Question it answers | Bits |
|---|---|---|
| Voicing | Is this a buzz (vowel), a hiss (“s”), or both (“z”)? | 2 |
| Pitch | How high is the buzz? | 7 |
| Energy | How loud is it? | 5 |
| Envelope shape | What shape is the mouth making? | 34 |
50 frames per second × 48 bits = 2,400 bits per second. Exactly on budget.
The receiver’s decoder takes those 48 bits and rebuilds 20 ms of sound with a synthesizer. The full path, including the radio, is the picture on the course home page.
The rebuilt voice is not the same as the original wiggle-for-wiggle. It only has to sound similar to a listener. Some things are thrown away on purpose (for example, the exact timing of each vocal-cord pulse), and some are lost to rounding. Much of this course is about which losses people notice and which they don’t.
You can hear sotto v3.5 right now on the listening page, or in chapter 5.
sim/vocoder_lab.py: the SottoV0 class, with encode() and decode(), and the later versions built on it, up to SottoV35.docs/encoder-v0.md and docs/encoder-v1.md: the design notes (the second one covers v1 through v3.5).