Loading

Module 1: EEGLAB Demonstrations

Notes
Study Reminders
Support
Text Version

The AEP Demonstration

Set your study reminders

We will email you at these times to remind you to study.
  • Monday

    -

    7am

    +

    Tuesday

    -

    7am

    +

    Wednesday

    -

    7am

    +

    Thursday

    -

    7am

    +

    Friday

    -

    7am

    +

    Saturday

    -

    7am

    +

    Sunday

    -

    7am

    +

So, there is various ERPs present, so for each ERPs how to do the data processing using MATLAB and the plugins like the EEG Lab and ERP Lab is what I will be explaining in this demonstration. So first I will just give an overview of what is these ERPs. So what are the ERPs? ERPs are nothing but they are the event related potential. So, our brain are having various electrodes, various points are present over the electrodes. So the brain, it stimulates due to an event, there will be a stimulus that has been given to the brain which, based on which the response is been obtained from the scalp. So that is called as the event related potential. So, based on an event we are evoking a potential to be obtained, a biopotential has been obtained from that. That is called as the event related potential. So what are these kinds of events? It can be any kind of events. It can be a flash of light or it can be a difference in the size of a ball or color, different colors of balls or it can be an auditory stimulus, it can be a tone or it can be clicked.
So, these are the different kinds of events that can be presented. So what is this AEP? AEP is the Auditory Evoked Potential. So, when we are giving a particular auditory stimulus like it can be a tone, 1000 Hertz or 500 Hertz tone, so based on that tone, we will be getting, the scalp records the potential based on the stimulus given. That is called auditory evoked potential. The brain has various parts like the frontal, occipital, parietal etc. So, here the auditory, the auditory stimulus is first recognized or it is first generated in the auditory cortex which is exactly above the ears over the temporal lobe. So, over there only we will be getting the proper auditory stimulus, the response for their auditory stimulus. So here we are using an experiment. In this experiment which I have been working, we were using the NeuroScan 64 channel EEG system wherein this, the cap as I have shown over here, this the, here the electrodes have been placed over the head and these electrodes, these points over here, these are the, they are the electrode which creates contact with the scalp of the head and that is how the EEG is been acquired.

So, first, for any step before the data processing, we have to acquire the data which has been obtained from this NeuroScan EEG system and the stimulus is been given through software called system software. So, where we can create whatever kind of stimulus which we want. For example in this case of auditory evoked potential, we require an auditory stimulus or an audio signal which is 1000 Hertz tone which we have used in a Hertz, in a frequency of 1 Hertz which means for a second there will be one signal that has been, one trigger will be given by the system to the Acquisition NeuroScan system. So, these triggers are given and the tones which can be, these tones can be presented in whichever manner it can be, through the headphones or by speakers. So, in this experiment we had given the AEP through the speakers and followed by the, in the NeuroScan Acquisition System itself, we can give, we can assign various parameters. For example, we can give whichever, if we want 64 channel that accordingly that configuration we can give or it can be a 32 channel configuration or even if we want only the frontal electrodes we can give just the 3 electrodes for the forehead, just forehead bands. So, like that we can give the configuration can be given in that manner. So then, we have various other, like during the acquisition itself while giving the stimulus or by giving, while giving the triggers what happens sometimes, our, we cannot be in a stable position for a long time. So it can, we can change our, there will be a muscle movement or we just blink our eyes or there can be different kinds of artifacts that can be produced during the experiments.

So, those artifacts can be rejected using the, using a voltage threshold from minus 100 to 100 micro Volts because mostly all these blinking of the eyes or any other muscle contraction or the EMG artifacts whatever, whichever artifacts that is been produced, it cannot go more than 1000, 100 micro Volts. It will be in that range only. Because our EEG signal is like it comes in very few micro Volts and over that any artifacts will not go beyond minus 100 to 100 micro Volts. So, for that reason we keep the voltage rejection volt threshold and reject these, in this range we will reject the signals, and then we can, there will be various other noise artifacts or there is EMG artifacts and all of which can be removed using the filter. So, we can have a notch filter or a bandpass filter and a bandpass filter both together if you use you will get a proper ERP. Now the whole of this EEG, it is like continuous data, it will take about maybe 2 minutes or 3 minutes of the experiment or it can be even more. For AEP specifically, it will take about 2 minutes at most, so after that, but we want, our interest is just to get a particular time period, just from a few, few milliseconds like the first initially some 500 or 300 milliseconds along that range only we require any ERPs. So, we can just cut down or cut down that particular part of, that particular process where we cut short the time period according to our interest that is called epoching.

So, I will just give you how does this AEP looks like? So this is the, how the AEP actually looks like. Here this particular, this P1 N1 P2 complex that is the, that will be present in any auditory or visual evoked potential, in all the evoked potential this particular complex, this N1 P1 P2 this complex is called as the late, late complex, so LPC complex we say that as, Late Positive Complex. So this particular, this particular N1 that is there, that is the most prominent peak that will be obtained in the 100th millisecond of a recording. So this particular, if this is there we can confirm that our auditory, the auditory cortex that is there, it is properly functioning in our brain. So this particular, here this red and blue zone, this blue color area that is called as the primary auditory cortex where the evoked potential will get activate or it will generate, the AEP, the AEPs are generated in that region specifically. So, after this data acquisition from the NeuroScan, we will get continuous data like as I told you it will be from, it will range from, for about 200 milli, 200 seconds or it can be more than that also. So, that particular we have to further process it using this EEG Lab and the ERP Lab. So, I will just give you a small overview of what is this EEG Lab and this ERP Lab.

So this EEG Lab is nothing but, it is a MATLAB toolbox that is given by the Swartz Center of Computational Neuroscience. So these particular, they have given a plugin, plugin to, to just process the EEG and the ERPs. So, EEG Lab is like to import, basically EEG and ERP Lab, there are two different things but they work under the same user interface. So this, this gives, instead of scripting some people will have difficulty in scripting for, at least for one data we can give graphical user interfaced method rather than scripting. So, using these EEG Lab itself we can have a, we can make the scripts according to the function we do using itself. So, this MATLAB toolbox, helps, it is having these graphical user interface approaches and then we can have various EEG Lab data formats. Now EEG Acquisition, it can, it need not be just in form of pdf or cnt or various formats are there and this EEG Lab, it is having different plugins also with which we can import all those different kinds of EEG data formats and then we can have various plotting methods and we can have the artifact been removed and then we can have a different time, topographic analysis can be done and various other, various advantages are being there, being user-friendly also, it is being very useful for, it is like a very basic step for EEG analysis. And then there are various other plugins available like, in order. For example, if you want to do some other preprocessing steps or if you want to do some other artifact rejections or various other formats in which we can import, export the preprocessing steps so like that various other extension is available which I will show in the, in the demonstrations like how to get all these plugins installed and how to go about this working with this toolbox. So this is just the primary like, for importing alone this particular data toolbox is being used.

Next, we will have this ERP Lab. This particular ERP Lab, ERP Lab is also a free source MATLAB package itself which helps in analyzing the ERP data. So, the whole of EEG is like a continuous whole data, so here for example, this green color, the green waveform that is being shown over here that is the whole EEG waveform that is being there. But for this, this red color here, that is called as the stimulus, for that stimulus we want to get how the brain responds. So, at least just a few milli, few seconds or few milliseconds of the data is only required for processing our, for getting the ERPs. So we have, we can do that epoching for a particular time domain alone. So for example, I just require from minus 50 milliseconds to 200 milliseconds in order to process the EEG, AEP analysis for the auditory evoked potential, we just want that LPC complex to be seen. So, for that reason we just require a maximum of 200 milliseconds or maximum of 300 milliseconds not more than that. So, we will take a small baseline from minus 50, from the trigger we just do not require the EEG or the ERP waveform from the trigger. We just want, just a few microseconds before the trigger starts we wanted the ERPs to be analyzed. So, that we will get an idea of how the, how the waveform looks prior to the trigger is being given.

So, this is this particular step is called as epoching and this is a very basic step for an ERP Lab, ERPs as concerned. So for this, I will again show you how it looks, how to do the various demo, the steps for AEP with this particular EEG Lab and ERP Lab and these sites I have mentioned over here in this place where we can, in these sites we will be obtaining all those EEG and ERP Lab zip files we will get and we can download it and how to import that into out MATLAB that also I will be giving you as a demo. (Refer Slide Time: 14:01) Yeah, so these are the demonstration steps that will be, that I will be covering. So firstly I will, so how to import the data then, how to do the filtering, then how to scroll the data along the, how to see the whole data how it looks and then how to create this Eventlist, the brain as such you find that these triggers, it is given from the NeuroScan system. But then what happens is we wanted, we want just, we cannot just take the triggers as such, we have to assign a different name for that. So how to do that and all is the next step. So how to epoch the data, like as I said we wanted to be in this particular time frame. So, in that how to take that epoching and how do we reject all the artifacts. As I told you there will be various artifacts of blinking or muscles congestion or when we move ahead or we cannot be still for a while taking data or while acquiring data how, we cannot, we cannot, just for 2 minutes we cannot be steady like that. So, there will be movement in our head or there will be some muscle movement, eye blinks or anything, so that can be rejected using these artifact rejections in EEG Lab and ERP Lab, and then we have other filterings like bandpass filter.

So, this is the sequential order in which we have to do any of the EEG or ERP analysis and then finally we can obtain the data. And another important thing about these ERPs is that almost always all the ERP, all the evoked potentials it will be in the form of a negative up like always as I have shown in the figure, there will be always, it should be, it will be always in the negative up manner. It will not be, most, some P300 for example, those and all will be in a positive, positive up we can obtain in the positive up manner, but otherwise, almost every other, all potentials will be negative up only. So I will just start up with the demonstration of how it looks in the actual live processing how do we do it. I will just go through that.

So these are the different references that can be useful for this particular presentation. Like we have the different ERPs and how is its characteristics and how does it look and how it has been started working, how they started working, everything has been explained in this paper, in the first paper and the next two are the, just a base paper about the EEG Lab and the ERP Lab, how the software came into the picture and how they have done all the steps regarding it. So, that has been given in these two papers. So, the next I will be giving you a short, short demonstration of how to do the AEP analysis and then followed by, I will give the other next, like this AEP some other various ERPs are there, like the P300, MMN VEPs, so along with that I will give their presentations and followed by its demonstrations as well. So, thank you and I will start with the

Hello everyone. So, I will start with the auditory evoked potentials data analysis and processing using MATLAB with EEGLAB and ERPLAB. So, what we will do is, first we can obtain these EEGLAB and ERPLAB as, we can obtain that in the website, so we can just download it. And the most important thing about this is the ERPLABs it has to be copied inside. It has to be copied in such a manner that it should be placed inside the plugins of, the plugins of EEGLAB and so, here we have the ERPLABs pasted inside the plugins of the EEGLAB folder. After that, the next thing which we have to do is we have to set the path inside this MATLAB. So, here we go inside here this option called as set path, and there we add this, add with subfolders the EEGLABs, this particular folder we will just open it, so that all the plugins along with the functions all the popup functions, all the different everything will be added into this and then we just save it and close. So, this is an important step before starting up with this EEGLAP and ERPLAB. Then, then if you just after, after saving and saving it if you just put EEGLAB like that and it will, it will start running, like it starts working.

So, it should start coming like this and you will get a graphical user interface. Then there are as I said, there are various plugins that are there for this particular software. They are like we can have various importing functions, for importing the different types of EG files. So, here in this files we can have this EG extensions, manage EG extensions. So, in that, we can have various options like we can give the different plugins, we can download and we can keep it inside our plugin folder of EEGLAB. So, for now, we wanted the neuro scans systems EG, import format, so that has been given over here. So, here we can just directly import the CNT file using this GUI. So, we just click that, and we can have the, so I take my AEP data in this. So, this is a cnt file, it is a continuous data file that has been obtained from the neuro scan system. So, we can just directly open it. If you open it will ask like, which is the number of bit you want and everything. So, you just go with all the default parameters that has been given. So, it will give an auto detect itself, so we can name it however you want. So, we can I just, write it as AEP and then, so if you have a different name, many subjects you have or you have a different some any IDs or something like that, you can just paste in that manner itself.

So, you will get the data set in this. We will, now we have imported the data inside this EEGLAB. So, over here we can see that the epochs are just one because we have not divided our EG into epochs, we have just the whole EG bunch of data that has been there. So, here are the events are, these are the number of events that is there. Events are nothing but the triggers that we have given. Like for example, now in the case of AEP we have the audio triggers that has been given. So, we can visualize those triggers also, I will just show you that later. So, here we have the start and the end time, like first it starts, it starts from 0 to 27 seconds. So here this, this is a total time length of the experiment we have conducted and then the data size everything. So, we have, we can give this, externally we can give the channel locations or sometimes here the EEGLAB itself will have all these channel locations there inside the file itself. For example, in, Enobio systems or Open BCI systems and all we can give, we have to manually do all the, importing the data or the events based on the channel size, channel number, etc. or the columns number, like that. So, I will just go with this cnt file for now. So, next I will just show you how the plots look like.

So, here in this plot session, we have the channel scroll data in this set, in this place, we can see how the different that these are the 64 channels that are being recorded and then it is, we can change the access like this is for 5 seconds like that. So, we can make the, make such a manner that we want 30 seconds per to be seen. So, here if you see, here we have all the triggers, these are the triggers this, these red lines that is there, those are the triggers and see here, we can have a lot of artifacts and all can be seen. So, we can manually also reject all this by just selecting like that, or else we can just do it using the EEGLAB analysis like the artifact rejection protocols. Here we can change the amplitude or like we can make it, however, smaller, bigger you want and here we can scroll the data from left to right like we can just move about us and see how the data looks. So, this is just to see and you have to think, you have to check, what you have to check mainly is the, which, what is the trigger number over here. So, there are two, here there is, this 2 is our trigger like the AEP triggers this the 2 is our number, the trigger number that we have recorded over here.

So, the next step is like the initial preprocessing. Before doing any analysis, we just wanted filter to be done, just a small filter called as the notch filter, we will just, there are various filters like the FIR filter or IIR filters. We will take this notch filter over here and usually for us we will take a 50 hertz of a notch filter and then just apply it. So here, while doing itself there will be, in this command window there will be how the processing has been done, how far it has been done, it is all shown and these are the equivalent commands that we get and this is the, itself gives what the data name you have to be, data set name you want it, it will only give or you can change according to your wish. So, here are these are the equivalent, this is the equivalent command window. So, we will after doing all these steps, we can just copy all these and put them into our scripts, we can make the scripts based on that. So, I will just work with this GUI for now. So here, we can give this channel locations, so for that we just go to this edit, and here we have the channel location. In this channel location, it is all the default, it is all like the 64 channel data it is like all the default that has been present. So, we can just go with it. And then, here we have the different electrodes and its positions and everything, it has been given and for that, for 64, 69 channels how it looks and everything is we can just look about and then this is all the default just put in. So it will get, the channel locations will be fid. So here we have all the channel locations done.

Now next we have to do is the event list. So, what is this event list. Now, the system this MATLAB it does not know, like whether what is the, what is the event name, how does it, how should it look and all it does not know. So, for us we know that okay that, the triggers that are coming as 2 is our, they are the events for us, but then the system should be given, we have to give the input to that system, that okay this 2 is for triggers. So, we just go to the advanced protocol. So here, we have to, this is the event name. So here, this, this two is the event name that we had given in that is there in the continuous data file and we just name it as, it will be 1000 hertz and then we assign a number called as this bin. Based on this bin number only we will be able to, we will be able to do the bin operations or we can, we can visualize whatever waveforms or ERPs which we require based on this bin numbers and these inputs be given over here. So, we just, and we just write accordingly. So, based on what, what triggers based on, like for AEP it is just 1 trigger, so we can just give one line like this. So, we can just update, update the line. So, this is how it gets updated and you can just save it also, later on you can use the same event less. So, just save it and then we can apply it.

So, what happens is, all these then all the numbers which was named as 2, it will now become bin 1s or it will be named in that manner. So, that is how, that is why we are doing this particular step and we can just, this is called as the event list, creating the event list, this particular step is called as creating the event list. Now, next, what next what we have to do is the epoching. Now, as I told it is like from 0 to 257 seconds the whole data has been given. But I require for a particular trigger I want a pre, pre-stimulus I want some 50 microseconds, milliseconds and after that, I want some 200 milliseconds like that. So, we can just, we can just decide our time frame of how far we want all this and that is called an epoching. So, here we can create the epochs, we can extract the bin based epochs, so this is how it looks and then, so we always keep a pre baseline correction, because we wanted to know how the data looks before the trigger comes in so that we will get an idea of how it looks and how the base correction has been done and so, so we will take, for now in this AEP we just require from minus 50 to 200 milliseconds. So, I just do it in this time frame or we can change it also if you want to 30, 300 or make it 250. So, like that, we can change however we want and then run it. So, it runs all the data, so it creates the event list. So, this is how it creates the event the extract the epochs. So, after epoching how does the data looks.

So, if I just scroll this data now, this particular data set for this data set. So here we see, this, these are this, this is the bin values, these are the bins which, which was been assigned for this. So here, these are all the artifacts that would be recorded. So, what we will see is, I will just show you how does one epoch look, so I will just make, I will just show one epoch how does it look. So here which we, if we see this is the trigger, from this trigger I want just, so it will, it will for all this, for all triggers, it will show like this, but then we want it from minus 50 to 250. So, I had just did that extracting the epochs. So, this is how it looks, this is how the one, just one epoch looks. So, similarly, there are nearly 120 events that will be there, so there will be 120 epochs that will be created in this manner. For this, further, if you do some artifact rejection and everything some of these epochs and all will be reduced, it will be, it will be removed due to the artifacts the present. So, those now all these ERPs and all its comes in so microvolts in that range it comes. So, just one epoch if you visualize, if you want to see how one epoch or one, how the waveform of one epoch looks it will be very, very less. So, for that reason only how many of our events are there, we average all together that and then obtain. That is why we have any experiment if you do also, we do not do just for one trigger, for just one tone we do not do, we do for some money 120 triggers or 150 triggers or sometimes even 1000 triggers. So, it depends upon the experiment as such.

So, next, I will just do the artifact rejection. So, artifact detection first we will do is using this threshold voltage, threshold this is the most commonly used threshold artifact rejection method that they have used. Now, what we have to do is in this there are so many channels, in this, I want only these 64 channels alone to be crossing the certified rejection. The other channels if you take, it will result in all the events to be rejected. So, that is why I just take only till the 64, the trigger channels especially and this EMG, EKG channels and all you should not select for artifact rejection because it will, it will reject the whole data set like all whichever data we require it will all take off, I mean it will just reject of all those. So, we just take only the first 64 channels and here we have the time period from 200, so it will be from 2, minus 52 to 250 second. And then the voltage limits, as I told you always the artifact rejection it will take only from minus 50 minus, minus 100 to plus 100 microvolts. So, this is, this particular we can change accordingly to what you think the, not the voltage limit should be. So, mostly it will be minus 100 to 100 alone. Then we just, do the artifact rejection.

So, here if you see, see this, here the red colored the this red colored this selected channels over here they are called, they are the rejected ones. Here these red-colored ones, are the rejected categories. So, we can just check how many of them are being rejected, how many are being accepted, we can check in the command window. So over here, we have selected so many channels, in this channel almost 150, 125 of them are being accepted. Like means, which means that of in that particular voltage range, for these particular channels alone, these many, so these 125 events or the triggers are being or these many epochs are being accepted and 18 of them are being rejected. So, this usually it will be, it will be like a 80-20 percent like this only it will be. Because there will be a lot of artifacts as, as I mentioned. So then what happens is, if you, as I told you, if you do that trigger channels, if you select then, then the whole set of all the triggers will be rejected. For example, this whole of 143 epochs will would come in the rejected range. So that should not happen, so that is why we do not take the trigger and EMG, EKG channels and all. So over here, we have to, we can just, I will just show you how does it look. So, I will just take 20 epochs, over this 20 epochs, see all these yellow little colored things and all are been in the reject range. So, it is seen that there are lot of noise in this region.

So, that is why it is in the reject, we can reject all these channels. So, I will just do an update mark. So, it what it does is it updates, it will take that, these channels are the ones which have to be rejected. So, we can go to this tools, and then we can just select this inspect, reject data by eye and then we can just mark this reject channels and so, what happens is all these channels as I shown that all the yellow coloured channels, it all will get rejected. So here, if I do just this reject, it will ask again and we can just reject it off. So, if you see over here, see over that 125, over 143 events, only 18 of them were being rejected. So, all those 18 trials are being rejected like that it will show and then it will create a new data set and we just save it in this format. So, this is how the artifact rejection has been done. Next, what we will do is we have to do the filtering again. So before, because even after we did not do any filter while acquiring the data, we have done some filtering options, but even during the data processing also we need to do all the data filtering steps. So, we will do the data using this Butterworth filter. So, we usually take from 1 to 30, usually, this is the range in which we do the bandpass filtering. If you want, we can change the order of the, of fitter or we can change the upper limit or the lower limit like it can be minus 4.1 or it can be more than 30 also. So, it depends on the what, what kind of epochs you are taking or what kind of AEP or EAP, how whichever, whichever ERP we take, it depends on that. So, we just apply it.

So, as you apply you will have the filtering being done. So, after these filters, now we have totally 125 epochs are been there, now these 25 epochs, I want to be averaged all together and to obtain the ERPs. Now, each of this time epochs we have to together, average together and get one particular waveform, that is called as, that is this averaging step. So, here we do this compute average, ERP average DRPs. So, when we do that, we do for this seventh data set, so that our seventh data set will have 125 epoch, so those we can do and can do any of it spectrum analysis or if you want to know the total spectrum FFTs and all etc, we can do and this particular, this particular option should be selected because we do not want any of the artifact rejected epochs to be average. So, this particular bit will exclude all the epochs that has been rejected by the artifact rejection.