P300 Experiment

P300 signals are brain signals that occur in response to visual stimuli. They usually appear approximately 300 ms after the stimulus is presented.

This example shows how to use Mentalab Explore with an oddball experiment to elicit P300 signals. The code is open-source and available here:

You can run the example as provided or use it as a basis for your own P300-based applications.

In this experiment, the oddball task uses two visual stimuli: a blue rectangle and a red oval. The red oval is the "oddball". The participant must press space whenever the red stimulus appears.

P300 visual stimuli

A blue rectangle is the standard stimulus. The red oval is the "oddball". When presented with the oddball, participants must press space.

Preparation

Software

  1. Install explorepy.

    Choose Option 2 (Python) if you are installing explorepy on a Windows system.

  2. Download the explorepy code directly from GitHub:

    To do this, click on the green Code button and then Download ZIP.

    Remember where you extract the files. You will need this location later.

  3. Activate your Anaconda virtual environment:

    conda activate myenv
  4. Install the required packages:

    pip install scikit-learn matplotlib psychopy mne
  5. In the Conda terminal, navigate to the p300_demo folder in the examples directory of explorepy.

Hardware

  1. Set up the cap and electrodes.

    Place EEG electrodes in the desired locations, for example Cz, Pz, CP1, CP2, P3, P4, Oz, etc.

    Place the ground electrode on the mastoid or any other location far enough from the other electrodes.

P300 Experiment

  1. Turn on the device and ensure it is advertising.

  2. Run the following command in your terminal.

    Replace ## with your device ID, for example Explore_1438:

    python experiment.py -n Explore_#### -f rec_file_name

The experiment has 10 blocks and 5 trials in each block, resulting in 50 trials in total.

You can change this in the experiment.py script by editing the variables n_blocks and n_trials_per_block.

The experiment produces three .csv files in the working directory: one for ExG data, one for motion data, and one for markers.

Results

  1. To analyse the recorded data and generate plots, run the following command in your terminal:

    python analysis_csv.py -f rec_file_name

This analysis generates P300 waveform plots similar to the example shown below.

P300 wave forms

Waveforms produced from the P300 oddball experiment using the Mentalab Explore device and explorepy.

For more information or support, contact support@mentalab.com.