├── csv-eeg-data
├── eegs.csv
├── readcsvfile.py
└── discreteFT.py
├── README.rst
├── EmokeyDemo
└── main.cpp
├── motionMindState
└── motionMindState.cpp
├── Tic-Tac-Toe
└── main.cpp
├── cogMain.cpp
└── Cognitive-TicTacToe
└── main.cpp
/csv-eeg-data/eegs.csv:
--------------------------------------------------------------------------------
1 | Engagement,Frustration,Meditation,Excitement
2 | 0.641123,0,0.316708,0.00186492
3 | 0.641123,0,0.316708,0.00186492
4 | 0.641123,0,0.316708,0.00186492
5 | 0.720896,0,0.301749,0.00577296
6 | 0.720896,0,0.301749,0.00577296
7 | 0.720896,0,0.301749,0.00577296
8 | 0.720896,0,0.301749,0.00577296
9 | 0.720896,0,0.301749,0.00577296
10 | 0.747991,0,0.296636,0.0114218
11 | 0.747991,0,0.296636,0.0114218
12 | 0.747991,0,0.296636,0.0114218
13 | 0.747991,0,0.296636,0.0114218
14 | 0.75829,0,0.299419,0.0180803
15 | 0.75829,0,0.299419,0.0180803
16 | 0.767428,0,0.302485,0.0411644
17 | 0.767428,0,0.302485,0.0411644
18 | 0.767428,0,0.302485,0.0411644
19 | 0.768346,0,0.305284,0.0733166
20 |
--------------------------------------------------------------------------------
/csv-eeg-data/readcsvfile.py:
--------------------------------------------------------------------------------
1 | # Root Mean Square value of the received data.
2 | # this file produces one centralised value of the data.
3 |
4 | import csv
5 | import math
6 | #reading the csv file
7 | with open('eegs.csv', 'rt') as csvfile:
8 | spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
9 | a_list = []
10 |
11 | row_count = 0
12 | for row in spamreader:
13 | a_list.append( row[0].split(','))
14 | row_count += 1
15 | #change value of m to number of columns in csv file
16 | m = 4
17 | n = row_count
18 | x = [0]*m
19 |
20 | print ("RMS Corresponding to Engagement, Frustration, Meditation, Excitation are:")
21 | for j in range(0,m):
22 | for i in range(1,n):
23 | x[j] = x[j] + float(a_list[i][j]) * float(a_list[i][j])
24 | #square root ox x1
25 | x[j] = math.sqrt(x[j]/n)
26 | print(x[j])
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/csv-eeg-data/discreteFT.py:
--------------------------------------------------------------------------------
1 | ##utility file to process the eeg data received in the form of csv format
2 | ## This file calculated discrete fourier transform of the data
3 |
4 | import csv
5 | import math
6 | import cmath
7 |
8 | a_list = []
9 |
10 | #reading the csv file
11 | file_name = 'EEG_Data.csv'
12 | with open(file_name, 'rt') as cfile:
13 | spamreader = csv.reader(cfile, delimiter=' ', quotechar='|')
14 |
15 | row_count = 0
16 | for row in spamreader:
17 | a_list.append( row[0].split(','))
18 | row_count += 1
19 |
20 | #define the value of 'm' as the number of columns in the csv file
21 | m = 22
22 | n = row_count
23 |
24 | x = [0]*m
25 | k = -1
26 | # K : deviation factor, by default equal to -1
27 | print ("Discrete Fourier transform in the order of colums:")
28 | for j in range(0,m):
29 | for i in range(1,n):
30 | x[j] = x[j] + float(a_list[i][j])*cmath.exp(complex(0.0,-2*math.pi*i*k/n))
31 | print(x[j]/n)
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/README.rst:
--------------------------------------------------------------------------------
1 | EPOC EMOTIV Programming
2 | =======================
3 | Intro
4 | -----
5 | A revolutionary personal interface for brain computer interacton.The Emotiv EPOC headset uses a total of 16 sensors,
6 | 14 for EEG data, 2 for gyro motions to tune into electrical signals produced by the brain to detect user thoughts,
7 | feelings, expressions and their mental state.
8 |
9 | Requirements
10 | ------------
11 |
12 | #. OS: Windows 7/8
13 | #. Programming Tool: Visual Basic C++ (tested with express 2010)
14 | #. EMOTIV SDK: Tested with education version.
15 |
16 | Installation
17 | ------------
18 | Those who spent bucks for the device, get ready with your Emotiv-SDK. SDK installation is fairly easier,
19 | you just have to follow the steps as mentioned in the installation guide.
20 |
21 |
22 | Getting Started
23 | ---------------
24 |
25 | First, wear the headset on your head, try to connect all the 16 sensors with the sdk control panel so that you get a
26 | good connection.
27 |
28 | Second, make sure you set up your applications to be 32 bit x86 in VB, otherwise they won't link to edk.dll
29 | which is 32 bit (unless you have SDK v2.0.0.20 or later which also has 64 bit versions).
30 | Make sure edk.dll and edk_utils.dll are in your project directory or search path. Then you should be
31 | able to build any of the examples in the SDK installation folder.
32 | The SDK manual has fairly comprehensive instructions on how to program for EPOC.
33 |
34 | Programming with glut(a library of utilities for OpenGL programs)
35 | -----------------------------------------------------------------
36 | `Configuring Visual C++ and GLUT `_
37 |
38 | Building & Running
39 | ------------------
40 |
41 | #. F7 for building (succeed without errors)
42 | #. F5 for running your app.
43 |
44 | Patches are welcomed
45 | --------------------
46 |
47 | .. code-block:: bash
48 |
49 | $ git clone https://github.com/codehunks/emotiv.git "emotiv"
50 | $ cd emotiv
51 |
52 |
53 | References
54 | --------------------
55 |
56 | [1] `EPOC EMOTIV `_
57 |
58 | [2] `OpenGL `_
59 |
--------------------------------------------------------------------------------
/EmokeyDemo/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | #include
12 |
13 | using namespace std;
14 | char output[100];
15 |
16 | int x=0,y=0,z=1,ctr=0,check=0;
17 |
18 | void blinkCursor() {
19 | if(z==1)
20 | glColor3f(1.0,0.0,0.0);
21 | else
22 | glColor3f(0.0,0.0,0.0);
23 |
24 | glBegin(GL_POLYGON);
25 | glVertex2d(0+x,0+y);
26 | glVertex2d(200+x,0+y);
27 | glVertex2d(200+x,200+y);
28 | glVertex2d(0+x,200+y);
29 | glEnd();
30 | glFlush();
31 |
32 | }
33 |
34 | void display(void){
35 |
36 | /*glClearColor(0.0,0.0,0.0,0.0);
37 | glClear(GL_COLOR_BUFFER_BIT);
38 |
39 | glLineWidth(2);
40 |
41 | glMatrixMode(GL_PROJECTION);
42 | glLoadIdentity();
43 |
44 | glOrtho(0, 600, 0, 600, -1, 1);
45 |
46 | glColor3f(1.0,0.0,0.0);
47 |
48 | glBegin(GL_POLYGON);
49 | glVertex2d(100,100);
50 | glVertex2d(200,100);
51 | glVertex2d(200,200);
52 | glVertex2d(100,200);
53 | glEnd();
54 | glFlush();*/
55 | glClearColor(0.0,0.0,0.0,0.0);
56 | glClear(GL_COLOR_BUFFER_BIT);
57 |
58 | glLineWidth(2);
59 |
60 | glMatrixMode(GL_PROJECTION);
61 | glLoadIdentity();
62 |
63 | glOrtho(0, 600, 0, 600, -1, 1);
64 |
65 | blinkCursor();
66 |
67 | }
68 |
69 |
70 | void updateScreen(void)
71 | {
72 | char c;
73 | ctr++;
74 | if(ctr%150==0){
75 | ctr=0;
76 | z*=-1;
77 | }
78 | if(_kbhit())
79 | {
80 | c = getch();
81 | cout<
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include