模拟航空波段业余无线电
Simulating Airband AM Radios

原始链接: https://bitbashing.io/am-radio.html

作为飞行模拟游戏《BMS》的爱好者,作者描述了他为打造更具现实感的语音聊天系统所做的努力,旨在模拟军用调幅(AM)无线电的细微特征。与调频(FM)不同,调幅无线电不会“捕捉”更强的信号,因此多个发射源可以同时被听到。然而,这会产生一种独特的、常令人感到刺耳的干扰——即由频率漂移和多普勒效应引起的“拍频”。 为了在数字层面重现这一效果,作者阐述了无线电的基本物理与工程原理: * **信号传输:** 无线电波会随距离衰减,因此需要使用对数尺度(分贝)来衡量信噪比(SNR)。 * **滤波:** 模拟电路利用电容和电阻来分离特定频率,并“抑制”(squelch)背景噪声。 * **信号处理:** 需要自动增益控制(AGC)系统来归一化音量,并使用“包络检波器”将信号解调为可听声音。 通过将这些模拟概念转化为数字信号处理(DSP)技术(如采样率和 IQ 采样算法),作者展示了如何复制现实航空无线电中特有的点击声、爆裂声和干扰声,从而超越了传统聊天软件简单而不真实的局限。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 模拟航空波段业余无线电 ( bitbashing.io ) 24 点 由 shellpipe 3 小时前 | 隐藏 | 过往 | 收藏 | 3 条评论 帮助 outworlder 30 分钟前 | 下一条 [–] 作为一个正在学习私用飞行执照(PPL)且不得不经常摆弄静噪(以及经历过干扰他人传输和被他人干扰)的人,这篇文章太棒了。我现在能理解幕后发生的事情了。 回复 fennec-posix 34 分钟前 | 上一条 | 下一条 [–] 哇,这真的很酷。交互性使理解其背后的理论变得非常容易。(而且没错,当两个电台同时说话时,默认的 BMS 杂音真是令人痛苦!) 回复 ThePowerOfFuet 1 小时前 | 上一条 [–] 太棒了!感谢提交。 回复 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

Warning: Contains many annoying sounds.


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 modern 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.

IVC screenshot

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:

How? Let’s dive in.

Radio 101: path loss, decibels, SNR

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, they get weaker as a square of radius rr from the transmitting antenna, simply because they spread out as they travel.

Inverse Square Law
Waves emanating from some source S spread out as they travel.
(Wikipedia)

This is true of all waves—sound, radio, light. 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.

Decibels are always a unitless ratio between two values, where 0 dB means "equal", and every ±3 dB roughly doubles or halves the power. 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, 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.)

But no matter where it comes from, noise is always there! We can never get rid of it; we only hope the received signal is louder than the noise by the time it reaches us.

Amplitude modulation

So what waves should you broadcast? The frequencies that make up your voice (and everything else you hear) are between 20 and 20,000 cycles per second, or Hertz. But the lower the frequency, the longer the wavelength, and good antennas are at least a quarter of the wavelength they receive. To pick up a 10 kHz signal, we’d need over 7 kilometers of wire.

Instead, let’s shift our voice onto some higher carrier frequency that we can actually transmit. A simple approach is to modulate the carrier wave’s amplitude by that of our voice. We might call this amplitude modulation, or AM for short.

Our voice is modulated onto a higher-frequency carrier by multiplying it by some modulation index k. The frequency of the carrier wave is completely unchanged.

Notice how the outlined shape of the resulting AM signal—its envelope—is a mirrored copy of our voice. Hmm…

What’s in a radio?

Glossing over how you tune your radio to different frequencies (the answer might shock you!), we have a few other problems to solve if we want to hear an AM signal:

  1. We need to filter out all the frequencies we don’t care about, passing only the band of frequencies we actually want. (Let’s call that the passband.)

  2. The signal is probably very weak by the time we get it (see above), so we need to amplify it.

  3. Lastly, we use an envelope detector to extract, or demodulate, our voice back out of the AM signal.

Filtering

How do we let some frequencies through and block others out? Let’s talk circuits 101.

In the analog world, we deal in:

  • Current (I), which represents electrons flowing through our circuit
  • Voltage (V), which represents the electric potential energy between two parts of a circuit, and
  • Resistance (R), which represents the reluctance of some part of a circuit to let current flow through it.

They can behave in unintuitive ways, but they are always proportional to each other according to Ohm’s law:

V=IRV = IR
联系我们 contact @ memedata.com