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. We're going to walk through all the steps taken by the transmitter and receiver, as well as what can go wrong in between.
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. You can type your own binary 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're going to need another way of representing waves. We'll use a special diagram called a phasor, which is just a technical term for something that looks like the hand of a clock. We'll represent the amplitude of our wave as the length of the hand, the phase as the starting angle of the hand, and the frequency as how fast the hand spins. You can experiment with the sliders below to see how adjusting amplitude, phase, and frequency effect both the wave on the right and the phasor on the left in sync. Remember - the phasor is just another way of representing the same wave.
Drag the time slider or hit play to watch the live phasor (solid) sweep forward.
You'll notice that the x and y axes of our phasor are labeled Q for "Quadrature", I for "in-phase". The tip of the clock hand traces out a point whose location can be tracked in terms of these rectangular (Q, I) coordinates, which is a bit easier to keep track of than amplitudes and phase angles. Importantly, there is a single, unique (Q, I) point corresponding every possible phase and amplitude.
Now that we understand phasors, we can talk about how QAM can allow the transmitter to send multiple bits at the same time. To start off, we'll decide how many bits we'd like to send at the same time and divide up our message. Each group of bits is called symbol. If we'd like to send 2 bits it a time, we'll divide our message into symbols that are 2 bits long.
Next, we'll assign every possible combination of 1s and 0s to a grid of (Q, I) points. Remember, each (Q, I) point corresponds to a single amplitude and phase of a wave. For 2-bit groups, there are 4 possible combinations of 1s and 0s, and so we have 4 points in the diagram below. This type of diagrm is called a QAM "constellation". You can see that each symbol from your binary message is assigned to one of these constellation points.
Modern WiFi routers actually use up to 4096-QAM, which is a constellation of 4096 points, packing 12 bits into every single symbol. We're not even going to try drawing that!
Since each symbol is assigned a single (Q, I) point and therefore a single amplitude and phase, we can send our message 2 bits at a time by adjusting both the amplitude and phase of the wave. We can send even more bits at a time by splitting our message into groups of 4, 6, 8 and so on. Grouping by 2s is called "4-QAM" since there are 4 possible combinations of 2 bits. Grouping by 4 is called 16-QAM, since there are 16 possible combinations of 2 bits. You can select a QAM level using the buttons above.
Each chunk of wave carries one symbol's worth of bits — its height (amplitude) and where it starts (phase) come straight from that symbol's point on the constellation above
The magic behind QAM is that by adjusting amplitude and phase, we can transmit multiple bits at the same time! But we mentioned before that there's a clever way we can add in frequency to send the entire message all at once. Let's keep moving to see how that works!
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 simplify a bit and focus on giving you a visual, intuitive understanding.
First, we'll assign each of our QAM symbols (groups of bits with an amplitude and phase) 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. Remember, these are like clock hands where the amplitude assigned to our QAM symbol is the length of the hand, the phase is the starting angle, and the frequency each symbol is assigned to is how fast that hand will spin.
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 allows each clock hand to spin accord to its own individual frequency. If there are N phasors, the IFFT will spin them for N+1 time steps, starting at 0.
If we follow the tip of the final clock hand (the yellow point), it traces out a smooth path. If we follow the y or Q-axis position of that yellow dot, we get the pink curve on the right. If we track the x or I-axis coordinate, we get the blue curve on the bottom. We'll call these the Q(t) and I(t) signals, respectively. Click the play button below or drag the slider to see how the chain of phasors moves. and traces out the two signals.
Now, like we said before, we're making some simplifications here. This is just a way to visualize the math, not exactly what happens in a real IFFT circuit. The key understanding is that the IFFT lets us convert from a set of individual waves with their own amplitudes, phases, and frequencies, to two time-varying signals that combine all the frequencies. The smooth curves here are just a guide for 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. We've also made the simplification that we're always using the exact number of carrier freqencies needed to transmit the entire message all at once. In reality, modern WiFi uses around 64 carrier frequencies. If a message is too long to be sent by those 64 carriers all at once, it will be split up and transmitted in sequence.
The main takeaway here is that the IFFT let's us convert between frequency and time.
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 that carry the data out into the air.
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 rotates 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.