Time Frequency Analysis

Time-frequency-map-from-25-single-trials-EEG-acquired-during-a-motor-execution-task-top.png

Time frequency analysis allows us to visually see how power varies in different frequencies across time. This is typically done relative to the onset of a particular time-locked event.

EEG signals capture phase-amplitude oscillations in the time domain. Time frequency analysis transforms this data into the frequency domain. With this transformation there is a trade-off between precision in the time domain to precision in the frequency domain formalized by the Heisenberg uncertainty principle. As the time window used to estimate the data increases (reducing temporal resolution), the frequency resolution increases. In other words the more you know about when some activity occurs, the less you know about where (at which frequency) it happens, and vice versa. We selected a time range of 400 ms that optimized for an adequate time and frequency resolution. We used the fieldtrip toolbox in matlab to get time frequency analysis on the data that had been cleaned in EEGlab.

Specification Description Selected Value
cfg.t_ftimwin Decreasing this number increases temporal resolution at the cost of frequency resolution. This specifies the sliding time window in seconds. 0.4
cfg.epochbaseint Specifies the baseline interval for the data -0.50
cfg.continuous If the data is epoched it is not continuous. ‘no’
cfg.taper Decides whether or not frequency analysis is performed using a single taper (hanning) or multiple. ‘hanning’
cfg.method Different methods of calculating the spectra. The option 'mtmconvol' implements multitaper time-frequency transformation based on multiplication in the frequency domain. ‘mtmconvol’
cfg.foi Frequency of interest (use frequencies at which data was filtered) 0.5:0.5:30
cfg.toi Times of interest (epoch length) 0.5:0.01:1.5
cfg.pad The length in seconds to which the data can be padded out. The padding will determine your spectral resolution. The option 'nextpow2' rounds the maximum trial length up to the next power of 2. By using that amount of padding, the FFT can be computed more efficiently. 'nextpow2'

Note that MOST OF THE MICROSTATE ANALYSIS IN BRAINSTORM CAN BE DONE DIRECTLY IN THE GUI.

You may be prompted to update the version of Brainstorm as of February 5th 2020, in which case you should accept and rerun the previous code when matlab restarts. For the microstate analysis we do, we have already epoched the data and split it (see ERP tutorial for information on how to do this). Create a filepath where

      PATHIN  = fullfile('/.../Research/TestFiles/ERPsInd/');     
      PATHOUT = fullfile('/.../Research/TestFiles/OUTPUT/'); 
      ProtocolInfo = bst_get('ProtocolInfo'); 
      Path_bs = [ProtocolInfo.STUDIES filesep];