// HACKER NEWS — CYBERSECURITY
Simulating Airband Am Radios
In a slight departure from my usual code monkey content,
let’s talk about airplanes! And radios!
For the last several years, I’ve spent most Saturdays playing (and occasionally working on)
BMS, a modern1 combat flight sim where you
and your friends blow stuff up in virtual F-16s.
Any co-op game with over 30 people is a blast,
but air combat is especially fun because it’s such a team sport.
Flights swirl in vicious dogfights and
play deadly games of whack-a-mole
with enemy air defenses, all just to give a few jets a couple of seconds over the target
to drop their bombs.
None of it is scripted, and everyone has to work together to come back alive.
You might imagine this involves a lot of talking,
and so BMS ships with a voice chat app called IVC.
To add to the immersion, it simulates the radios in your virtual cockpit.
You don’t join a chat room, you tune to a radio frequency.
Your signal fades as your jet gets further from whoever you’re talking to,
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
that operate in the VHF
and UHF bands.
One of the reasons that’s persisted through decades of technological advances is that
AM radio doesn’t have a “capture effect”.
When two people transmit on the same frequency, you can still (sorta) hear both parties,
unlike FM where the louder signal mutes or “captures” the quieter one.
Here’s what it sounds like when fighter pilots talk over each other,
captured during a Red Flag training exercise
in Nevada:
So imagine my… curiosity when IVC just makes this sound whenever people step on each other:
That bugs me more than it should.
So when a buddy set out to build
an IVC replacement with better UX
and modern audio codecs,
I wanted to contribute some realistic AM radio dynamics.
Like these:
So you want to talk to someone over the radio.
Let’s set aside the black magic of antenna design—take it as a given
that if you cut the right length of wire and wiggle the electrons in it,
some of them will magically shear off into space as electromagnetic waves.
Even if those waves don’t run into anything,2 they get weaker as a square of radius rrr
from the transmitting antenna, simply because they spread out as they travel.
This is true of all waves—sound, radio, light.3
And because different distances from the source produce such wildly different power levels,
our senses need to work on logarithmic scales.
They’re actually pretty astonishing—the roar of a jet engine is a million times louder
than the quietest whisper, and you can hear both.
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.
Because it would be annoying to work with such a wide range of numbers,
we often describe signal strength in a logarithmic scale called
decibels, abbreviated as dB.
One of the first things we’d like to describe in decibels is the signal-to-noise ratio, or SNR.
Some noise is man-made, some comes from atmospheric events like thunderstorms,
and some comes from outer space.
More noise comes from the imperfections in your radio’s electrical components.
And even if you could somehow remove all of those noises,
you’d still hear thermal energy vibrating the electrons in your receiver.
(We call this phenomenon thermal noise
and it’s our theoretical minimum.)