hello, i want to ask about how to move the motor in wheelchair with eeg data that i processed in matlab, please help because it's quite stuck, maybe i will use arduino or matlab directly

4 Comments

You need to research methods first.
https://www.frontiersin.org/articles/10.3389/fnhum.2014.00244/full
https://www.jneurosci.org/content/28/4/1000
i using ANN method
ANN? As in Artificial Neural Network?
So how is this going to work? You are going to record fixed length multiband segments of the user thinking some particular thought at some point during the segment, and you are going to create a list of what class (forward, back, left, right, stop, other) the recording represents, and you are going to train the neural network against that raw multiband data? With no filtering or feature extraction or pca or attempt to locate the beginning of the action in the signal?
i'm confused in filtering that raw data in the matlab program, and for the class list just to go ahead and stop only

Sign in to comment.

 Accepted Answer

Create a numeric array in which each row is a different (fixed-length) eeg sample, and in which you have another variable which indicates which class number each row is associated with.
Then at the command line command
nprtool
and use the tool to design an ANN for classification purposes.

7 Comments

clear all
clc
%% instantiate the library
disp('Loading the library...');
lib = lsl_loadlib();
% resolve a stream...
disp('Resolving an EEG stream...');
result = {};
while isempty(result)
result = lsl_resolve_byprop(lib,'type','EEG'); end
% create a new inlet
disp('Opening an inlet...');
inlet = lsl_inlet(result{1});
disp('Now receiving data...');
while true
% get data from the inlet
[vec,ts] = inlet.pull_sample();
% and display it
fprintf('%.2f\t',vec);
fprintf('%.5f\n',ts);
this is a program for displaying raw data from eeg, I use emotiv epoc x 14 channels
in a line where I can insert nprtool command
First you need to record samples into an array, by rows. Each sample should probably contain somewhere around one or two seconds worth of eeg readings, so call pull_sample as many times as needed to get one or two seconds of data. You would set up a situation where you give a prompt to someone to think a particular keyword, record the data for a second or two, make a row out of it, and store that along with a record of which class it is intended to be.
Once you have those sample rows and corresponding class information, save those in a mat file for future exploration.
Once you have those data arrays, then you go down to the command line and type in
nprtool
That will bring up a graphical interface that will allow you to create a variety of classification architectures, exploring to see which one works best for your purposes. You can also save the ANN that you have built.
Once you have a trained ANN then you would write a different program, one that would read in the same amount of samples as you trained the ANN on, and then pass the data through the ANN classification routine.
Note: you should always include in your training a class for "none of the above", for cases where the user is not actively thinking any of the commands. When you use an ANN classification, it will always return the training class that fits best, even if it is a terrible fit. If the current data has nothing to do with forward or stop, if there is a 0.3% match to Forward and a 0.28% match for Stop, you don't want Forward to be understood just because it has the marginally better bad match. So train on "none of those" in order for the ANN to have a "not Forward, not Stop" class it can match against.
I am confused to sort out the data stream because the displayed data stream also has "COUNTER" data,
"INTERPOLATED",
"RAW_CQ",
"MARKER_HARDWARE",
"MARKERS"
i plan to retrieve the data "AF3","F7","F3","FC5","T7","P7","O1","O2","P8","T8","FC6","F4","F8","AF4", only. maybe you know how?
Your sample code
[vec,ts] = inlet.pull_sample();
% and display it
fprintf('%.2f\t',vec);
fprintf('%.5f\n',ts);
is something that I recognize from some documentation I pointed you to the other day.
Notice that the values obtained are being returned as floating point in both cases -- vec is displayed with two decimal places and ts is displayed with 5 decimal places.
None of what is returned by pull_sample() has character strings.
Either there is a different way to read that kind of data, or else pull_sample is already parsing the character stream to extract values as numeric.
ok, I've found a way to retrieve, thanks in advance for the help

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!