![]()
SCCN Home
EEGLAB Home
EEGLAB Tutorial
Data Analysis
I.5.1. Extracting epochs
To study the event-related EEG dynamics of continuously recorded data, we must extract data epochs time locked to events of interest (for example, data epochs time locked to onsets of one class of experimental stimuli).
KEY STEP 7: Extract data epochs.![]()
To extract data epochs from continuous data, select Tools > Extract epochs.
Click on the upper right button, marked "...", of the resulting pop_epochs() window, which calls up a browser box listing the available event types.
Here, choose event type "square" (onsets of square target stimuli in this experiment), and press "OK". You may also type in the selected event type directly in the upper text box of the pop_epochs() window.
Here, retain the default epoch limits (from 1 sec before to 2 sec after the time-locking event). If you wish, add a descriptive name for the new dataset. Then press "OK". A new window will pop up offering another chance to change the dataset name and/or save the dataset to a disk file. At this point, it can be quite useful to edit the dataset description -- to store the exact nature of the new dataset in the dataset itself, for future reference. Do this by pressing "Description". Accept the defaults and enter "OK".
Another window will then pop up to facilitate removal of meaningless epoch baseline offsets. This operation is discussed in the next section.
In this example, the stimulus-locked windows are 3 seconds long. It is often better to extract long data epochs, as here, to make time-frequency decomposition possible at lower (<< 10 Hz) frequencies.
I.5.2. Removing baseline values
Removing a mean baseline value from each epoch is useful when baseline differences between data epochs (e.g., those arising from low frequency drifts or artifacts) are present. These are not meaningfully interpretable, but if left in the data could skew the data analysis.
KEY STEP 8: Remove baseline values![]()
After the data has been epoched, the following window will pop up automatically. It is also possible to call it directly, by selecting menu item Tools > Remove baseline.
Here we may specify the baseline period in each epoch (in ms or in frames = time points) -- the latency window in each epoch across which to compute the mean to remove The original epoched dataset is by default overwriten by the baseline-removed dataset. Note: There is no uniformly 'optimum' method for selecting either the baseline period or the baseline value. Using the mean value in the pre-stimulus period (the pop_rmbase() default) is effective for many datasets, if the goal of the analysis is to define transformations that occur in the data following the time-locking events.
Press "OK" to subtract the baseline (or "Cancel" to not remove the baseline).Exploratory Step: Re-reference the Data.
This is a good time to save the epoched and baseline-removed dataset under a new name, as explained above, since we will be working extensively with these data epochs. You should also preserve the continuous dataset on the disk separately to allow later arbitrary re-epoching for various analyses. We might have saved the epoched dataset as a new file under a new filename using the pop_newset() window (above) (by pressing "Browse"). To save the current dataset at any other time, select File > Save current dataset or File > Save current dataset as from the EEGLAB menu. (In this case, these two menu items are equivalent, since we have not yet saved this dataset).The file-browser window below appears. Entering a name for the dataset (which should end with the filename extension ".set"), and pressing "SAVE" (below) and then "OK" (above) will save the dataset including all its ancillary information re events, channel locations, processing history, etc., plus any unique structure fields you may have added yourself - see the script writing tutorial.
The next tutorial discusses averaging the data epochs of epoched datasets.
Previous tutorial
Tutorial home
Next tutorial ![]()