(time )frequency analysis of eeg waveforms - timely cost busch... · (time{)frequency analysis of...
TRANSCRIPT
(Time–)Frequency Analysis of EEG Waveforms
Niko Busch
Charite University Medicine Berlin; Berlin School of Mind and Brain
[email protected] 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?
[email protected] 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?
[email protected] 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?
[email protected] 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.).
[email protected] 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 1wavelength — the speed of change.
Phase current state of the oscillation — angle on the unit circle. Runsfrom 0◦ (-π) — 360◦ (π)
Magnitude (permanent) strength of the oscillation.
[email protected] 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 canalways be expressed as a sum of sinusoids“.
[email protected] 5 / 23
The discrete Fourier transform
The DFT transforms the signal from the time domain into the frequencydomain.
Requires that the signal be stationary.
0 0.5 1−505
5 Hz
Time
0 0.5 1−505
50 Hz
Time
0 0.5 1−505
10 Hz
Time
0 0.5 1−5
0
5Sum of 5 + 10 + 50
Time
0 50 1000
2
4FFT Spectrum
Hz
0 50 1000
0.51
FFT Spectrum
Hz
0 50 100012
FFT Spectrum
Hz
0 50 1000
2
4FFT Spectrum
Hz
[email protected] 6 / 23
The discrete Fourier transform
The DFT transforms the signal from the time domain into the frequencydomain.
Requires that the signal be stationary.
0 1 2 3 4−100
−50
0
50
100EEG raw data
Time [sec]0 1 2 3 4
−100
−50
0
50
100reverted raw data
Time [sec]
0 20 40 600
5
10
15
20FFT Spectrum
Hz0 20 40 60
0
5
10
15
20FFT Spectrum
Hz
[email protected] 6 / 23
The discrete Fourier transform
The DFT transforms the signal from the time domain into the frequencydomain.
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 signalsFrequency contents do not change — all frequency components exist all thetime.How to investigate event–related spectral changes in brain signals?
[email protected] 6 / 23
Event–related synchronisation / desynchronisation
Cut the signal in two time windows and assume stationarity in each half.
ERD/ERS1 = poststimulus power−baseline powerbaseline power ∗ 100
But why not use even smaller windows?
⇒ Windowed FFT / Short term Fourier transform.
1Pfurtscheller & Lopes da Silva (1999). Clin [email protected] 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 overlapwindow length: width should correspond to the segment of the signal where itsstationarity is valid.
0 50 100 150 200 2500
0.5
1
1.5
Hanning windowHamming windowBoxcar window
[email protected] 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 overlapwindow length: width should correspond to the segment of the signal where itsstationarity is valid.
0 1000 2000 3000 4000 5000 6000 7000 8000−100
0
100EEG raw data
0 1000 2000 3000 4000 5000 6000 7000 8000
0
0.5
1
shifted Hanning window
0 1000 2000 3000 4000 5000 6000 7000 8000−50
0
50windowed EEG signal
[email protected] 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 overlapwindow length: width should correspond to the segment of the signal where itsstationarity is valid.
0 2 4 6 8 10 12 14−100
−50
0
50
100EEG raw data
Time [sec]
time
freq
uenc
y
SPECTROGRAM, R = 256
0 2 4 6 8 10 12 140
10
20
30
[email protected] 8 / 23
The short term Fourier transform (STFT) II
Window length affects resolution in time and frequencyshort window: good time resolution, poor frequency resolution.long window: good frequency resolution, poor time resolution.
0 2 4 6 8 10 12 14−100
0
100EEG raw data
Time [sec]
freq
uenc
y
SPECTROGRAM, width = 1024
0 2 4 6 8 10 12 140
102030
time
freq
uenc
y
SPECTROGRAM, width = 64
0 2 4 6 8 10 12 140
102030
[email protected] 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 beoptimised.
Good frequency resolution at low frequencies.Good time resolution at high frequencies.
[email protected] 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.
[email protected] 11 / 23
What is a wavelet?
Motherwavelet
−0.5 0 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Gaussian
e−t2/2
−0.5 0 0.5−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
Cosine
|ejω0t|
−0.5 0 0.5
−0.1
−0.05
0
0.05
0.1
0.15
Wavelet
|Ψ(t)|
Zero mean amplitude.
Finite duration.
Mother wavelet: prototype function (f = sampling frequency).
Wavelets can be scaled (compressed) and translated.
[email protected] 12 / 23
What is a wavelet?
Motherwavelet
0 10 20 30 40 50 60 70
0
0.5
1
1.5
2
2.5
Frequency ( Hz )S
pe
ctr
alD
en
sity
40 Hz
10 Hz
20 Hz
Time (s)
-0.6 -0.4 -0.2 0 0.2 0.4 0.6
Zero mean amplitude.
Finite duration.
Mother wavelet: prototype function (f = sampling frequency).
Wavelets can be scaled (compressed) and translated.
[email protected] 12 / 23
Wavelet transform of ERPs
ERP
0.1 0.1 0.2 0.3
6.0
6.0
s
µV
Wavelet transformed ERP
−0.1 0.1 0.2 0.3
−2.0
2.0
s
µVOz
Bandpass–filtered ERP
−0.1 0.1 0.2 0.3
−2.0
2.0
s
µVOz
Gamma–Band: ca. 30 – 80 Hz
0.0
0.3
0.6[uV]
-0.10 0.00 0.10 0.20 0.30 0.40 0.50 0.60Time [s]
20.00
30.00
40.00
50.00
60.00
70.00
80.00
Fre
qu
en
cy
[Hz]
... but be careful:
any signal can be represented as oscillations w. time-frequency analysisbut it does not imply that the signal is oscillatory!
[email protected] 13 / 23
Important parameters of a wavelet
-0,15 -0,10 -0,05 0,00 0,05 0,10 0,15
-0,06
-0,04
-0,02
0,00
0,02
0,04
0,06
0,08
Am
plit
ude
Time[s]
A Wavelet - time domain
0 10 20 30 40 50 60 70 800,000
0,002
0,004
0,006
0,008
Frequency (Hz)
Am
plit
ude
B Wavelet - frequency domain
Length how many cycles does a wavelet have?
e.g. 40 Hz wavelet (25 ms/cycle), 12 cycles ⇒ 250 ms length
σt standard deviation in time domain: σt = m2π∗f0
σf standard deviation in frequency domain: σf = 12π∗σt
time resolution increases with frequency, whereas frequencyresolution decreases with frequency.
[email protected] 14 / 23
Evoked and induced oscillations I
Average
ms
2
1
evoked/ phase-locked induced/ non-phase-locked
..
10
100 200 300 400 500 600 700
Evoked time-frequency representation of the average of all trials (ERP).
Induced average of time-frequency transforms of single trials.
[email protected] 15 / 23
Evoked and induced oscillations II
Wavelet analysis of single trials reveals non–phase–locked activity.
Average
ms
2
1
Evoked/ phase-locked Induced/ non/phase-locked
..
10
100 200 300 400 500 600 700
Wavelet transformed trials-
Evoked time-frequency representation of the average of all trials (ERP).
Induced average of time-frequency transforms of single trials.
[email protected] 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.
[email protected] 17 / 23
The EEG state space
Frequency x phase locking x amplitude changes2
Evoked and induced activity are extremes on a continuum.
ERPs cover only small part of the EEG space.2Makeig, Debener, Onton, Delorme (2004). TICS
[email protected] 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
3Varela et al. (1981): Perceptual framing and cortical alpha rhythm.Neuropsychologia
[email protected] 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
-0.6 -0.4 -0.2 0 0.2
10
20
30
40
50
dB
-0.5
0
0.5
-log1
0[p]
-4
-2
0
2
4
freq
uenc
y [H
z]
time [s]
8 – 15 Hz-0.4 – 0 s
4Busch & VanRullen (2010): Spontaneous EEG oscillations reveal periodic samplingof visual attention. PNAS.
[email protected] 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
5Jensen et al. (2002): Oscillations in the alpha band (9–12 Hz) increase withmemory load during retention in a short-term memory task. Cereb Cortex.
[email protected] 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 rolein object representation. TICS.
Samar, Bopardikar, Rao & Swartz (1999) Wavelet analysis of neuroelectricwaveforms: a conceptual tutorial. Brain Lang.
[email protected] 22 / 23