EEG Preprocessing
Steps 1-4 create filters (e.g., from the ICA, segment labeling), which later get applied to the raw data starting in step 5.
All steps use FieldTrip and were executed within MATLAB 2020a.
01_prepare_preprocessing
- Prepare for ICA
- Read into FieldTrip format
- Switch channels
- EEG settings:
o Referenced to avg. mastoid (A1, A2)
o downsample: 1000Hz to 250 Hz
o 4th order Butterworth 1-100 Hz BPF
o no reref for ECG
02_visual_inspection
- Check for gross noise periods that should not be considered for ICA
03_ica
- Conduct initial ICA1, this should be run on tardis
04_ica_labeling
- Manual labeling of artefactual ICA components
05_segmentation_raw_data
- Segmentation: -1500 ms relative to fixcue onset to 1500 ms after ITI onset
- Load raw data
- Switch channels
- EEG settings:
o Referenced to avg. mastoid (A1, A2)
o 0.2 4th order butterworth HPF
o 125 4th order butterworth LPF
o demean
o recover implicit reference: A2
o downsample: 1000Hz to 500 Hz
06_automatic_artifact_correction
- Automatic artifact correction, interpolation
- Remove blink, move, heart, ref, art & emg ICA components prior to calculation
- get artifact contaminated channels by kurtosis, low & high frequency artifacts
- get artifact contaminated channels by FASTER
- interpolate artifact contaminated channels
- equalize duration of trials to the trial with fewest samples
o This is a hack. Apparently, we did not always get consistent timing on each trial, such that some trials were a bit shorter. To include these trials, I cut every trial to the lowest trial length.
o Interpolation to a general length may be the better option.
- get artifact contaminated epochs & exclude epochs recursively
- get channel x epoch artifacts
- Note that this does NOT yet remove anything. We only calculate the data to be removed in the next setp (I).
07_prep_data_for_analysis
- Remove blink, move, heart, ref, art & emg ICA components
- Interpolate detected artifact channels
- Remove artifact-heavy trials, for subjects with missing onsets, the missing trials are included here as ‘artefactual trials’, hence correcting the EEG-behavior assignment:
08_assignConditionsToData
- Remove additional channels
- Load behavioral data and add information to data