interfacing EEG with MATLAB in real time

Thread Starter

mayank rob

Joined Sep 18, 2012
17
hello,
I am doing "Drowsiness estimation using EEG in real time" as my final year project,n i have just started with it.
It would be very help full if someone can tell me how should i load the data from EEG machine to MATLAB in real time.
is there any other software that we need to use in order to do the real time interfacing?
p.s.:i know the excel sheet method but that cannot be implemented for real time,isn't it the case??
 

MrChips

Joined Oct 2, 2009
30,824
There are three parts to the answer.

1) In the realm of digital computers there is no such thing as "real time". Computers take time to acquire data, process the data, and produce results. Hence there is a time delay between the action and reaction.

2) Quasi real time means producing results within a time frame to be acceptable for the particular application. When one takes into account persistence of vision, if the entire process can be accomplished in under 20ms one might have the perception of real time.

3) MATLAB has the ability to read an analog waveform from the LINE INPUT. You can use this to acquire analog data directly.
 

t06afre

Joined May 11, 2009
5,934
3) MATLAB has the ability to read an analog waveform from the LINE INPUT. You can use this to acquire analog data directly.
By line input I assume you mean using sound card. Sound cards are AC coupled and very seldom DC coupled(if at all). So they have a lower cut-off around 15Hz. According to John G Webster "Medical Instrumentation Application and Design" You need a frequency range from DC to 150Hz. So using a sound card is not recommend at all. In such an application
 

Attachments

MrChips

Joined Oct 2, 2009
30,824
aha! Very observant. I was just waiting to see who was listening.
I have done EEG recordings where the signal is converted to FM and then recorded.
 

t06afre

Joined May 11, 2009
5,934
aha! Very observant. I was just waiting to see who was listening.
I have done EEG recordings where the signal is converted to FM and then recorded.
Medical instrumentation is my field. And I have also toyed a lot with sound cards using Labview. Once mad a quite cool skin conductance measurement system using the sound card as interface. Ac measurement of course. So I guess this is my turf
 

Thread Starter

mayank rob

Joined Sep 18, 2012
17
so what to do nw??
because i dnt knw how is that sound card will be used....
and is that some diffrent kind of sound card or the same which is used in PC??
shall i go for that line input thing n try to demystify it or is there any beter method...
i knw i may be sounding amateur..but plz help coz m not very well aware of interfacing things with computer.....
n thanks alot for your suggestions
 

t06afre

Joined May 11, 2009
5,934
This is not twitter so please use plain English. And hold back on words like "plz" and "coz"
I think MATLAB support the use of some analog to digital converter card. Or it can be that the EEG equipment have some digital output like RS232. So to get any further in your project. You must get hold on the specification for the EEG equipment that will be used in your project. Why not ask your professor about this. A tip if a analog to digital converter card are to be used. It is in theory enough to use a 300Hz sample rate. But for any practical solution. Use at least 3KHz sample rate. If the card support this
 

justtrying

Joined Mar 9, 2011
439
depending on the device you are using, its software will have certain capabilities. Also check out Open EEG project for more resources including software. I was going to do an EEG based project as well but ended up switching to EMG, 4 month is not enough for EEG ;)
 

Thread Starter

mayank rob

Joined Sep 18, 2012
17
well I am sorry not to mention at the first place that i will be purchasing the machine directly,so what I will be doing is directly plugging and getting the digital data directly into computer,but the problem is i haven't purchased the machine yet and i am confused that when i will get the data,in which form it will be,i mean to say where it will be stored. And how can i load that stored data into MATLAB and do the processing part,in real time(theoretically). hope i am making my self clear.
and thanks to all of you,every ans was a step close adding up to my knowledge.
 

MrChips

Joined Oct 2, 2009
30,824
So a lot depends on that machine. If the machine dumps the data into a file, MATLAB can read the file and extract the data.
Or the machine might send the data to a COM port which MATLAB can also read.
 

Thread Starter

mayank rob

Joined Sep 18, 2012
17
how should i start with matlab??
i mean that i know how matlab works an all its basics,
but dedicated to this project i am confused that how should i start,
because matlab is very huge.
should i only focus my self to signal processing and FFT part or any more specific topics you can suggest.
please be as elaborate as you can.
i know that i am sounding amature,but here we dnt have good processors so its always like you are on your own..so please guide!! :)
 

MrChips

Joined Oct 2, 2009
30,824
No.
You start with the EEG recorder.
What is the sampling rate?
How does the recorder transfer the data to the PC?
What is the data transfer rate?
 

Thread Starter

mayank rob

Joined Sep 18, 2012
17
to mrChips-
we have found all the details of EEG machine,its sampling rate,A/D conversion,format of data given by the machine,sampling rate and probably all the details that we need at this point of time.
now we need to start withe coding part,and we are expecting our hardware to arrive in a month or so (ie:EEG machine).
but all we know of(or we can come up with)is to apply FFT to the obtained signal and obtain the various frequency components and do our classification according to β,Δ,α..waves.
the only thing troubling me is that everywhere on the net or even in IEEE papers i find mention of ICA(Independent component analysis) and i am still not able to figure out the role of ICA in this project,ans also use of
correlation coefficient,
blind source separation,
linear regression model!!!
all theses terms are very new to me so i am not able to figure out there role in this project,i am not even sure that they are necessary or not?
please guide.

to t06afre-
are you sure about that??
because i have never worked on labview,and also matlab is used in our academia so you know...its more preferable,although there is no harm in using labview if i want to.
but i will find it friendly and feel myself more comfortable working with matlab.
but anyways thanks for your suggestion,i will consider it as an option in case.
 

Thread Starter

mayank rob

Joined Sep 18, 2012
17
Labview is a very good tool for a problem like yours. Better than Matlab I would say.
well thanks allot for your suggestion,at the end i found that labview is the best software for my requirement.
I will be interfacing EEG EPOC with labview which according to my research till now tells me that its the most lenient way i can find.
please comment if you have any suggestions.
 
Top