Digital Modulation
Type a message, pick a modulation scheme (ASK, FSK, BPSK, QPSK, 16-QAM, OFDM), and transmit it as audible sound. Open this same page on another device, hold its mic toward the speaker, and watch the bits come back. Every modern radio link — Wi-Fi, LTE, Bluetooth — is some flavour of what you can play with here, just at a faster clock and a higher carrier.
The idea in one minute
Digital modulation is the art of carrying bits on a continuous waveform. You start with a sine wave at some carrier frequency — here, around 4 kHz so you can actually hear it — and you change one of its three knobs (amplitude, frequency, or phase) every symbol period to encode bits. Or you do all three at once (QAM). Or you stack many narrow carriers in parallel (OFDM).
The physics is identical for radio waves at 2.4 GHz, light pulses through a fibre, or sound bouncing around your room. The DSP is identical too. So this page is a working model of every digital link in your life — just slowed down enough to look at.
Modulation scheme
ASK (on/off keying): the carrier is on for a 1, attenuated for a 0. The simplest possible scheme — literally Morse code. 1 bit per symbol.
Symbols per second on the air. Faster = more bits/sec but less time per symbol, so noise and room reflections (multipath) start eating you. The receiver must use the same rate. OFDM uses its own rate (set by FFT size + cyclic prefix) and ignores this slider.
Transmit
Use your phone’s speaker pointed at the laptop mic, or vice versa. Do not use headphones — the sound has to travel through air. Get within a foot or two for clean decoding.
Receive
Simulation · software channel
No mic, no speaker, no room. The TX waveform goes through a software channel you control: additive Gaussian noise, plus an optional delayed echo (a primitive form of multipath). Pick a scheme above, choose the channel knobs below, hit Run simulation. Drag the SNR slider to watch each scheme’s constellation collapse from clean dots into noise.
BER vs SNR · Monte Carlo sweep
For each scheme, transmit many random frames at each SNR through an AWGN-only channel and count bit errors. The result is the canonical BER–vs–SNR curve: the higher-order schemes (16-QAM) need much higher SNR to reach the same error rate as the simpler ones (BPSK), because their constellation points are packed closer together. This is the single most important plot in digital communications.
What you’re looking at, scheme by scheme
ASK (Amplitude Shift Keying). One bit per symbol — carrier on for 1, near-off for 0. You can literally hear the bits as ticks. Simple, but easily fooled by any amplitude noise (a cough, the dishwasher, distance from the speaker).
FSK (Frequency Shift Keying). Two tones, 3 kHz for 0 and 5 kHz for 1. Robust to amplitude noise — what matters is which frequency has more energy in each symbol slot. The original Bluetooth, the audio modems of the 1980s, and most low-power IoT radios are some flavour of FSK.
BPSK / QPSK (Phase Shift Keying). The carrier’s amplitude never changes; only its phase does. BPSK is 0° vs 180° (1 bit/symbol). QPSK is the four corners of a square (2 bits/symbol). On the constellation plot you should see two dots clump up for BPSK and four for QPSK — the tighter the clumps, the cleaner the channel.
16-QAM. Quadrature Amplitude Modulation: vary both amplitude and phase. 16 distinct constellation points = 4 bits per symbol. Same symbol rate as BPSK, but four times the data rate. Wi-Fi’s slowest rate is BPSK; the fastest go all the way up to 1024-QAM (10 bits/symbol).
OFDM (Orthogonal Frequency Division Multiplexing). Eight narrow BPSK sub-carriers running in parallel between 3 and 8.25 kHz. Each sub-carrier is slow (so multipath echoes are a small fraction of a symbol — multipath becomes harmless), but you have eight of them, so the aggregate rate is fast. Every modern Wi-Fi/LTE/5G/DVB system is OFDM. The constellation here shows the equalized BPSK on each sub-carrier overlaid.
How the receiver finds your message
1. Preamble chirp. Every frame starts with a 100 ms linear chirp from 1.5 to 6.5 kHz. The receiver continuously cross-correlates its mic stream against this known chirp. Chirps have a sharp autocorrelation peak (this is also why every radar uses them), so when the message arrives the correlation spikes and the receiver knows exactly where the frame starts — sample-accurate, even with reverberation. conv(chirp, chirp_rev) ≈ δ(t).
2. Pilot symbols. Right after the preamble we send a known sequence (the 13-bit Barker code for non-OFDM, or one all-ones OFDM symbol for OFDM). The receiver knows what the pilot should be, so by comparing what it received to the known pattern it can solve for the channel’s gain and phase rotation, and undo them on every following symbol. This is the same idea as Wi-Fi’s Long Training Field.
3. Demodulate. Multiply the received signal by cos(2π fc t) and −sin(2π fc t) to bring it down to baseband I/Q. Integrate over each symbol period (matched filter for a rectangular pulse). Apply the channel correction from the pilot. Map the resulting (I, Q) point to the nearest constellation point. Done.
4. Check. A CRC-8 byte at the end verifies the bits. If it fails the frame is discarded; if it passes you see the message and the running pass rate climbs.
Things to try
- Run the same message through ASK, BPSK, and 16-QAM. They take very different times to play — BPSK and 16-QAM use the same symbol rate but 16-QAM packs 4× the bits per symbol.
- Move the phone slowly away from the laptop. Watch the constellation points smear outward. ASK fails first (amplitude is the most fragile dimension), then 16-QAM (tightly packed points), then QPSK, then BPSK. FSK and OFDM are usually last to die.
- Cup your hand around the mic to dampen the room. Reflections show up as constellation spread; in real Wi-Fi this is what the cyclic prefix in OFDM is for.
- Type a known repeating message and turn on Loop transmit. Watch the bit-error rate count update in real time.
- Put two laptops side by side, both listening, both transmitting different messages on a loop. They will collide. This is why MAC protocols exist (see the MAC Protocols module).