What the spectrum did
The plotter turned a wiggling line into a plot with a bump at 10 Hz. Here is what a spectrum is, why it can see alpha when your eye cannot, and the two things it trades away.
You are skimming: the title, the first figure, and the short version. Switch to Read in the header for the full page, or Deep to open every deep dive.
Look at five seconds of eyes-closed EEG and you might, if you squint, see a wobble about ten times a second. Look at its spectrum and there is an unmistakable hill at 10 Hz. The spectrum did not add information. It rearranged the same information so that the question “how much of this signal repeats ten times a second?” has a direct answer. Let’s build that idea from sinusoids up.
Any signal is a sum of sinusoids
That sentence is the whole of Fourier’s idea, and it is literally true for any signal you can record. Take three pure tones at different frequencies and amplitudes and add them. The sum looks like a mess. Now ask, for each frequency, how much of that frequency is present. You get three spikes, exactly where you put the tones, exactly as tall as you made them.
- Set tone 3’s amplitude to zero. Its spike vanishes.
- Move tone 1 to 10 Hz and tone 2 to 10.5 Hz. Watch the two spikes merge into one lump. That is frequency resolution, and the deep dive explains it.
- Turn the noise up. The spikes are still there, standing on a floor. That is why the spectrum sees alpha when your eye cannot.
The fast Fourier transformFast Fourier transform (FFT)The algorithm that breaks a stretch of signal into the sinusoids that would add up to it, giving amplitude and phase at each frequency. Glossary entry is the algorithm that does the “ask for each frequency” part quickly. What it returns, for each frequency, is an amplitude and a phase. Square the amplitude and you have power. Plot power against frequency and you have the spectrumSpectrumA plot of how much of a signal lives at each frequency. Glossary entry.
A signal has a 10 Hz sinusoid buried in noise five times its size. Will the spectrum show a peak at 10 Hz?
Yes, clearly. Noise spreads its power across every frequency; a sinusoid concentrates all of its power at one. Over a two-second window, the 10 Hz bin collects everything the sinusoid has, while each noise bin gets only a small share. The peak stands well above the floor. This is the same reason radio works.
What the axes mean
The horizontal axis is frequency in hertz, from zero to half your sampling rate (the Nyquist frequencyNyquist frequencyHalf the sampling rate; anything in the signal above it cannot be represented and will appear as something false. Glossary entry; more on that in Phase 2). The vertical axis is usually power per hertz, called power spectral densityPower spectral density (PSD)The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. Glossary entry, and it is usually plotted in decibels because EEG power spans several orders of magnitude between 1 Hz and 40 Hz. A 10 dB rise is ten times the power. Alpha’s hill is typically 10 to 20 dB above the surrounding floor in a good eyes-closed recording.
The floor itself slopes down from left to right. EEG has more power at low frequencies than high, roughly following one over frequency, and every spectrum you ever plot will show that slope before it shows anything else.
The two trades
Time for frequency. To tell 10 Hz from 10.5 Hz you need to watch for at least two seconds, because that is how long it takes the two to drift half a cycle apart. In general, frequency resolution in hertz is one over the window length in seconds. A ten-second window resolves 0.1 Hz. A quarter-second window resolves 4 Hz, which cannot separate alpha from beta. So a spectrum of a long window is sharp but tells you nothing about when things happened; a spectrum of a short window knows when but is blurry. The spectrogramSpectrogramA spectrum computed over sliding windows and plotted against time, showing how frequency content changes. Glossary entry, which slides a short window along the signal, is the compromise everyone uses.
Sharpness for confidence. One spectrum of one two-second window is noisy: the height of every bin wobbles by a large fraction from one window to the next. Welch’s methodWelch's methodEstimating a spectrum by averaging the spectra of many overlapping short windows, trading frequency detail for a less noisy estimate. Glossary entry cuts the recording into overlapping windows, computes each spectrum, and averages them. The average is smoother and its peaks are trustworthy, at the cost of the frequency resolution of the shorter windows. The plotter and the simulator both use it.
Deep dive Why the window has to be tapered 4 min
The FFT assumes the stretch of signal you gave it repeats forever. If the stretch starts at one value and ends at another, the imaginary repetition has a jump at every seam, and jumps have energy at all frequencies. That energy smears across the spectrum as “leakage,” burying small peaks. A window functionWindow functionA smooth taper, such as a Hann window, applied to a segment before an FFT so its abrupt edges do not smear the spectrum. Glossary entry such as the Hann window multiplies the stretch by a smooth bump that goes to zero at both ends, so the seams vanish. The price is slightly wider peaks. Every serious spectrum uses a window; the interactive above does.
Deep dive Phase, the half the plot throws away 3 min
The FFT gives each frequency an amplitude and a phase. The spectrum plots only amplitude. Phase says where in its cycle each sinusoid was at the start of the window, and for a single channel it is mostly uninteresting. Between two channels it becomes very interesting: two regions oscillating at the same frequency with a fixed phase relationship are probably talking. Phase-locking measures are a large part of Phase 3 and 4.
Deep dive Bins, zero-padding, and other things people get confused by 3 min
An FFT of N samples at rate fs gives N/2 useful frequency bins spaced fs/N apart. Zero-padding (appending zeros before the FFT) gives more bins but not more resolution; it interpolates the same underlying curve more finely, which is cosmetic. Real resolution comes only from a longer recording. Power in a bin depends on the window and the normalization, which is why absolute PSD values differ between software packages and why you should compare spectra computed the same way.
Explain what this page was about to your roommate in three sentences. No jargon they would not know.