Research Use of Emotiv EPOC

P300 and Emotiv EPOC: Does Emotiv EPOC capture
real EEG?

Posted on October 7, 2011 by Hiran Ekanayake (Originally on
December 25, 2010)

For my earlier article titled “P300 and
Emotiv EPOC: Does Emotiv EPOC capture real EEG?” I received
an enormous response from various interested parties. Since I’m
continuously using the Emotiv EPOC for my research work with good
confidence, I thought of extending the discussion about the good
side of it with some convincing results. About two years ago, when
I first encounted Emotiv, I discussed about it with some neuroscientists.
However, they were very reluctant to believe that such a device
can capture real EEG, and they tended to disregard it merely considering
it as a toy. However, about two years later, now, I can see a lot
of research papers appears in the web that have used the Emotiv
EPOC. As a researcher, a person should look into things critically,
but with an open mindset. Therefore, I hope this small article will
help for some of you to rethink about the Emotiv and its capabilities.

Some Details About Emotiv EPOC

Table 1 Specification of the Emotiv EPOC

Figure 1 Scalp locations covered by Emotiv EPOC

A Brief Introduction to P300, and How it
is Obtained?

The P300 (or P3) is one of the components in an
ERP waveform (Figure 2). It is a positive deflection in voltage
(2-5µV) with a latency of about 300-600ms from the stimulus
onset. It is typically measured by placing electrodes covering the
regions Fz, Cz and Pz (Figure 3). Since, the strength of an ERP
signal is very low it is usually hidden within noise and not visible
in a typical EEG signal. Therefore, to see the actual ERP waveform
we have to average segments of single-trial ERP (called epochs)
which comes by repeating the experiment for several times (trials).
Before averaging, it would be necessary to bandpass filter the original
EEG signals (typically the pass band within 1-20Hz) and remove artifacts
resulting from various sources, such as eye movements. The whole
process can be done using the EEGLAB toolbox.
The most popular experiment for obtaining P300 is called the P300-speller
(Figure 4), which is a 6x6 matrix of alphanumeric characters where
one of its rows or columns gets flashed at a time, randomly, resulting
a sequence of flashes (also called the odd-ball paradigm). During
each such sequence, the subject focuses on one of the characters
in the matrix and whenever the subject sees a flash occurs in the
cell that contains the character, the subject has to advance his/her
count of flashes (just a mental activity, not to shout). OpenViBE
is an open source tool for setting up P300 experiments and for designing
various other neurofeedback applications. After the experiment,
the averaged EEG epoch signals (meant for each EEG channel) for
targets (flashes of focused cells) are compared against averaged
EEG epoch signals for non-targets (flashes of non-focused cells).
What we would expect is that signals for targets should have ERP
characteristics while non-target signals should end up with random
noise. However, random artifacts within EEG and latencies of events
could significantly distort the resulting ERP waveforms.

All the experiments conducted here are single subject
experiments unless specifically stated. For the P300 visual stimulus,
I have employed OpenViBE version 0.11.0 and the experiment design
is shown in Figure 5. Both flash duration and non-flash duration
have been set to 125 milliseconds. The Run Command boxes are linked
to a console program which sends makers on experiment start, target
stimulus and non-target stimulus to the EEG recording application
over UDP. I have not employed TestBench, because it can receive
markers only through the serial port and could result longer latencies
when loop back solution is used. On the other hand, although OpenViBE
can be configured to record EEG as well, I refrained from that option
as well because it did not promise me a reliable data recording
(higher system load for OpenViBE). I have collected data using two
Emotiv EPOC headsets, one of which is a bit older one. Other than
for P300 visual stimulus, I have conducted an auditory stimulus
test, in which a beeper emits a beep sound for every 5 seconds (non-random
duration) and subject was sitting in less than 1 meter to the recording
computer with opened eyes. Recorded EEG data has been filtered for
a pass band of 1-20 Hz and eye movement artifacts and other strange
artifacts have been manually removed. Almost all data processing
has been performed using MATLAB and EEGLAB toolbox.

Figure 6 depicts a promising appearance of ERP
waveforms in each EEG channel and it is visible that something has
happened about 305 milliseconds after the stimulus. The waveform
for non-target stimulus in Figure 7 does not show such a tendency.
When the powers of the signals (values in y-axis) are compared,
waveforms for non-target events (Figure 7) have lower power than
for target events. From Figure 8, it is visible that channels 7
and 8 (O1 and O2 scalp positions, respectively) have the highest
amplitude ERP waveforms. Therefore, Figure 10 has been obtained
to see how it looks like in each single-trial, which seems to be
somewhat linear. Figures 12 and 13 again compares ERP waveforms
for target and non-target events at both O1 and F4 scalp locations
to clearly differentiate the resulting waveforms.

Figures 14 and 15 shows the results obtained using
the second Emotiv EPOC headset:

Figures 14 and 15 again present promising appearance
of ERP waveforms. However, now the highest peak has been occurred
about 266 after the stimulus, which is lower than the value obtained
for the first Emotiv EPOC headset. This could be due to several
reasons: communication latencies between different programs during
the two occasions, subject’s mental condition has been changed,
two headsets are different in some ways, etc. On the other hand,
the highest peak point may be N2 rather than P3. Further, repeating
of this P300 experiment has resulted me different peak points for
each Emotiv EPOC headset, but centralized around 300 milliseconds.
Therefore, it is not reasonable to believe that P300 response occurs
exactly 300 milliseconds after the stimulus. However, hopefully
Emotiv EPOC can capture that response, which I consider as the good
side of the Emotiv EPOC.

Figures 16 and 17 shows ERP behavior for auditory stimulus:

Figure 16 ERP waveforms of all channels for auditory
stimulus

Figure 17 ERP waveforms of F3 for each trial for
auditory stimulus

From Figures 16 and 17, it is apparent that the
brain functions differently for auditory stimulus. However, the
time for perception seems to be somewhat closer to that resulted
in visual stimulus.

Repeating the Experiment

There were several requests asking about how to
setup the software framework to replicate this experiment. Therefore,
I thought describing it here. Please feel free to contact me if
the steps are unclear or need more details.

Read the instructions and create a COM port
pair in com0com, e.g. COM1-COM2

Modify the windows environment variables’
path variable by including the folder where the PortWrite.exe
can be found (file is in P300New)

In the TestBench select one of the ports
in the created pair, e.g. COM1 (follow Marker > Configure
Serial Port)Open the command prompt and type “PortWrite
COM2 2”. If you are successful in setting up the path
variable and COM port pair, you will see that TestBench receives
the marker value 2

Restart the OpenViBE and run the model p300speller2.xml
(to run use the start button in the OpenViBE designer; Also
you will need to click on the window with the title “keyboard
stimulator” and press on the 'a' key on the keyboard).
Now if you can see flashing rows and columns in the OpenViBE
visualization window as well as markers in the TestBench, your
first task is complete. Note that marker value 3 indicates the
start of the experiment, value 1s when targets are displayed
and 2s when non-targets are displayed.
Note: I assumed that you have Emotiv
EPOC research edition in which the TestBench software is
included.

Analyzing the EEG data using MATLAB (my version
7.6.0 R2008a) and EEGLAB (my version 10.2.3.4b):

If you use TestBench to record EEG your
recorded file will be in EDF format. To convert it into CSV
format use the EDF to CSV converter tool in TestBench

Now, you need to extract the relevant fields
from the CSV file in MATLAB, i.e. 14 EEG positions and markers.
To do that you have to import the CSV file data to MATLAB and
remove the column numbers other than column numbers 3:16 and
36.

Import the data file in EEGLAB (File >
Import data > From ASCII/float file or Matlab array) by specifying
the sample rate as 128. Note: EEGLAB can be downloaded from
http://sccn.ucsd.edu/eeglab/