Simulating Airband AM Radios
Please enable JavaScript to view equations powered by KaTeX.
In a slight departure from what I usually talk about here,<br>let’s chat about airplane radios.
For the last several years, I’ve spent most Saturdays playing (and occasionally working on)<br>BMS, a modern1 combat flight sim where you fly virtual<br>F-16s around with friends and blow stuff up.<br>Any co-op game with over 30 people is a blast,<br>but air combat is especially fun because it’s such a team sport.<br>Flights swirl in vicious dogfights and<br>play deadly games of whack-a-mole<br>with enemy air defenses, all just to give a few jets a couple of seconds over the target<br>to drop their bombs.<br>None of it is scripted, and everyone has to do their job to come back alive.
You might imagine this involves a lot of talking,<br>and so BMS ships with a voice chat app called IVC.<br>To add to the immersion, it simulates the radios in your virtual cockpit.<br>You don’t join a chat room, you tune to a radio frequency.<br>Your signal fades as your jet gets further from whoever you’re talking to,<br>or if you’re both flying low, you can be blocked by terrain entirely.
Surprisingly, airplane radios—even many military ones—are still simple AM sets<br>which transmit in the VHF<br>and UHF bands.<br>One of the reasons that’s persisted through decades of technological advances is that<br>AM radio doesn’t have a “capture effect”.<br>When two people talk over each other on the same frequency, you can still hear both parties,<br>unlike FM where the louder signal mutes or “captures” the quieter one.<br>Here’s what it sounds like when some fighter pilots talk over each other,<br>captured during a Red Flag training exercise<br>in Nevada:
So imagine my… curiosity when IVC sounds like this whenever players talk<br>on the same frequency:
That bugs me more than it should.<br>So when a buddy set out to build<br>an IVC replacement with better UX<br>and modern audio codecs,<br>I wanted to contribute some realistic AM radio dynamics.<br>Let’s dive in.
Radio 101: path loss, decibels, SNR
So you want to talk to someone over the radio.<br>Let’s set aside the black magic of antenna design—take it as a given<br>that if you cut the right length of wire and wiggle the electrons in it,<br>some of them will magically shear off into space as electromagnetic waves.<br>Even if those waves don’t run into anything,2 they get weaker as a square of radius rrr<br>from the transmitting antenna, simply because they spread out as they travel.
Waves emanating from some source S spread out as they travel.
(Wikipedia)
This is true of all waves—sound, radio, light.3<br>And because different distances from the source produce such wildly different power levels,<br>our senses need to work on logarithmic scales.<br>They’re actually pretty astonishing—the roar of a jet engine is a million times louder<br>than the quietest whisper, and you can hear both.<br>A room can be a million times darker than a sunny day, yet you can see in both.
The radio frequency (RF) world is no different.<br>Because it would be annoying to work with such a wide range of numbers,<br>we often describe signal strength in a logarithmic scale called<br>decibels, abbreviated as dB.<br>One of the first things we’d like to describe in decibels is the signal-to-noise ratio, or SNR.
SNR: 40 dB
Play
Volume
Decibels are always a unitless ratio between two values, where 0 dB means "equal",<br>and every ±3 dB roughly doubles or halves the power.<br>So when discussing SNR, 0 dB means the signal is equal in power to the noise.
Some noise is man-made, some comes from atmospheric events like thunderstorms,<br>and some comes from outer space.<br>More noise comes from the imperfections in your radio’s electrical components.<br>And even if you could somehow remove all of those noises,<br>you’d still hear thermal energy vibrating the electrons in your receiver.<br>(We call this phenomenon thermal noise<br>and it’s our theoretical minimum.)
But no matter where it comes from, noise is always there!<br>We can never get rid of it; we only hope the received signal is louder than the noise<br>by the time it reaches us.
Amplitude modulation
So what waves should you broadcast?<br>The frequencies that make up your voice (and everything else you hear) are between<br>20 and 20,000 cycles per second, or Hertz.<br>But the lower the frequency, the longer the wavelength,<br>and good antennas are at least a quarter of the wavelength they receive.<br>To pick up a 10 kHz signal, we’d need over 7 kilometers of wire.4
Instead, let’s shift our voice onto some higher carrier frequency<br>that we can actually transmit.<br>A simple approach is to modulate the carrier wave’s amplitude by that of our voice.<br>We might call this amplitude modulation, or AM for short.
modulation index:
0.90
Our voice is modulated onto a higher-frequency carrier<br>by multiplying it by some modulation index k.<br>The frequency of the carrier wave is completely unchanged.
Notice how the outlined shape of the resulting AM signal—its envelope—is a<br>mirrored copy of our voice. Hmm…
What’s in a radio?
Glossing over how you...