4.81818

4.8 | 11 ratings Rate this file 60 Downloads (last 30 days) File Size: 6.3 KB File ID: #36111
image thumbnail

EmotivEEG headset toolbox

by

 

Used to query the EDK library in order to recieve EEG data from the Emotiv EEG headset

| Watch this File

File Information
Description

--------------------
__ Instructions __
--------------------
1) Add this directory to the toolbox directory of matlab
2) Add the directory to the matlab path
3) Connect the bluetooth dongle
4) Turn on the headset
5) Put on head
6) Type "help EmotivEEG" into matlab command line

%% Usage;
% To create the object
a = EmotivEEG;

% % To start a timmer (keeps running until stopped) and get latest data
a.Run

% % To plot the latest /c data variable values
a.Plot

% % To stop the timmer
a.Stop

% % To record 10 seconds of data and save to a file
a.Record(10)

% % To load recorded data from file into /c data variable (NOTE if you have a timer on this will be overwritten)
LoadRecordedData(self,filename)

% % To disconnect and unload the library
delete(a)

__ Files in Toolbox __
(note dlls currently MUST to be supplied by you (if you have a Emotiv headset you have these dlls and headers. Recommend that you put the required files in same directory as the toolbox ):
--------------------
22/03/2011 01:37 18,225 EmoStateDLL.h
22/03/2011 01:38 1,921,024 edk.dll
18/07/2011 16:08 39,031 edk.h
22/03/2011 01:38 2,011,136 edk_utils.dll
22/03/2011 01:37 2,945 edkErrorCode.h
15/03/2012 12:05 14,513 EmotivEEG.m
15/03/2012 12:04 303 ExampleUsage.m
15/03/2012 12:04 1,060 README.txt

MATLAB release MATLAB 7.10 (R2010a)
Other requirements You need a Emotiv EEG headset and the api files that come with it from Emotiv. EmoStateDLL.h edk.dll edk.h edk_utils.dll edkErrorCode.h I'd like to be able to provide them (for API version sanity) but I am checking with Emotiv to make sure it is ok.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (34)
03 Sep 2014 Ajay Kulkarni

In which matlab did you try this tool? r2010? I'm getting the following error.
Warning: Message from C preprocessor:
lcc preprocessor error: C:\Program Files\MATLAB\R2010b\toolbox\EmotivToolBox\edk.h:17 Could not find
include file <string>
lcc preprocessor error: C:\Program Files\MATLAB\R2010b\toolbox\EmotivToolBox\edk.h:18 Could not find
include file <sstream>

> In loadlibrary at 371
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Warning:
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_ExpressivTrainingControl_enum{EXP_NONE=0'
exceeds MATLAB's maximum name length of 63 characters and has been truncated to
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv'.
> In edk_proto at 10
In loadlibrary at 432
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********

No match found for enum value expression EE_ExpressivAlgo_t in 0x0800}EE_ExpressivAlgo_t;typedefenumEE_AffectivAlgo_enum{AFF_EXCITEMENT=0x0001 expression ignored.
Found on line 444 of input from line 653 of file C:\Program Files\MATLAB\R2010b\toolbox\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_AffectivAlgo_t in 0x0010}EE_AffectivAlgo_t;typedefenumEE_CognitivAction_enum{COG_NEUTRAL=0x0001 expression ignored.
Found on line 444 of input from line 653 of file C:\Program Files\MATLAB\R2010b\toolbox\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_CognitivAction_t in 0x2000}EE_CognitivAction_t;typedefenumEE_SignalStrength_enum{NO_SIGNAL=0 expression ignored.
Found on line 444 of input from line 653 of file C:\Program Files\MATLAB\R2010b\toolbox\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_Event_t in 16|32|64|128|256|512|1024}EE_Event_t;typedefenumEE_ExpressivEvent_enum{EE_ExpressivNoEvent=0 expression ignored.
Found on line 1097 of input from line 1165 of file C:\Program Files\MATLAB\R2010b\toolbox\EmotivToolBox\edk.h
*********
Warning: The following error was caught while executing 'EmotivEEG' class destructor:
Library was not found
??? Error using ==> loadlibrary at 477
There was an error running the loader mfile. Use the mfilename option
to produce a file that you can debug and fix if needed. Please report
this error to the MathWorks so we can improve this function.

Error in ==> EmotivEEG>EmotivEEG.EmotivEEG at 73
[notfound,warnings] = loadlibrary('edk.dll','edk.h');
%#ok<NASGU,ASGLU>

Caused by:
Error using ==> struct
Invalid field name "EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv"

15 Jul 2014 Dabira

Hoe to select compiler?
Its asking Please select from 0-1?

The error was:
Warning: The following error
was caught while executing
'EmotivEEG' class destructor:
Library was not found
??? Error using ==>
loadlibrary>lFullPath at 547
Could not find file edk.h.

Error in ==> loadlibrary at
220
header=lFullPath(header);

Error in ==>
EmotivEEG>EmotivEEG.EmotivEEG
at 73
[notfound,warnings]
=
loadlibrary('edk.dll','edk.h');
%#ok<NASGU,ASGLU>

14 May 2014 Bao

hello Jarin.
you should edit toolbox to using in GUI.
your error : may be you lack of 'self' variables when call function or variable 'self' was wrong

01 May 2014 Ronald Allan Jarin

hello i am currently using your code here.. i am attempting to create a GUI and having a difficulty in accessing the recorded data..
i am encountering this error using the code
>>LoadRecordedData(self,filename)
Undefined function or variable 'self'.

01 May 2014 Ronald Allan Jarin

hello i am currently using your code here.. i am attempting to create a GUI and having a difficulty in accessing the recorded data..
i am encountering this error using the code
>>LoadRecordedData(self,filename)
Undefined function or variable 'self'.

15 Apr 2014 Bao

you can contact by email: hoangbao2106@gmail.com
I was edit this toolbox. and now, I using Guide to realtime data.

14 Apr 2014 deepa

I got this error while running the EmotivEEG toolbox.
a = EmotivEEG;
Warning: Message from C preprocessor:
lcc preprocessor error: C:\Program Files (x86)\MATLAB\R2012b\toolbox\EmotivToolBox_submittedV1 (1)\EmotivToolBox\edk.h:17 Could not find include file <string>
lcc preprocessor error: C:\Program Files (x86)\MATLAB\R2012b\toolbox\EmotivToolBox_submittedV1 (1)\EmotivToolBox\edk.h:18 Could not find include file <sstream>

> In loadlibrary at 318
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Warning: 'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_ExpressivTrainingControl_enum{EXP_NONE=0'
exceeds MATLAB's maximum name length of 63 characters and has been truncated to
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv'.
> In edk_proto at 10
In loadlibrary at 375
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********

No match found for enum value expression EE_ExpressivAlgo_t in 0x0800}EE_ExpressivAlgo_t;typedefenumEE_AffectivAlgo_enum{AFF_EXCITEMENT=0x0001 expression ignored.
Found on line 444 of input from line 653 of file C:\Program Files (x86)\MATLAB\R2012b\toolbox\EmotivToolBox_submittedV1 (1)\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_AffectivAlgo_t in 0x0010}EE_AffectivAlgo_t;typedefenumEE_CognitivAction_enum{COG_NEUTRAL=0x0001 expression ignored.
Found on line 444 of input from line 653 of file C:\Program Files (x86)\MATLAB\R2012b\toolbox\EmotivToolBox_submittedV1 (1)\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_CognitivAction_t in 0x2000}EE_CognitivAction_t;typedefenumEE_SignalStrength_enum{NO_SIGNAL=0 expression ignored.
Found on line 444 of input from line 653 of file C:\Program Files (x86)\MATLAB\R2012b\toolbox\EmotivToolBox_submittedV1 (1)\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_Event_t in 16|32|64|128|256|512|1024}EE_Event_t;typedefenumEE_ExpressivEvent_enum{EE_ExpressivNoEvent=0 expression ignored.
Found on line 1097 of input from line 1165 of file C:\Program Files (x86)\MATLAB\R2012b\toolbox\EmotivToolBox_submittedV1 (1)\EmotivToolBox\edk.h
*********
Warning: The following error was caught while executing 'EmotivEEG' class destructor:
Library was not found
Error using loadlibrary (line 419)

There was an error running the loader file. Use the mfilename option to produce a file that you can debug and fix if needed. Please report this error to the MathWorks so we can improve this
function.

Error in EmotivEEG (line 73)
[notfound,warnings] = loadlibrary('edk.dll','edk.h'); %#ok<NASGU,ASGLU>

Caused by:
Error using struct
Invalid field name "EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv"

I am using Matlab 2012b (32 bits) and my edk.dll version is 2.0.0.20.
Is it because of this edk.dll version? Could someone please help to solve this error?

14 Mar 2014 aizmeng

I need help!!!
>> a = EmotivEEG;
Warning: Message from C preprocessor:
lcc preprocessor error: D:\matlab\toolbox\EmotivToolBox\edk.h:17 Could not find include
file <string>
lcc preprocessor error: D:\matlab\toolbox\EmotivToolBox\edk.h:18 Could not find include
file <sstream>

> In loadlibrary at 374
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Warning:
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_ExpressivTrainingControl_enum{EXP_NONE=0'
exceeds MATLAB's maximum name length of 63 characters and has been truncated to
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv'.
> In edk_proto at 10
In loadlibrary at 435
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********

No match found for enum value expression EE_ExpressivAlgo_t in 0x0800}EE_ExpressivAlgo_t;typedefenumEE_AffectivAlgo_enum{AFF_EXCITEMENT=0x0001 expression ignored.
Found on line 444 of input from line 653 of file D:\matlab\toolbox\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_AffectivAlgo_t in 0x0010}EE_AffectivAlgo_t;typedefenumEE_CognitivAction_enum{COG_NEUTRAL=0x0001 expression ignored.
Found on line 444 of input from line 653 of file D:\matlab\toolbox\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_CognitivAction_t in 0x2000}EE_CognitivAction_t;typedefenumEE_SignalStrength_enum{NO_SIGNAL=0 expression ignored.
Found on line 444 of input from line 653 of file D:\matlab\toolbox\EmotivToolBox\EmoStateDLL.h

No match found for enum value expression EE_Event_t in 16|32|64|128|256|512|1024}EE_Event_t;typedefenumEE_ExpressivEvent_enum{EE_ExpressivNoEvent=0 expression ignored.
Found on line 1097 of input from line 1165 of file D:\matlab\toolbox\EmotivToolBox\edk.h
*********
Warning: The following error was caught while executing 'EmotivEEG' class destructor:
Library was not found
??? Error using ==> loadlibrary at 480
There was an error running the loader mfile. Use the mfilename option
to produce a file that you can debug and fix if needed. Please report
this error to the MathWorks so we can improve this function.

Error in ==> EmotivEEG>EmotivEEG.EmotivEEG at 73
[notfound,warnings] = loadlibrary('edk.dll','edk.h');
%#ok<NASGU,ASGLU>

Caused by:
Error using ==> struct
Invalid field name
"EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv"

How to solve it ??? Give me some detail process

25 Feb 2014 Payam Parsinejad

Hi,
- before using EmotivEEG, first you need to change the C compiler to LCC 32 bit version. This is done by executing follwoing commad:

-mex setup
and select the LCC compiler 32 bi2 version.

so far the only draw back is the 32bit version. This is also tested in 2011a and b, 2012b

This would resolve the library load issue

02 Dec 2013 Igor

Hello!

Is it really so important to use R2010a version of MatLab?
I have R2010b version and I get the same errors as in previous comments. I have all the necessary files, but still it doesn't work.

27 Nov 2013 Rakib Al-Fahad

I get this error:
>> a = EmotivEEG;
Warning: The following error was caught while executing 'EmotivEEG' class destructor:
Library was not found
Error using loadlibrary>lFullPath (line 587)
Could not find file edk.h.
Error in loadlibrary (line 220)
header=lFullPath(header);
Error in EmotivEEG (line 73)
[notfound,warnings] = loadlibrary('edk.dll','edk.h'); %#ok<NASGU,ASGLU>
please give solution

17 Nov 2013 Rakib Al-Fahad

I get this error:
>> a = EmotivEEG;
Warning: The following error was caught while executing 'EmotivEEG' class destructor:
Library was not found
Error using loadlibrary>lFullPath (line 587)
Could not find file edk.h.
Error in loadlibrary (line 220)
header=lFullPath(header);
Error in EmotivEEG (line 73)
[notfound,warnings] = loadlibrary('edk.dll','edk.h'); %#ok<NASGU,ASGLU>

please give solution

11 Nov 2013 Laura

I get this error:

>> a = EmotivEEG;

Warning: The following error was caught while executing 'EmotivEEG' class destructor:
Library was not found
Error using loadlibrary>lFullPath (line 587)
Could not find file edk.h.

Error in loadlibrary (line 220)
header=lFullPath(header);

Error in EmotivEEG (line 73)
[notfound,warnings] = loadlibrary('edk.dll','edk.h'); %#ok<NASGU,ASGLU>

22 Sep 2013 Ahmed Abdullah

Thanks a lot for providing this toolbox.

13 Jun 2013 Amir Homayoun

Hi,

Thanks for providing this toolbox. It is very helpful. I have two questions.

1. Is it possible to use this toolbox in MAC?
2. How can you record Markers along with data?

Very many thanks.

Greetings,
Amir

11 Apr 2013 David

Hi,
First I have to thank for the effort of coding and online method in Matlab to capture the Emotive Data.
After saying that, i have a problem:

Error using calllib
Method was not found.

Error in EmotivEEG (line 87)
self.hData = calllib('edk','EE_DataCreate');

Error in ExampleUsage (line 2)
h = EmotivEEG;

I don't know if the function was deprecated. Or its just that I have to update something.
I really appreciated any help in this matter.
Cheers,
David

15 Jan 2013 SC

When I call
Code
a=EmotivEEG;
ans = a.data;

I assume that the first column in ans will be the indices (rolling from 0 to 128). Am I right?
A detailed description of the problem is posted at http://www.emotiv.com/forum/forum19/topic589/?PAGEN_1=2

07 Jan 2013 Qasem  
25 Sep 2012 shuy8

Hi, i have one question
somebody know that means the values of the graphic when i write a.Plot

24 Aug 2012 Alex Frid

Nice!!

03 Aug 2012 Dr. Rami Khushaba

Hi All

To make this toolbox work:

1- Make sure you have Matlab 32-bit version installed and "NOT" 64-bit version.
2- type "mex -setup" and choose the LCC compiler as your default compiler.This is only available in the 32-bit version.
3- Toolbox should work fine now.

28 Jun 2012 Pototo

I get this error

Warning: Message from C preprocessor:
lcc preprocessor error:
C:\Users\Pototo\Documents\Dropbox\Public\Programming\MATLAB\jPL\edk.h:17 Could not
find include file <string>
lcc preprocessor error:
C:\Users\Pototo\Documents\Dropbox\Public\Programming\MATLAB\jPL\edk.h:18 Could not
find include file <sstream>

> In loadlibrary at 318
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Warning:
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_ExpressivTrainingControl_enum{EXP_NONE=0'
exceeds MATLAB's maximum name length of 63 characters and has been truncated to
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv'.
> In edk_proto at 10
In loadlibrary at 375
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********

No match found for enum value expression EE_ExpressivAlgo_t in 0x0800}EE_ExpressivAlgo_t;typedefenumEE_AffectivAlgo_enum{AFF_EXCITEMENT=0x0001 expression ignored.
Found on line 412 of input from line 598 of file C:\Users\Pototo\Documents\Dropbox\Public\Programming\MATLAB\jPL\EmoStateDLL.h

No match found for enum value expression EE_AffectivAlgo_t in 0x0008}EE_AffectivAlgo_t;typedefenumEE_CognitivAction_enum{COG_NEUTRAL=0x0001 expression ignored.
Found on line 412 of input from line 598 of file C:\Users\Pototo\Documents\Dropbox\Public\Programming\MATLAB\jPL\EmoStateDLL.h

No match found for enum value expression EE_CognitivAction_t in 0x2000}EE_CognitivAction_t;typedefenumEE_SignalStrength_enum{NO_SIGNAL=0 expression ignored.
Found on line 412 of input from line 598 of file C:\Users\Pototo\Documents\Dropbox\Public\Programming\MATLAB\jPL\EmoStateDLL.h

No match found for enum value expression EE_Event_t in 16|32|64|128|256|512|1024}EE_Event_t;typedefenumEE_ExpressivEvent_enum{EE_ExpressivNoEvent=0 expression ignored.
Found on line 1053 of input from line 1139 of file C:\Users\Pototo\Documents\Dropbox\Public\Programming\MATLAB\jPL\edk.h
*********
Warning: The following error was caught while executing 'EmotivEEG' class
destructor:
Library was not found
Error using loadlibrary (line 419)

There was an error running the loader file. Use the mfilename option to produce a
file that you can debug and fix if needed. Please report this error to the
MathWorks so we can improve this function.

Error in EmotivEEG (line 73)
[notfound,warnings] = loadlibrary('edk.dll','edk.h');
%#ok<NASGU,ASGLU>

Caused by:
Error using struct
Invalid field name
"EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv"

I put all the edk.lib and edk.dll, etc, in the matlab folder along with the toolbox, but it still does not work. Also, I don't know how to get access to those libraries such as <sstream>, and all those above at the beginning of the message.

Can you provide a better instruction set on how to set up this library in the appropriate manner?

Than you

28 Jun 2012 Pototo

is there a way to connect more than one headset with this toolbox?

thanks

25 Jun 2012 Brian Ho

I got a warning display "need Microsoft C or C++", for the loading libriaris. I am using 2010version. any suggestion

08 Jun 2012 Leo

It seems that there are multiple copies of header files and they are different. Try using these from "C:\Program Files\Emotiv Research Edition SDK_v1.0.0.5-PREMIUM\doc\examples_Matlab".

There are also multiple copies of dll files but they are the same on my computer.

08 Jun 2012 Leo  
20 Apr 2012 Agustín Uranga

Dear Gavin:

we have tried unsuccessfully to use your toolbos. We have corrected some previous errors but it still appears "Error loading library intermediate output follows.
The actual error is at the end of this output." We have tested the toolbox on Matlab 2008, 2009, 2010 and 2011. I really need your help. Regards

12 Apr 2012 Elias Reyes

I don't have any of those suggested versions. The version I have is 1.0.0.3

12 Apr 2012 Todor Yordanov  
11 Apr 2012 Gavin

Ug, more work I guess.
Elias can you confirm you are using the 1.0.0.5 version.

11 Apr 2012 Dr. Rami Khushaba

Elias: make sure you using edk.dll version 1.0.0.4 and not the recent 1.0.0.5 as this toolbox was developed just before the new release.

11 Apr 2012 Gavin

For the warning: First what version of matlab? I was using 2010a. None of my variables exceeds MATLAB's maximum name length of 63.

As for the other it is a library error. You need to make sure the dlls and headers have the same dates (i.e. are the same versions) as in the list. Look at the readme file to the dates of the dlls I am using. I want to provide these but I have not got permission from Emotiv. Do you have the same header and dlls files?

11 Apr 2012 Elias Reyes

Hello. I´m having some problems reading the headset data whit this toolbox.

This is my error:

%%%%%%%%%%%%%
%%%%%%%%%%%%%

>> a = EmotivEEG;
Warning:
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_ExpressivTrainingControl_enum{EXP_NONE=0'
exceeds MATLAB's maximum name length of 63 characters and has been truncated to
'EXP_SENSITIVITY}EE_ExpressivThreshold_t;typedefenumEE_Expressiv'.
> In edk_proto at 10
In loadlibrary at 395
In EmotivEEG>EmotivEEG.EmotivEEG at 73
Error loading library intermediate output follows.
The actual error is at the end of this output.

%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%

I hope you can help me. I could resolve the other warnings with types.h.

Regards.

Elías.

10 Apr 2012 Dr. Rami Khushaba  

Contact us