brain computer interface

4 views (last 30 days)
prabakaran munusamy
prabakaran munusamy on 31 Mar 2012
i need to do matlab codes to classify an eeg signal into alpha, beta, gamma, theta, and delta according to their frequencies.I have the data.And convert to excel file.I could it and can see the data.But I have to find the frequency.Could anyone guide me.
  1 Comment
Jan
Jan on 31 Mar 2012
Is the conversion to an Excel file really helpful? This will slow down the data import remarkably.
What kind of answer do you expect? A source, where you can find the definitions of the different wave types? The name of a commercial software, which can solve this? A complete M-file, which solves the problem, although the most details are not known yet?
I suggest to post the existing code and ask specific questions. Your former question have not been answered yet. Therefore I suggest this thread to: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer

Sign in to comment.

Answers (3)

Kosai
Kosai on 31 Mar 2012
prabakaran, if you have the wavelet toolbox, i think this code will help you to extract the all-bands(alpha,beta,....), i will assume that the Fs of your egg raw is 1000Hz
S = "your EEG-Data-Raw";
waveletFunction = 'db8';
[C,L] = wavedec(S,8,waveletFunction);
%%Calculation The Coificients Vectors
cD1 = detcoef(C,L,1); %NOISY
cD2 = detcoef(C,L,2); %NOISY
cD3 = detcoef(C,L,3); %NOISY
cD4 = detcoef(C,L,4); %NOISY
cD5 = detcoef(C,L,5); %GAMA
cD6 = detcoef(C,L,6); %BETA
cD7 = detcoef(C,L,7); %ALPHA
cD8 = detcoef(C,L,8); %THETA
cA8 = appcoef(C,L,waveletFunction,8); %DELTA
%%%%Calculation the Details Vectors
D1 = wrcoef('d',C,L,waveletFunction,1); %NOISY
D2 = wrcoef('d',C,L,waveletFunction,2); %NOISY
D3 = wrcoef('d',C,L,waveletFunction,3); %NOISY
D4 = wrcoef('d',C,L,waveletFunction,4); %NOISY
Gamma = wrcoef('d',C,L,waveletFunction,5); %GAMMA
Beta = wrcoef('d',C,L,waveletFunction,6); %BETA
Alpha = wrcoef('d',C,L,waveletFunction,7); %ALPHA
Theta = wrcoef('d',C,L,waveletFunction,8); %THETA
Delta = wrcoef('a',C,L,waveletFunction,8); %DELTA
...
  2 Comments
Nikitha Joshi
Nikitha Joshi on 17 Mar 2017
Can you please send me the matlab code for brain controlled robotic arm

Sign in to comment.


Aaditya Kalsi
Aaditya Kalsi on 1 Apr 2012
In general, you may be able to solve such problems by Classification. You may extract some features from your dataset, in your case, consider:
First collect ideal sample FFTs for each type (ALPHA BETA etc.)
1. FFT of length N (you may choose N) as your feature space. 2. Use CORRCOEFF on the ABS of the current times FFT with the ideal FFTs. The one with max. value is the type.
This would be an easy starting point without relying on specific toolboxes.

DSP
DSP on 12 Aug 2013
Hello Kalsi, I have the same problem. Can you please provide some MATLAB code to extract EEG features like correlation coefficient etc.. in details.Thanks a lot.

Categories

Find more on EEG/MEG/ECoG in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!