Work through this page to find out!
You might imagine the router as the "transmitter" and your laptop or phone as the "receiver", but remember that your devices and router are constantly switching places to send and receive messages.
Tap a block to jump to that step.
Any digital content - text, photos, video or audio - is ultimately just a long string of 1s and 0s, called bits. Type your own message below, in 1s and 0s only. For reasons we'll explain shortly, the length of the message needs to be divisible by 2.
Your binary message:
Instead of sending each bit one at a time, we're going to show how your router can actually send the entire message all at once.
The first step to transmitting these binary bits is to decide how we'll encode them into a radio wave. There are three main properties of radio waves that we can adjust: amplitude (the height of the peaks representing the strength of the wave), frequency (how fast the peaks oscillate, which is 1 / period), and phase (how far the starting point of the wave is shifted left or right, measured in degrees).
Instead of sending data by just modulating one of these properties, QAM or "Quadrature Amplitude Modulation" packs several bits into a single "symbol" by adjusting both amplitude and phase (frequency will be used later on).
To visualize how this works, we can convert a wave into a special plot called a phasor where we'll represent the amplitude as the distance from the origin to the point, and the phase as the angle that the point makes with the positive x-axis. When we plot points in this way, the x-axis is called Q for "Quadrature", and the y-axis is called I for "in-phase". It's a bit easier to work with Q,I cartesian coordinates than amplitudes and phase angles, so I and Q will show up a lot from here on. Importantly, there is a single, unique Q,I point corresponding to a given phase and amplitude.
If we want to transmit 2 bits at a time, we'll divide our message up into groups of bits and assign each possible combination its own Q,I value. We can split the message into groups of 2, 4, 6, and so on. Grouping by 2s is called '4-QAM' because there are 4 possible combinations of 2 bits (00, 01, 10, and 11). Each group of bits is called a "symbol".
Here, you can choose between 4-QAM, 16-QAM, and 64-QAM and see how the grid of I,Q values changes. You'll only be able to select options that cleanly divide your message, so if you want to use 16-QAM, the length of your message needs to be divisible by 4, and if you want to use 64-QAM, it must be divisible by 6. You can choose a QAM level now and work through the rest of the page, then come back and see how changing QAM changes the results.
This is called a "constellation diagram". It shows all the possible points for a given QAM level. For 4-QAM, there will be 4 points, and so on. The points of the constellation that represent your message are highlighted in green.
Remember, each point of the constellation represents a single wave with a certain amplitude and phase. For 4-QAM, all of the amplitudes will be the same and only the phase angle will vary. The magic behind QAM is that by adjusting these two paramters, we can transmit multiple bits at the same time! But we mentioned before that there's a clever way we can send the entire message all at once. Let's keep moving forward.
To move from sending multiple bits at the same time to sending our entire message all at once, we need to use frequency in addition to amplitude and phase. The math that accomplishes that is called an IFFT or "inverse Fast Fourier Transform". This topic gets pretty complex, so we'll make simplify a bit and focus on giving you a visual, intuitive understanding.
First, we'll assign each of our QAM symbols (groups of bits) to a specific frequency. We'll choose frequencies that are all integer multiples of some base frequency. We'll explain why that's important later on. We'll call our base frequency 'f1', then 'f2' will be 2x faster than f1, 'f3' will be 3x faster than f1, and so on.
Now we'll draw each symbol as a phasor. Think of it kind of like each QAM symbol gets assigned to a different clock hand. The amplitude is the length of the hand, the phase is the starting angle, and the frequency is how fast that hand spins.
teal line = amplitude (distance from center), amber arc = phase (angle measured from the right)
To transform these frequencies into a signal that the transmitter can send to its antenna, the IFFT takes each of these clock hands and connect them end-to-end so that the f1 clock hand will start at the origin, the f2 clock hand will start at the end of f1, and so on. Then, it spins each clock hand at its own individual frequency. If there are N phasors, the IFFT will spin them for N+1 time steps, starting at 0. Click the play button below or drag the slider to see how the chain of phasors moves.
Now, like we said before, we're making some simplifications here. This is just a way to visualize the math that happens in a real IFFT circuit. The key understanding is that the IFFT lets us convert from a set of discrete frequencies to two time-varying signals. The smooth curves here are just a guide fro the eye. In reality, the FFT is a discrete operation that samples the signal at various times, represented by the bars on each curve. The only thing that actually exists after this step are the (Q, I) pairs for each time step, marked by bars and listed in the table below.
The main takeaway here is that the IFFT let's us take our N QAM symbols and combine them all into two time-varying signals that are N+1 samples long.
A DAC (Digital-to-Analog Converter) is a physical chip that turns our list of I and Q values into the smooth I(t) and Q(t) curves we actually need. It reads each number from our table and outputs an actual voltage to match it, holding that voltage steady until the next number arrives, producing a "staircase" shape (dashed line below). A smoothing filter built into the DAC then rounds off the corners of that staircase into the continuous wave (solid line).
The I(t) and Q(t) signals we've produced oscillate too slowly to broadcast efficiently or share a frequency band with other devices. Upconversion multiplies each of them onto a much faster "carrier" wave (here, a fixed rate chosen just to look clear on screen — a real WiFi carrier oscillates at 2.4, 5, or 6 billion times per second) and adds the two results together into one real signal ready for the antenna.
I(t) gets multiplied by a cosine carrier wave and Q(t) gets multiplied by a negative sine carrier wave. Those two waves are at the same frequency, but their phaseas are perfectly 90 degrees out of sync, which means that the troughs of the cosine perfectly line up with the peaks of the negative sine. That's important because it allows us to add the two signals together into a single signal in a way that the receiving device can undo later on.
This yellow signal, which is the sum of I(t)×cos(ft) and Q(t)×−sin(ft) is what's actually sent to the transmitters antenna as a time-varying voltage. The electrons in the antenna vibrate back and forth, producing self-propagating electromagnetic radio waves.
The message flies through the air in the form of radio waves. Fun fact: the 2.4 GHz frequency used by WiFi is the same frequency as microwaves. Your router won't cook you though - its waves don't carry nearly enough energy. "The channel" is the technical term for everything these waves have to pass through between the transmitter and the receiver. Lots of things can degrade the signal; the physical distance, interference microwaves, bluetooth, and other smart devices, and the receiver's own faint internal electrical noise. For now, we'll model the simplest version of this: random noise added on top of the clean transmitted signal. Drag the slider to change how much noise is added and see if the receiver can still recover the original message!
Step A — multiply by cos(wt) and -sin(wt)
The receiver multiplies the incoming signal by the very same cos and −sin waves the transmitter used. This produces our wanted I and Q signals, but with an unwanted fast ripple riding on top of it (at twice the carrier rate) that we don't want.
Step B — low-pass filter
A filter is a circuit that lets signals in some frequency range through while blocking others. Our low-pass filter blocks that fast ripple from step A and keeps only the slow part underneath it, which gets us back our original I and Q signals.
An ADC (Analog-to-Digital Converter) does the reverse of a DAC. At evenly spaced instants, it takes a fresh reading of the continuous I and Q signals and rounds each reading to the nearest value it's able to represent. The result is a list of times with their associate I and Q values.
what the ADC actually handed off to the receiver's digital logic
Now, we just need to undo the effects of the IFFT to convert back from time samples to the frequencies of our carrier waves.
To reverse the effects of the IFFT, the receiver uses an FFT or "fast fourier transform". The FFT reverses the effects of the IFFT by basically performing the opposite actions. I turns the time samples from the ADC into phasors - the clock hands we saw before where the length represents the amplitude and the and angle represents the phase. The FFT connects all of the time-sample phasors together in order, tip-to-tail, then rotates them in the opposite direction of the IFFT.
To figure out the QAM constelation point that was encoded into each frequency, the FFT takes this chain of time samples and rotates them backward by the same amount that frequency rotated them forward during the IFFT. Each clock hand rotates faster than the previous one as the frequency increases. Because we chose frequencies that are integer multiples of a common base frequency, the effects of all other frequencies cancel out and the FFT gets back the same I and Q values that were originally encoded at that frequency by the transmitter.
Use the buttons to jump straight to one of the real frequencies. To find the value for a certain frequency f, the FFT multiplies each time-sample phasor by e−i2πft/N . For 4-QAM, N=5 and so each phasors roteates backward by ft/5 of a full rotation. For f1, the t=1 sample will rotate by 1/5 of a rotation. For f2, the t=1 sample will rotate by 2/5 of a full rotation, and so on.
Experiment: combine noise, frequency spacing, and QAM order
Try adjusting the noise level, spacing between the carrier frequencies, and QAM level. What effect does increasing the QAM level have on noise-resistence? Why is it important that the carrier frequencies be "orthogonal" (spacing = 1.00)?
This system of transmitting multiple symbols at the same time by using different frequencies is known as "Orthogonal Frequency Divison Multiplexing" or OFDM. "Orthogonal" in this context just means that we selected frequencies that are integer multiples of a base frequency, so they don't interfere with eachother. If our frequencies were not orthogonal to each other, our IFFT and FFT steps would not cancel each other out perfectly and it would be impossible to separate out the effects of different frequencies.
Each frequency's recovered I and Q values are compared against the possible QAM symbols, and whichever one is closest is the receiver's best guess. If everything went well, the receiver should see the same numbers you entered at the start.