Awesome Open Source
Awesome Open Source

Dataset of Concurrent EEG, ECG, and Behavior with Multiple Doses of transcranial Electrical Stimulation

This repository contains supporting code for the GX dataset. For an in-depth description of the dataset please see the accompanying dataset publication. Please cite this work as:

Gebodh, N., Esmaeilpour, Z., Datta, A. et al. Dataset of concurrent EEG, ECG, and behavior with multiple doses of transcranial electrical stimulation. Sci Data 8, 274 (2021).



A dataset combining high-density electroencephalography (EEG) with physiological and continuous behavioral metrics during transcranial electrical stimulation (tES; including tDCS and tACS). Data includes within participant application of nine High-Definition tES (HD-tES) types targeted three brain regions (frontal, motor, parietal) with three waveforms (DC, 5Hz, 30Hz), with more than 783 total stimulation trials over 62 sessions with EEG, physiological (ECG or EKG, EOG), and continuous behavioral vigilance/alertness metrics.

Experiment Overview


Experiment Overview: (a) Behavioral Task. (b) EEG and stimulation layout in 2D. (c) MRI-derived 3D head model with stimulation montage. (d) Task set-up. (e) Experiment 1 programmed block design with (f) trigger details. (g) Experiment 2 block design with (h) trigger details.  

Experiment 1: Example participant's data


Experiment 2: Example participant's data


Data availability

What format is the GX dataset available in?

Getting Started

Right away

What do I need to get started right away?

You can get started right away by using the downsampled .mat files linked to in the main data repository see 'Extras' here. The .mat files are compatible with MATLAB and Python (other platforms have not been tested). Each of the files contains the ~70 min recording combined with the CTT data and information on the stimulation trials.

What's in the dowsampled .mat files?

The .mat files contain a matlab structre that contains the following:

  • DSamp
    • triggers <- These are all the labeled EEG/Stimulation start/stop triggers
    • EEGdata <- Contains the downsampled EEG/ECG/EOG voltage data dims: 35 channelss X ~4E6 samples
    • fs <- The downsampled sampling frequency of the data : 1000 Hz
    • fsOld <- The original sampling frequency of the data
    • time <- Time vector for the data. Should be 1 X ~4E6
    • label <- Contains the channel label information. BIP1= ECG, BIP2=EOG, RESP1= N/A
    • nchan <- The number of channels in the data
    • rate <- Redundant to fs, sampling rate of data
    • npt <- Number of data points ~4E6
    • Subj <- Subject and session that data belong to. I.e. 0302 - Subject 03 session 03
    • ptrackerPerf <- The CTT data deviation/ the behavioral data
    • ptrackerTime <- Time vector for the CTT data
    • ptrackerfs <- The sampling frequency for the CTT data 100 Hz.

From scratch

I want to get started with the raw data in .cnt format

To get started with the EEG, ECG, EOG data in .cnt format, start with the folder set up below. Once everything is set up you can run either GX_Exp1_CTT_GeneralAnalysis.m to get results for Experiment 1 or GX_Exp2_CTT_GeneralAnalysis.m to get results for Experiment 2. Please be sure to adjust all the hardcoded paths accordingly.

Folder set up

Generally the project folder is set up as below:

    +--0101 (Participant number: 01 and session number: 01)
            |--ptracker-0101.csv (Behavioral Data)
            |-- ptracker-summary-0101..txt
        |--GX_01_2019-09-24_15-45-53.cnt  (EEG, ECG, EOG data)
    +--0102 (Participant number: 01 and session number: 02)
    +--0103 (Participant number: 01 and session number: 03)
    +--0104 (Participant number: 01 and session number: 04)

File naming convention

The files are ordered by each subject/participant's session. For example participant 1's third session would be labeled 0103. Here "01" indicates the participant ID and "03" indicates the session number. Note that some participants returned to repeat the experiment and were assigned new participant IDs. 

Participants who repeated the experiment:

Repeated sessions with different current intensities

   |--> Session 0101 was repeated as 0102
   |--> Session 0103 was repeated as 0106
   |--> Session 0104 was repeated as 0105   

Repeated sessions with same current intensities

   +New assigned ID 19
   |--> Session 1201 was repeated as 1902
   |--> Session 1202 was repeated as 1901 
   +New assigned ID 18
   |--> Session 1501 was repeated as 1802
   |--> Session 1502 was repeated as 1801 
    +New assigned ID 25
    |--> Session 2101 was repeated as 2502 
    |--> Session 2102 was repeated as 2501
    +New assigned ID 26
    |--> Session 2101 was repeated as 2601 
    |--> Session 2102 was repeated as 2602
    +New assigned ID 23 
    |--> Session 2201 was repeated as 2302
    |--> Session 2202 was repeated as 2301
    +New assigned ID 24
    |--> Session 2201 was repeated as 2401
    |--> Session 2202 was repeated as 2402

Data visualization and plotting

I want to look at individual stimulation trials

To pull out and look at all the stimulation trials for the whole study you can do so by running the GX_PullingDataIntoTrials_PlottingTopoplots.m script. This script runs through all the data and pull out the EEG and CTT data into 30 sec Pre During Post stimulation trials. Please pay attention to the code flags which allow for the plotting and saving for different things.

All trials for both experiments are indexed on Figshare.

  • The trials plotted as timeseries, spectrograms, and behavioral CTT, similar to below, can be found here


  • The PSD's across trials, similar to below, can be found here


  • The topoplots during stimulation across trials, similar to below, can be found here



The files are too large how do I downsample them?!

Since the raw data are sampled at 2 kHz moving and loading files may become difficult on some machines. If you would like to downsample the data please use the GX_DataDownSample.m script. The script features a GUI that allows you to paste in file names, locations, and downsample factor according to how much you want to downsample the data. The script assumes the file structure shown above.



I want to explore the demographic data of the study

To pull in and look at the demographic data of the study you can use the GX_PlottingDemographicInfo.m script. This pulls in the tabulated demogrpahic data that were compiled over the course of the study and plots them similar to below.



Portions of this study were funded by X (formerly Google X), the Moonshot Factory. The funding source had no influence on study conduction or result evaluation. MB is further supported by grants from the National Institutes of Health: R01NS101362, R01NS095123, R01NS112996, R01MH111896, R01MH109289, and (to NG) NIH-G-RISE T32GM136499.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Dataset (33,031
Matlab (30,892
Eeg (1,636
Neuroscience (1,043
Spectrogram (843
Ecg (157
Heart Rate (133
Eeg Signals (74
Eeg Analysis (62
Ecg Signal (57
Eeg Data (45
Physiology (28
Physiological Signals (16
Tac (14
Physiological Data (9
Behavioral Analytics (5
Tdcs (3