Spectrogram of EEG Signal
Show older comments
Hello
I have EEG signals which i need to classify, for that i need to change the EEG signals to the Images, i.e by taking spectrogram of the signal.
The data is recorded at 960hz, and it is in the format of number of channels x sampling ffrequency x iterations = 62 x 960 x 200. (for reference i am attaching the signal for 2 channels)
Can anyone please guide me how i can do that. ?
I tried spectrogram command but it only takes 1D data.
Thanks in advance.
6 Comments
Pratik Patil
on 23 Dec 2019
Image Analyst
on 23 Dec 2019
Edited: Image Analyst
on 23 Dec 2019
I'm not that familiar with EEG data. If the data are sampled at 960 Hz, then why is there an index (i.e., index #2) that indexes the sampling frequency? That would be like if you have 960 different signals, all with different sampling rates, rather than one signal sampled at one 960 Hz rate.
Joana
on 23 Dec 2019
Jesus Sanchez
on 23 Dec 2019
Edited: Jesus Sanchez
on 23 Dec 2019
For more info, do you intend to classify the 200 different measurements independently, or you want to create an average of all of them? I am thinking that if you need to classify 200 measurements, its quite costly to do it "by hand" so you will want to automatize the whole process. In this case, I would do:
- Pre-clean EEG data. Medical machines have noise at 50 Hz or 60 Hz, depending of your country.
- Now you have all signals in freq. domain. As far as I know, you should be able to see already the different EEG signals.
- Define how you want to classify the signals. Do they have different feaures that you can extract manually with MATLAB? Meaning, minimum peaks, concrete waveforms, etc.
- Classify the signals. I can think of two possibilities:
- 4.1: Do it by hand, programming the features recognition by yourself.
- 4.2: Try to train a neuronal network with MATLAB, that recognizes the different waveforms and classifies them. I did this with ocular movement signals and worked quite well. However, you will need to provide examples of the signals and their classification. Maybe you can find a database online or clasiffy by hand several of your signals. Not all of them, of course.
Joana
on 24 Dec 2019
Jesus Sanchez
on 26 Dec 2019
Edited: Jesus Sanchez
on 3 Jan 2020
It was around 3 years ago in a university project, but I think it should be like that. Each neurone is able to accept only one data as input. Therefore, you need as many neurons as the size of your signal (30000). Currently I do not have access to my lecture notes (cheers for holydays!) so I cannot tell you more in depth. However, I can give you several remarks:
- I guess you already classified the 200 signals. Meaning, you already knew which " EEG signal" they are. When training the NN, did you input all your signals? If you did that, what ou have is an overtrained and skewed NN, since it has been trained with the same data sample as the one used to check if it works.
- In order to train it properly, do not use all signals. As an example, if you want to train the NN to recognize 5 different patterns, and you have around 50 signals for each pattern, I would use 10 or 15 signals and use the rest to check whether it is working properly or not.
- Remember the different factors that affect the NN performance. Your can play with the numer of layers of the NN, the training data, etc.
To do the ocular recognition, we pre-recorded around 10 or 20 signals for each ocular movement (raw data), cleaned them from the 50 Hz noise and other noises and then trained the NN. We had some problems derived of working in real time, but it worked quite OK.
Regarding feature extraction, you could consider that the NN does that itself during the training phase. It is done in the hidden layers of the NN. If I remember properly, it calculates a weight to each neurone of the hidden layers and the combination of all of the neurones and the hidden layers allows the NN to rcognize the different signals. I will be able to access my slides in a couple of weeks if you want further info. I remember the decision process was explained quite well.
EDIT: I have remembered that I processed the signals in time domain, instead of frequency domain, as the time waveforms are different depending of the ocular movement. So what I did was to transform them to freq. domain, clean them and then transform them back to time doamin. Then I classified them. Maybe the same happens for EEG signals?
Answers (0)
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!