WB_EEG_CalcPower

Information and resources about the WeBrain tools
Post Reply
WeBrainTool
Posts: 14
Joined: Mon Apr 19, 2021 10:56 am

WB_EEG_CalcPower

Post by WeBrainTool » Mon May 24, 2021 9:43 pm

WB_EEG_CalcPower is a tool to calculate power indices using time-frequency analysis of EEGALB (using function timefreq()). Calculating power indices consists of:
[1] Specific event data can be extracted according to the input ‘eventlabel’. If the input ‘eventlabel’ is empty, all data will be used. If applicable, EEG segments in bad block (label 9999, marked by the tool WB_EEG_Mark) will also be rejected automatically, and NOT used to calculate power indices.
[2] Specific event EEG signals will be divided into small epochs.
[3] EEG data of each epoch (default is 5s epoch) was subjected to time-frequency analysis with Fast-Fourier Transform (FFT) to obtain the absolute EEG band power at each electrode in the specific bands. Each data epoch will be linearly detrended before time-frequency analysis.

Default frequency bands are delta (Nuwer et al., 1994), theta (Nuwer et al., 1994), alpha1 (Malver et al., 2014), alpha2 (Malver et al., 2014), beta1 (Jobert et al., 2013; Malver et al., 2014), beta2 (Jobert et al., 2013; Malver et al., 2014), beta3 (Jobert et al., 2013; Malver et al., 2014), gamma1 (Jobert et al., 2013; Nuwer et al., 1994) and gamma2 (Nuwer et al., 1994). Indices of power ratio (Kashefpoor et al., 2016; Snaedal et al., 2010; Thatcher et al., 2005) are r1, r2, r3, r4, r5 and r6, as well as peak of alpha frequency (PAF).
Default list of 27 indices:
delta: mean power across 1 - 4 Hz
theta: mean power across 4 - 8 Hz
alpha1: mean power across 8 - 10.5 Hz
alpha2: mean power across 10.5 - 12.5 Hz
beta1: mean power across 12.5 - 18.5 Hz
beta2: mean power across 18.5 - 21 Hz
beta3: mean power across 21 - 30 Hz
gamma1: mean power across 30 - 40 Hz
gamma2: mean power across 40 - 60 Hz
fullband: mean power across 1- 60 Hz
relative power in specific band = power of specific band/total power across fullband.
r1 = theta / (alpha1 + alpha2 + beta1);
r2 = (delta + theta) / (alpha1 + alpha2 + beta1 + beta2);
r3 = theta/alpha = theta / (alpha1+alpha2);
r4 = theta/beta = theta / (beta1 + beta2 + beta3);
r5 = delta/theta;
r6 = alpha/beta = (alpha1 + alpha2) / (beta1 + beta2 + beta3);
PAF (peak of alpha frequency) = max power in alpha (alpha1+alpha2) band.
More details about power indices of EEG data can be seen in relative papers (Chen et al., 2008; Kashefpoor et al., 2016; Malver et al., 2014; Nuwer et al., 1994; Snaedal et al., 2010; Thatcher et al., 2005).

Image
Fig. 5: Pipelines of calculating power indices of EEG data. (A) Calculating power indices of a specific event data. Step1: Specific event data are first extracted according to the input ‘eventlabel’ (e.g. label ‘22’). If applicable, EEG segments in bad block (label 9999, marked by WB_EEG_Mark) will also be rejected automatically, and NOT used to calculate power indices. Step2: Specific event EEG signals will be divided into small epochs. Step3: EEG data of each small epoch (default is 5s epoch) will be subjected to time frequency analysis with Fast Fourier Transform (FFT) to obtain the absolute EEG band power at each electrode in the specific bands. (B) Calculating power indices of all data. All data will be divided into small epochs first, and then data of each epoch (excluding bad blocks) will be used to calculate power indices.

Parameters
epochLenth: Length of small epochs to calculate power. Unit is second. Default is 5s. Epochs less than epochLenth will be not used to calculate indices. If epochLenth is negative, it means that if possible, data before event labels (eventlabel) will be used (no overlapped).
eventlabel: Event label which means specific event data. If it is empty, all data will be used to calculate indices. If eventlabel is not found in events, NO data will be epoched and calculated. If structure event (eventlabel) doesn’t include duration, the duration will be equal to epochLenth. DO NOT contain blank spaces in the event label (e.g. S 22). Strings of events will be compared ignoring space characters. Default is empty (‘[]’).
bandLimit: A string array with specific frequency bands. Default is ‘[1,4],[4,8],[8,10.5],[10.5,12.5],[12.5,18.5],[18.5,21],[21,30],[30,40],[40,60],[1,60]’. If it is ‘[]’, default bands will be used. Bands should be separated by comma.
bandName: A string array with names of frequency bands (separated by comma). bandName must be corresponding to bandLimit (e.g. bandName 1 is corresponding to bandLimit 1). Names of frequency bands are required and included in (‘delta’;’theta’;’alpha1’;‘alpha2’;’beta1’;’beta2’;’beta3’) for r1-r6 and PAF, or included in (‘delta’;’theta’;’alpha’;’beta’) for r3-r6 and PAF. For relative power indices, ‘fullband’ must be included in bandName (‘fullband’). Default is ‘delta, theta, alpha1, alpha2, beta1, beta2, beta3, gamma1, gamma2, fullband’. If it is ‘[]’, default band names will be used.
seleChanns: String with indices of the selected channels (e.g. ‘[1:4,7:30]’), or ‘all’. Default is ‘all’.
proportion: overlapped proportion for each segments/sliding windows. It should be [0,1). Default is 0 (no overlapped).
srate: Sampling rate of EEG data. It can be automatically detected in EEG data, if it is ‘[]’. But for ASCII/Float .txt File and MATLAB .mat File, users should fill the sampling rate by hand. Default is ‘[]’.
grouplabel: Group label of subject. It may be used to statistical analysis in the future. Default is ‘[]’.

Image
Fig. 6: If epochLenth is negative, it means that if applicable, data before event labels (eventlabel) will be used (no overlapped).

Note: EEG data will be imported as EEG structure using EEGLAB. EEG.data should be channels × time points OR channels × time points × epochs. If size of EEG.data is channels × time points × epochs (has been epoched), all data will be used to calculate power indices. If applicable, epochs in bad block (label 9999, marked by wb_EEG_Mark) will also be rejected automatically, and NOT used to calculate power indices.

Outputs
For each subject, output is a MATLAB .mat file (named power_*) in which is a structure EEG_results including power indices, mean indices across epochs and parameters.

EEG_results.type: type of results. i.e. ‘power’
EEG_results.filename: filename of EEG data;
EEG_results.Power: power across frequency bands (channels×bands×epochs);
EEG_results.Power_relative: relative power across frequency bands (channels×bands×epochs);
EEG_results.PAF : max power in alpha(alpha1+alpha2) band (channels×epochs);
EEG_results.R1 : r1 (channels×epochs);
EEG_results.R2 : r2 (channels×epochs);
EEG_results.R3 : r3 (channels×epochs);
EEG_results.R4 : r4 (channels×epochs);
EEG_results.R5 : r5 (channels×epochs);
EEG_results.R6 : r6 (channels×epochs);
EEG_results.Block_percentage: percentage of EEG data used to calculate indices
EEG_results.Power_mean: mean power across epochs (channels×bands);
EEG_results.Power_relative_mean : mean relative power across epochs (channels×bands);
EEG_results.R1_mean : mean r1 across epochs (channels×1);
EEG_results.R2_mean : mean r2 across epochs (channels×1);
EEG_results.R3_mean : mean r3 across epochs (channels×1);
EEG_results.R4_mean : mean r4 across epochs (channels×1);
EEG_results.R5_mean : mean r5 across epochs (channels×1);
EEG_results.R6_mean : mean r6 across epochs (channels×1);
EEG_results.PAF_mean : mean PAF across epochs (channels×1);
EEG_results.spectrum: frequency spectrum across each epochs (channels×freqs×epochs);
EEG_results.freqs: Frequencies of time-frequency analysis (1×freqs);
EEG_results.spectrum_mean: mean frequency spectrum across each epochs (channels×freqs);
EEG_results.grouplabel: group label of subject. It may be used to statistical analysis in the future.

EEG_results.parameter.WaveletCycles: The number of cycles for the time-frequency decomposition. Default is using FFTs and Hanning window tapering;
EEG_results.parameter.WaveletMethod: Wavelet method/program to use. Default is ‘dftfilt3’: Morlet wavelet or hanning DFT (exact Tallon baudry);
EEG_results.parameter.TaperingFunction: FFT Tapering function is ‘hanning’ function;
EEG_results.parameter.DetrendStr: ‘On’: Linearly detrend each data epoch before time-frequency analysis.
EEG_results.parameter.bandLimit: An array with specific frequency bands;
EEG_results.parameter.bandName: A cell array with band names;
EEG_results.parameter.eventlabel: An event label which means specific data;
EEG_results.parameter.selechanns: An array with selected channels;
EEG_results.parameter.epochLenth: Length of small epochs. Unit is time point.
EEG_results.parameter.srate: Sampling rate of EEG data.
EEG_results.parameter.proportion: Overlapped proportion for each segments/sliding windows;
EEG_results.parameter.chanlocs: channel locations.
EEG_results.parameter.ref: reference of EEG data.

Links
NIT
EEGLAB

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest