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.
On this page14 min
Look at five seconds of eyes-closed EEGElectroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. Related: Electrocorticography (ECoG)Electrocorticography (ECoG) Recording from electrodes placed on the surface of the brain under the skull, usually during epilepsy surgery evaluation; cleaner and sharper than EEG. , Magnetoencephalography (MEG)Magnetoencephalography (MEG) Recording the tiny magnetic fields produced by cortical currents with superconducting sensors in a shielded room; less blurred by the skull than EEG, and far more expensive. , Volume conductionVolume conduction The spreading of currents from a source through the conductive tissues of the head, which is why one source shows up on many electrodes and why scalp EEG is blurry. , Microvolt (µV)Microvolt (µV) One millionth of a volt. Scalp EEG is tens of microvolts; a AA battery is 1.5 million of them. . Glossary entry and you might, if you squint, see a wobble about ten times a second. Look at its spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry and there is an unmistakable hill at 10 Hz. The spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry 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 spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry, exactly where you put the tones, exactly as tall as you made them.
- Set tone 3’s amplitude to zero. Its spikeSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry vanishes.
- Move tone 1 to 10 Hz and tone 2 to 10.5 Hz. Watch the two spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry merge into one lump. That is frequency resolution, and the deep dive explains it.
- Turn the noise up. The spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry are still there, standing on a floor. That is why the spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry 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. Related: SpectrumSpectrum A plot of how much of a signal lives at each frequency., Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is., Window functionWindow function A 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 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 spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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., Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is.. 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 rateSampling rate How many measurements per second the ADC takes; EEG is usually 250 to 1000 per second. Related: Nyquist frequencyNyquist frequency Half the sampling rate; anything in the signal above it cannot be represented and will appear as something false. , AliasingAliasing A frequency above Nyquist masquerading as a lower one after sampling; nothing downstream can undo it. . Glossary entry (the Nyquist frequencyNyquist frequency Half the sampling rate; anything in the signal above it cannot be represented and will appear as something false. Related: AliasingAliasing A frequency above Nyquist masquerading as a lower one after sampling; nothing downstream can undo it., Anti-alias filterAnti-alias filter A low-pass filter placed before the ADC to remove everything above Nyquist, so nothing can alias.. 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. Related: Welch's methodWelch's method Estimating a spectrum by averaging the spectra of many overlapping short windows, trading frequency detail for a less noisy estimate., SpectrumSpectrum A plot of how much of a signal lives at each frequency.. Glossary entry, and it is usually plotted in decibels because EEGElectroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. Related: Electrocorticography (ECoG)Electrocorticography (ECoG) Recording from electrodes placed on the surface of the brain under the skull, usually during epilepsy surgery evaluation; cleaner and sharper than EEG. , Magnetoencephalography (MEG)Magnetoencephalography (MEG) Recording the tiny magnetic fields produced by cortical currents with superconducting sensors in a shielded room; less blurred by the skull than EEG, and far more expensive. , Volume conductionVolume conduction The spreading of currents from a source through the conductive tissues of the head, which is why one source shows up on many electrodes and why scalp EEG is blurry. , Microvolt (µV)Microvolt (µV) One millionth of a volt. Scalp EEG is tens of microvolts; a AA battery is 1.5 million of them. . Glossary entry 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. EEGElectroencephalography (EEG) Recording the brain's electrical activity from electrodes on the scalp, a few tens of microvolts of blurred, summed cortical activity. Related: Electrocorticography (ECoG)Electrocorticography (ECoG) Recording from electrodes placed on the surface of the brain under the skull, usually during epilepsy surgery evaluation; cleaner and sharper than EEG. , Magnetoencephalography (MEG)Magnetoencephalography (MEG) Recording the tiny magnetic fields produced by cortical currents with superconducting sensors in a shielded room; less blurred by the skull than EEG, and far more expensive. , Volume conductionVolume conduction The spreading of currents from a source through the conductive tissues of the head, which is why one source shows up on many electrodes and why scalp EEG is blurry. , Microvolt (µV)Microvolt (µV) One millionth of a volt. Scalp EEG is tens of microvolts; a AA battery is 1.5 million of them. . Glossary entry has more power at low frequencies than high, roughly following one over frequency, and every spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry 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 spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry of a long window is sharp but tells you nothing about when things happened; a spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry of a short window knows when but is blurry. The spectrogramSpectrogram A spectrum computed over sliding windows and plotted against time, showing how frequency content changes. Related: Wavelet transformWavelet transform A time-frequency analysis that uses short wiggles at high frequencies and long ones at low, matching the trade-off to the frequency., SpectrumSpectrum A plot of how much of a signal lives at each frequency.. Glossary entry, which slides a short window along the signal, is the compromise everyone uses.
Sharpness for confidence. One spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry 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 method Estimating a spectrum by averaging the spectra of many overlapping short windows, trading frequency detail for a less noisy estimate. Related: Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is., Window functionWindow function A 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 cuts the recording into overlapping windows, computes each spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry, 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 FFTFast 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. Related: SpectrumSpectrum A plot of how much of a signal lives at each frequency. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. , Window functionWindow function A 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 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 spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry as “leakage,” burying small peaks. A window functionWindow function A smooth taper, such as a Hann window, applied to a segment before an FFT so its abrupt edges do not smear the spectrum. Related: Fast Fourier transform (FFT)Fast 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., Welch's methodWelch's method Estimating a spectrum by averaging the spectra of many overlapping short windows, trading frequency detail for a less noisy estimate.. 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 spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry uses a window; the interactive above does.
Deep dive Phase, the half the plot throws away 3 min
The FFTFast 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. Related: SpectrumSpectrum A plot of how much of a signal lives at each frequency. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. , Window functionWindow function A 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 gives each frequency an amplitude and a phase. The spectrumSpectrum A plot of how much of a signal lives at each frequency. Related: Fast Fourier transform (FFT)Fast 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. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. . Glossary entry 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 FFTFast 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. Related: SpectrumSpectrum A plot of how much of a signal lives at each frequency. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. , Window functionWindow function A 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 of N samples at rate fs gives N/2 useful frequency bins spaced fs/N apart. Zero-padding (appending zeros before the FFTFast 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. Related: SpectrumSpectrum A plot of how much of a signal lives at each frequency. , Power spectral density (PSD)Power spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. , Window functionWindow function A 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) 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 PSDPower spectral density (PSD) The spectrum expressed as power per hertz, the standard way to quantify how strong alpha is. Related: Welch's methodWelch's method Estimating a spectrum by averaging the spectra of many overlapping short windows, trading frequency detail for a less noisy estimate. , SpectrumSpectrum A plot of how much of a signal lives at each frequency. . Glossary entry 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.
We treat any recording as a sum of sinusoids and plot power against frequency in hertz, usually in decibels where a 10 decibel rise means ten times the power. We see alpha as a hill 10 to 20 decibels above the floor near 10 Hz because the rhythm concentrates its power in one bin while noise spreads across all of them. We trade window length for sharpness, since resolution in hertz equals one over seconds observed, and we average overlapping windows with the Welch method to earn trustworthy peaks.
Yours does not have to match. Check that the three ideas are there.