(Time–)Frequency Analysis of EEG Waveforms Niko Busch Charité University Medicine Berlin; Berlin School of Mind and Brain [email protected] [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). 1 — the speed of change. Frequency wavelength Phase current state of the oscillation — angle on the unit circle. Runs from 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 can always 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 frequency domain. Requires that the signal be stationary. 5 Hz 5 0 −5 0 FFT Spectrum 4 2 0.5 Time 1 0 0 50 Hz FFT Spectrum 100 0 50 Hz FFT Spectrum 100 0 50 Hz FFT Spectrum 100 0 50 Hz 100 50 Hz 5 0 −5 0 5 0 −5 0 0.5 Time 10 Hz 1 0.5 Time Sum of 5 + 10 + 50 1 2 1 0 4 5 0 −5 0 1 0.5 0 2 0.5 Time 1 0 [email protected] 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 100 50 50 0 0 −50 −50 −100 0 1 2 3 Time [sec] FFT Spectrum 4 −100 0 20 20 15 15 10 10 5 5 0 0 20 40 Hz 60 0 0 1 2 3 Time [sec] FFT Spectrum 20 40 4 60 Hz [email protected] 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? [email protected] 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 [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 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 [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 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 6000 7000 8000 6000 7000 8000 6000 7000 8000 shifted Hanning window 1 0.5 0 0 1000 2000 3000 4000 5000 windowed EEG signal 50 0 −50 0 1000 2000 3000 4000 5000 [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 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 4 2 4 6 8 10 Time [sec] SPECTROGRAM, R = 256 12 14 12 14 frequency 30 20 10 0 0 6 8 10 time [email protected] 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 frequency −100 0 30 20 10 0 0 2 4 6 8 10 Time [sec] SPECTROGRAM, width = 1024 12 14 2 4 12 14 6 8 10 frequency SPECTROGRAM, width = 64 30 20 10 0 0 2 4 6 8 time 10 12 14 [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 be optimised. 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 2 |ejω0t| e−t /2 2 |Ψ(t)| 2 0.15 1.8 1.5 0.1 1.6 1 1.4 0.5 0.05 1.2 0 1 0 0.8 −0.5 −0.05 0.6 −1 0.4 −1.5 −2 −0.5 −0.1 0.2 0 Cosine 0.5 0 −0.5 0 0.5 Gaussian −0.5 0 0.5 Wavelet 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 2.5 10 Hz Spectral Density 2 20 Hz 40 Hz 1.5 1 0.5 0 -0.6 -0.4 -0.2 0 Time (s) 0.2 0.4 0.6 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. [email protected] 12 / 23 Wavelet transform of ERPs Bandpass–filtered ERP ERP µV −2.0 µV 6.0 0.1 0.1 0.2 Oz s 0.3 −0.1 6.0 0.1 s 0.3 0.2 2.0 Wavelet transformed ERP µV 2.0 Gamma–Band: ca. 30 – 80 Hz [uV] 0.6 80.00 Oz −0.1 0.1 0.2 s 0.3 Frequency [Hz] 70.00 60.00 0.3 50.00 40.00 30.00 −2.0 20.00 -0.10 0.0 0.00 0.10 0.20 0.30 Time [s] 0.40 0.50 0.60 ... but be careful: any signal can be represented as oscillations w. time-frequency analysis but it does not imply that the signal is oscillatory! [email protected] 13 / 23 Important parameters of a wavelet B Wavelet - frequency domain A Wavelet - time domain 0,08 0,06 0,008 0,02 Amplitude Amplitude 0,04 0,00 -0,02 -0,04 0,006 0,004 0,002 -0,06 -0,15 -0,10 -0,05 0,00 0,05 Time[s] 0,10 0,15 0,000 0 10 20 30 40 50 Frequency (Hz) 60 70 80 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 = m 2π∗f0 σf standard deviation in frequency domain: σf = 1 2π∗σt time resolution increases with frequency, whereas frequency resolution decreases with frequency. [email protected] 14 / 23 Evoked and induced oscillations I 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. [email protected] 15 / 23 Evoked and induced oscillations II Wavelet analysis of single trials reveals non–phase–locked activity. Evoked/ phase-locked Induced/ non/phase-locked Wavelet-transformed trials 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. [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. 2 Makeig, 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 3 Varela 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 4 40 2 30 0 20 -2 10 -4 -0.6 -0.4 -0.2 0 time [s] 0.2 0.5 0 dB 50 -log10[p] frequency [Hz] Attention: ipsi- vs. contra-lateral -0.5 8 – 15 Hz -0.4 – 0 s 4 Busch & VanRullen (2010): Spontaneous EEG oscillations reveal periodic sampling of 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 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. [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 role in object representation. TICS. Samar, Bopardikar, Rao & Swartz (1999) Wavelet analysis of neuroelectric waveforms: a conceptual tutorial. Brain Lang. [email protected] 22 / 23 Thank you... ... for your interest ! Please ask questions!!! [email protected] 23 / 23
© Copyright 2026 Paperzz