(Time–)Frequency Analysis of EEG Waveforms
Niko Busch niko.busch@charite.de
niko.busch@charite.de
1 / 23
From ERP waveforms to waves
ERP analysis: time domain analysis: when do things (amplitudes) happen?
treats peaks and troughs as single events.
Frequency domain (spectral) analysis (Fourier analysis): magnitudes and frequencies of waves — no time information.
peaks and troughs are not treated as separate entities.
Time–frequency analysis (wavelet analysis): when do which frequencies occur?
niko.busch@charite.de
2 / 23
From ERP waveforms to waves
ERP analysis: time domain analysis: when do things (amplitudes) happen?
treats peaks and troughs as single events.
Frequency domain (spectral) analysis (Fourier analysis): magnitudes and frequencies of waves — no time information.
peaks and troughs are not treated as separate entities.
Time–frequency analysis (wavelet analysis): when do which frequencies occur?
niko.busch@charite.de
2 / 23
From ERP waveforms to waves
ERP analysis: time domain analysis: when do things (amplitudes) happen?
treats peaks and troughs as single events.
Frequency domain (spectral) analysis (Fourier analysis): magnitudes and frequencies of waves — no time information.
peaks and troughs are not treated as separate entities.
Time–frequency analysis (wavelet analysis): when do which frequencies occur?
niko.busch@charite.de
2 / 23
Why bother?
(Time–)Frequency analysis complements signal analysis: neurons are oscillating.
analysis of signals with trial-to-trial jitter.
analysis of longer time periods.
analysis of pre-stimulus and spontaneous signals.
necessary for sophisticated methods (coherence, coupling, causality, etc.).
niko.busch@charite.de
3 / 23
Parameters of waves
Oscillations regular repetition of some measure over several cycles.
Wavelength length of a single cycle (a.k.a. period).
Frequency
1 wavelength
— the speed of change.
Phase current state of the oscillation — angle on the unit circle. Runs from 0
◦
(π ) — 360
◦
( π )
Magnitude (permanent) strength of the oscillation.
niko.busch@charite.de
4 / 23
How to disentangle oscillations
Jean Joseph Fourier (1768—1830):
”
An arbitrary function, continuous or with discontinuities, defined in a finite interval by an arbitrarily capricious graph can always be expressed as a sum of sinusoids“ .
niko.busch@charite.de
5 / 23
The discrete Fourier transform
The DFT transforms the signal from the time domain into the frequency domain.
Requires that the signal be stationary .
FFT Spectrum 5 Hz
5
0
−5
0
5
0
−5
0 0.5
Time
50 Hz
0.5
Time
1
5
0
−5
0 0.5
Time
10 Hz
5
0
−5
0 0.5
Time
Sum of 5 + 10 + 50
1
1
1
0.5
0
0
2
1
0
0
1
4
2
0
0
4
2
0
0 50
Hz
FFT Spectrum
50
Hz
FFT Spectrum
50
Hz
FFT Spectrum
50
Hz
100
100
100
100 niko.busch@charite.de
6 / 23
The discrete Fourier transform
The DFT transforms the signal from the time domain into the frequency domain.
Requires that the signal be stationary .
EEG raw data reverted raw data
100
50
0
−50
−100
0 4
100
50
0
−50
−100
0 4 1 2
Time [sec]
FFT Spectrum
3 1 2
Time [sec]
FFT Spectrum
3
20
15
10
5
0
0 20
Hz
40 60
20
15
10
5
0
0 20
Hz
40 60 niko.busch@charite.de
6 / 23
The discrete Fourier transform
The DFT transforms the signal from the time domain into the frequency domain.
Requires that the signal be stationary .
Non-stationary signals:
When does the 10 Hz oscillation occur?
DFT does not give time information.
Time information is not necessary for stationary signals
Frequency contents do not change — all frequency components exist all the time.
How to investigate event–related spectral changes in brain signals?
niko.busch@charite.de
6 / 23
Event–related synchronisation / desynchronisation
Cut the signal in two time windows and assume stationarity in each half.
ERD / ERS 1 = poststimulus power − baseline power baseline power
∗ 100
But why not use even smaller windows?
⇒ Windowed FFT / Short term Fourier transform.
1
Pfurtscheller & Lopes da Silva (1999). Clin Neurophysiol niko.busch@charite.de
7 / 23
The short term Fourier transform (STFT) I
Assume that some portion of a non–stationary signal is stationary.
Important parameters: window function (Hamming, Hanning, Rectangular, etc.) window overlap window length: width should correspond to the segment of the signal where its stationarity is valid.
1.5
Hanning window
Hamming window
Boxcar window
1
0.5
0
0 50 100 150 200 250 niko.busch@charite.de
8 / 23
The short term Fourier transform (STFT) I
Assume that some portion of a non–stationary signal is stationary.
Important parameters: window function (Hamming, Hanning, Rectangular, etc.) window overlap window length: width should correspond to the segment of the signal where its stationarity is valid.
EEG raw data
100
0
−100
0 1000 2000 3000 4000 5000 shifted Hanning window
6000 7000 8000
1
0.5
0
0
50
0
−50
0
1000 2000 3000 4000 5000 windowed EEG signal
6000 7000 8000
1000 2000 3000 4000 5000 6000 7000 8000 niko.busch@charite.de
8 / 23
The short term Fourier transform (STFT) I
Assume that some portion of a non–stationary signal is stationary.
Important parameters: window function (Hamming, Hanning, Rectangular, etc.) window overlap window length: width should correspond to the segment of the signal where its stationarity is valid.
EEG raw data
100
50
0
−50
−100
0 2 12 14 4 6
Time [sec]
8
SPECTROGRAM, R = 256
10
30
20
10
0
0 2 4 6 time
8 10 12 14 niko.busch@charite.de
8 / 23
The short term Fourier transform (STFT) II
Window length affects resolution in time and frequency short window: good time resolution, poor frequency resolution.
long window: good frequency resolution, poor time resolution.
EEG raw data
100
0
−100
0 2 12 4 6
Time [sec]
8 10
SPECTROGRAM, width = 1024
14
30
20
10
0
0 2 4 6 8 10 12 14
SPECTROGRAM, width = 64
30
20
10
0
0 2 4 6 time
8 10 12 14 niko.busch@charite.de
9 / 23
Uncertainty principle
Werner Heisenberg (1901—1976):
Energy and location of a particle cannot be both known with infinite precision.
a result of the wave properties of particles (not the measurement).
Applies also to time–frequency analysis:
We cannot know what spectral component exists at any given time instant .
What spectral components exist at any given interval of time?
Spectral/temporal resolution trade off cannot be avoided — but it can be optimised.
Good frequency resolution at low frequencies.
Good time resolution at high frequencies.
niko.busch@charite.de
10 / 23
From STFT to wavelets
STFT: fixed temporal & spectral resolution
Analysis of high frequencies ⇒ insufficient temporal resolution.
Analysis of low frequencies ⇒ insufficient spectral resolution.
Wavelet analysis:
Analysis of high frequencies ⇒ narrow time window for better time resolution.
Analysis of low frequencies ⇒ wide time window for better spectral resolution.
niko.busch@charite.de
11 / 23
What is a wavelet?
Motherwavelet
2
1.5
1
0.5
0
−0.5
−1
−1.5
|e j
ω
0 t
|
−2
−0.5
0
Cosine
0.5
e
−t
2
/2
2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
0
−0.5
0
Gaussian
0.5
0.15
0.1
0.05
0
−0.05
−0.1
|
Ψ
(t)|
−0.5
0
Wavelet
0.5
Zero mean amplitude.
Finite duration.
Mother wavelet: prototype function ( f = sampling frequency).
Wavelets can be scaled (compressed) and translated.
niko.busch@charite.de
12 / 23
What is a wavelet?
Motherwavelet
2.5
10 Hz
20 Hz
2
1.5
1
0.5
40 Hz
-0.6
-0.4
-0.2
0
Time (s)
0.2
0.4
0.6
0
0 10 20 30 40
Frequency ( Hz )
50 60 70
Zero mean amplitude.
Finite duration.
Mother wavelet: prototype function ( f = sampling frequency).
Wavelets can be scaled (compressed) and translated.
niko.busch@charite.de
12 / 23
Wavelet transform of ERPs
ERP
6.0
µV
0.1
6.0
0.1
0.2
s
0.3
Wavelet transformed ERP
µV
2.0
Oz
0.1
0.2
s
0.3
−0.1
−2.0
Bandpass–filtered ERP
−2.0
µV
Oz
0.1
0.2
s
0.3
−0.1
2.0
Gamma–Band: ca. 30 – 80 Hz
80.00
70.00
60.00
50.00
40.00
30.00
20.00
-0.10 0.00 0.10 0.20 0.30 0.40 0.50 0.60
[uV]
0.6
0.3
0.0
... but be careful: any signal can be represented as oscillations w. time-frequency analysis but it does not imply that the signal is oscillatory!
niko.busch@charite.de
13 / 23
Important parameters of a wavelet
A
Wavelet - time domain
0,08
0,06
0,04
0,02
0,00
-0,02
-0,04
-0,06
-0,15 -0,10 -0,05 0,00
Time[s]
0,05 0,10 0,15
B
Wavelet - frequency domain
0,008
0,006
0,004
0,002
0,000
0 10 20 30 40 50
Frequency (Hz)
60 70 80
Length how many cycles does a wavelet have?
σ t
σ f e.g. 40 Hz wavelet (25 ms/cycle), 12 cycles ⇒ 250 ms length standard deviation in time domain: σ t
= m
2 π ∗ f
0 standard deviation in frequency domain: σ f
=
1
2 π ∗ σ t time resolution increases with frequency, whereas frequency resolution decreases with frequency.
niko.busch@charite.de
14 / 23
Evoked and induced oscillations I
..
10
1
2 evoked/ phase-locked induced/ non-phase-locked
Average
100 200 300 400 500 600 700 ms
Evoked time-frequency representation of the average of all trials (ERP).
Induced average of time-frequency transforms of single trials.
niko.busch@charite.de
15 / 23
Evoked and induced oscillations II
Wavelet analysis of single trials reveals non–phase–locked activity.
Evoked/ phase-locked Induced/ non/phase-locked
1
2
..
10
Average
100 200 300 400 500 600 700 ms
Evoked time-frequency representation of the average of all trials (ERP).
Induced average of time-frequency transforms of single trials.
niko.busch@charite.de
16 / 23
Phase–locking factor (PLF) a.k.a. intertrial coherence (ITC) or phase–locking–value (PLV).
measures phase consistency of a frequency at a particular time across trials.
PLF = 1: perfect phase alignment.
PLF = 0: random phase distribution.
niko.busch@charite.de
17 / 23
The EEG state space
Frequency x phase locking x amplitude changes
2
Evoked and induced activity are extremes on a continuum.
ERPs cover only small part of the EEG space.
2
Makeig, Debener, Onton, Delorme (2004). TICS niko.busch@charite.de
18 / 23
Examples 1: spontaneous EEG
Stimulus pairs are presented at different phases of the alpha rhythm — sequential or simultaneous?
3
If the stimulus pair falls within the same alpha cycle ⇒ perceived simultaneity.
Does the visual system take snapshots at a rate of 10 Hz?
Simultaneity and the alpha rhythm
Figure from VanRullen & Koch (2003): Is perception discrete of continuous? TICS
3
Varela et al. (1981): Perceptual framing and cortical alpha rhythm.
Neuropsychologia niko.busch@charite.de
19 / 23
Examples 2: pre-stimulus EEG power
Spatial attention to left or right.
Stronger alpha power over ipsilateral hemisphere.
4
Attention: ipsi- vs. contra-lateral
50
40
30
20
10
-0.6
-0.4
-0.2
time [s]
0 0.2
4
2
0
-2
-4
8 – 15 Hz
-0.4 – 0 s
0.5
0
-0.5
4
Busch & VanRullen (2010): Spontaneous EEG oscillations reveal periodic sampling of visual attention. PNAS.
niko.busch@charite.de
20 / 23
Examples 3: analysis of long time intervals
Sternberg memory task with different set sizes.
Alpha power increases linearly with set size.
5
Effect of set size
5
Jensen et al. (2002): Oscillations in the alpha band (9–12 Hz) increase with memory load during retention in a short-term memory task. Cereb Cortex.
niko.busch@charite.de
21 / 23
Recommended reading
WWW:
EEGLAB’s time-frequency functions explained: http://bishoptechbits.blogspot.com/
FFT explained: http://blinkdagger.com/matlab/matlab-introductory-fft-tutorial/
Wavelet tutorial http://users.rowan.edu/ polikar/WAVELETS/WTtutorial.html
Books:
Barbara Burke Hubbard: The World According to Wavelets.
Steven Smith: The Scientist & Engineer’s Guide to Digital Signal Processing
( http://www.dspguide.com/ ).
Herrmann, Grigutsch & Busch: EEG oscillations and wavelet analysis. In:
Event-related Potentials: A Methods Handbook.
Papers:
Tallon-Baudry & Bertrand (1999) Oscillatory gamma activity in humans and its role in object representation. TICS.
Samar, Bopardikar, Rao & Swartz (1999) Wavelet analysis of neuroelectric waveforms: a conceptual tutorial. Brain Lang.
niko.busch@charite.de
22 / 23
Thank you...
niko.busch@charite.de
23 / 23