Visual Concepts in Computational Psychiatry
From the Unit Circle to the Fourier Transform
A Fourier transform is not magic. It asks: how much of each rotating wave is hidden inside this signal?
The big idea
Many signals look complicated because several rhythms are mixed together. A Fourier transform separates a signal into simpler oscillatory ingredients: slow waves, fast waves, and everything in between.
In neuroscience, this is useful because EEG and MEG recordings are not single clean waves. They are mixtures of rhythms produced by interacting neural populations. Fourier analysis gives us a first way to ask: what rhythms are present, and how strong are they?
Time domain
What the signal does over time.
Frequency domain
Which rhythms make up the signal.
Fourier transform
The bridge between the two views.
1. A rotating point contains two waves
Move around the unit circle at a constant angular speed. The horizontal coordinate traces a cosine wave, while the vertical coordinate traces a sine wave. This is the bridge between circular motion and oscillations.
This is why Fourier analysis uses complex numbers. A complex number can be thought of as a point with two coordinates: a horizontal coordinate and a vertical coordinate.
$e^{i\theta} = \cos(\theta) + i\sin(\theta)$
Intuition
A sine wave is not separate from circular motion. It is one coordinate of circular motion. When a point rotates at a steady speed, its shadow moves back and forth smoothly. That shadow is an oscillation.
2. Frequency, amplitude and phase
Before we get to the Fourier transform, three ideas matter. Frequency tells us how quickly something repeats. Amplitude tells us how large the rhythm is. Phase tells us where in the cycle the rhythm is.
Frequency
How many cycles occur per second.
$f = \frac{1}{T}$
Amplitude
How large the oscillation is.
$A\cos(2\pi ft)$
Phase
Where the oscillation starts in its cycle.
$A\cos(2\pi ft + \phi)$
Two waves can have the same frequency and amplitude but different phases. They are the same rhythm, just shifted in time.
3. Real and imaginary parts are just two coordinates
In Fourier analysis, the word imaginary can make things sound more mysterious than they are. The real part is the cosine-like component. The imaginary part is the sine-like component. Together they describe the amplitude and phase of a rotating vector.
Real part
$\mathrm{Re}(e^{i\theta}) = \cos(\theta)$
Imaginary part
$\mathrm{Im}(e^{i\theta}) = \sin(\theta)$
Magnitude
$|z| = \sqrt{\mathrm{Re}(z)^2 + \mathrm{Im}(z)^2}$
Phase
$\phi = \tan^{-1}\left(\frac{\mathrm{Im}(z)}{\mathrm{Re}(z)}\right)$
Key point
The Fourier transform returns complex numbers because each frequency needs two pieces of information: how much of that rhythm is present, and where in its cycle it lines up with the signal.
4. The Fourier transform matches the signal with rotating templates
Imagine testing many rotating circles against a signal. When the rotation frequency matches a rhythm in the signal, the rotating template accumulates structure rather than cancelling itself out. The resulting strength tells us how much of that frequency is present.
$X(f) = \sum_t x(t)e^{-i2\pi ft}$
What the spectrum is showing
Peaks in the spectrum appear at frequencies that are strongly present in the signal. If the signal contains a 3 Hz rhythm and a 7 Hz rhythm, the Fourier spectrum should show peaks near 3 Hz and 7 Hz. Noise spreads energy more broadly, making the peaks less clean.
5. Another intuition: winding the signal around a circle
A helpful way to understand the Fourier transform is to imagine wrapping the signal around a circle. Pick a test frequency. If the test frequency does not match the signal, positive and negative parts spread around the circle and cancel out. If it does match, the wrapped signal becomes lopsided and has a clear centre of mass.
The Fourier transform is essentially measuring that centre of mass for each test frequency.
Newbie-friendly translation
The transform asks: “If I rotate at this frequency while watching the signal, does the signal pull me in one consistent direction, or does it cancel itself out?”
6. Building a signal from waves
Fourier analysis also works in reverse. Once we know the amplitude and phase of each frequency, we can add those waves back together to reconstruct the original signal.
$x(t) = \sum_f X(f)e^{i2\pi ft}$
Reconstruction idea
- Take one frequency.
- Scale it by its amplitude.
- Shift it by its phase.
- Add it to the other frequencies.
- The mixture recreates the signal.
7. Power: ignoring phase when we only care about strength
The Fourier transform gives a complex value for each frequency. The magnitude tells us the strength of that frequency. Squaring the magnitude gives power.
$P(f) = |X(f)|^2$
In EEG and MEG, we often talk about power in frequency bands: delta, theta, alpha, beta and gamma. These bands summarise how much rhythmic activity is present in broad frequency ranges.
Slow rhythms, often prominent in deep sleep.
Often linked to memory, navigation and drowsiness.
Prominent posterior rhythm, often stronger with eyes closed.
Often linked to motor and cognitive state.
Fast activity, often linked to local cortical processing.
8. Why phase still matters
Power tells us how strong a rhythm is, but phase tells us where that rhythm is in its cycle. This matters when comparing signals from different brain regions.
Two regions may have the same frequency but differ in their phase relationship. Measures such as coherence, phase-locking and imaginary coherence use this idea to study functional connectivity.
Same phase
Signals rise and fall together.
Phase lag
One signal consistently follows another.
Unstable phase
The relationship changes over time.
9. A few practical cautions
Fourier analysis is powerful, but it is not automatic truth. It assumes that the signal is being analysed over a chosen time window. The result depends on sampling rate, window length, noise, filtering and whether the signal changes over time.
Sampling rate
You cannot measure rhythms faster than the data allow.
Window length
Longer windows give better frequency resolution but blur changes over time.
Non-stationarity
Brain signals change, so spectra may differ across moments, tasks or sleep stages.
Filtering
Preprocessing can shape the spectrum, so interpretation needs care.
Why this matters for our lab
EEG and MEG signals are mixtures of rhythms. Fourier methods let us ask which rhythms are present, how strong they are and how they relate across brain regions. In our modelling work, spectra become the data that neural mass models try to explain mechanistically: changes in synaptic gain, time constants, delays and receptor dynamics should leave structured fingerprints in the frequency domain.
This is why frequency-domain analysis is so useful in computational psychiatry. A change in spectral power is not just a descriptive feature; it can become a clue about the synaptic and circuit mechanisms that generated the data.
Summary
The Fourier transform is a way of comparing a signal with many rotating waves. Frequencies that match the signal leave a strong trace. Frequencies that do not match tend to cancel out.
Unit circle: circular motion creates sine and cosine waves.
Complex numbers: a compact way to track two coordinates: cosine and sine.
Fourier transform: tests how strongly each rotating wave is present.
Spectrum: shows the strength of rhythms across frequency.
Neuroscience: spectra help us characterise and model rhythmic brain activity.