P300 Experiment
P300 signals are brain signals that occur in response to a visual stimulus. They tend to occur approximately 300 ms after the stimulus appears.
Here, we show you how to use Mentalab Explore and an oddball experiment to elicit P300 signals. The code is open-source and available here. You can run it as is or use it to build your own P300 based applications.
In this experiment, the oddball experiment has two visual stimuli: a blue rectangle and a red oval. The red oval is the so-called "oddball". The participant must press `space` whenever the red stimulus appears.
Preparation
Software
- Install
explorepy
. Choose Option 2 (Python) if you are installingexplorepy
on a Windows system. - Download the
explorepy
code directly from GitHub. To do this, click on the greenCode
button, and “Download ZIP”. Remember where you extract the files, you will need this location later. - Activate your Anaconda virtual environment:
conda activate myenv
- Install the required packages:
pip install scikit-learn matplotlib psychopy mne
- In the Conda terminal, navigate to the
p300_demo
folder in theexamples
directory ofexplorepy
.
Hardware
- Setup the cap and electrodes. Place EEG electrodes in the desired locations (e.g. Cz, Pz, CP1, CP2, P3, P4, Oz, etc.) and the ground electrode on mastoid (or any other location far enough from other electrodes).
P300 Experiment
-
Turn on the device, ensure it is advertising, and then run the following command in your terminal (replace #### with your device ID, e.g. Explore_1438):
python experiment.py -n Explore_#### -f rec_file_name
The experiment has 10 blocks and there are 5 trials in each block (50 trials in total). You can change this in the
experiment.py
script. Just look out variables:n_blocks
andn_trials_per_block variables
.The experiment produces three csv files in the working directory; one for ExG data, one for motion data, and one for markers.
Results
-
To analyse the recorded data and generate plots, run the command in your terminal:
python analysis_csv.py -f rec_file_name
This analysis will generate P300 waveform plots that look similar to those shown below.
For more information or support, do not hesitate to get in contact at: support@mentalab.com