EEG Data Process Using EEGLAB on MatLab

P1NT1Updates on October 2021: For in-depth details, see below link for the Kindle Edition book:

———————————————————————————————————–

Many times I have been asked about the way in which I processed and graphed the EEG data that I collected for my doctoral studies. For the purpose of my dissertation, I collected the EEG data using the Emotiv neuroheadset and used the EEGLAB open source software to process and graph the EEG data. In this post, I have simplified the steps that I took in order to process my EEG data. Please note that I self-educated myself by reading through tutorials, forum discussions, help pages, and much much more… I am positioning my doctoral work in the field of Neuro Information Science, which is marriage between neuroscience and information science. By no means do I claim to be a neuroscientist or a medical professional.  Hope this helps some of you out there. Happy EEGLABing!

———————————————————————

I used the EEGLAB software, an interactive Matlab toolbox that is used for processing continuous and event-related EEG data, among others, in order to analyze the EEG data that I had collected for my research experiment. I used EEGLAB because it has been widely used in academia as well as in professional institutions, helping process complex EEG data while providing solid robust graphic user interface of the processed and the analyzed EEG data. Moreover, EEGLAB provided several data visualization graphs that helped me greatly in my work to find and establish patterns of brainwaves during each phase of the ISP model.

More specifically, I installed the EEGLAB Compiled version for Windows OS. Next, I will list the step-by-step ways in which I used EEGLAB to process my EEG data:

  1. Open the EEGLAB software.
  2. Go to the ‘File’ menu and click on ‘Import Data’ from the File menu options. Choose ‘From EDF File’.
  3. Find and choose the EEG data that is an EDF file saved on the hard drive and hit ‘Open’ in order to import it into EEGLAB.
  1. The ‘Load Data Using BIOSIG’ will open.
  2. In the ‘Channel List’ box, type numbers 3 through 16 with one spacebar between each number. This will map the 14 channels of the Emotiv neuroheadset data correctly to the EEGLAB software.
  3. Clic ‘Ok’
  1. Name the file in the field ‘Name It’.
  2. Click ‘Ok’
  1. Go to the ‘Edit’ menu and click on ‘Channel Location’ from the Edit menu options.
  1. Go to the Text Editor of the computer and create a file as shown below. Save as a CED file. These numbers will map the 14 sensor channels of the Emotiv neuroheadset channel locations correctly to the EEGLAB software.
  1. Go back to EEGLAB software and choose the ‘Read Locations’ button. (14location.ced)
  2. Choose the above CED file from your computer and highlight it.
  3. Click ‘Open’
  1. Choose ‘Autodetect’ from the ‘File Format’ menu.
  2. Click ‘Ok’.
  1. Click ‘Ok’.
  1. Go to the ‘Tool’ menu and click on ‘Remove Baseline’ from the Tool menu options.
  1. Click ‘Ok’.
  1. Go to the ‘Tool’ menu and click on ‘Run ICA from the Tool menu options.
  2. Click ‘Ok’.
  1. At this point, you will see a window like this. Depending on the memory of the computer, this part may be time consuming, if the memory is low.
  1. Go to the ‘Plot’ menu and click on ‘Channel Data’ from the Plot menu options.
  1. The brainwaves look like this graph and include outlier data that shows as irregularities in the brainwaves.
  1. Highlight the outliers of the brainwaves. These outliers show as peaks in the brainwaves.
  2. Click on the ‘>>’ button in order to move forward on the screen
  3. Repeat highlighting until the end of the data.
  4. Click ‘Reject’ in order to delete all the highlighted outlier data.
  1. Name this new data set in the field ‘Save it as File’.
  2. Click ‘Ok’.
  1. Go to the ‘Plot’ menu and click on ‘Channel Spectra and Maps’ from the Plot menu options.
  1. In the ‘Frequencies to Plot as Scalp Maps (HZ)’ indicate the desired brainwave frequencies to be graphed and plotted
  2. Click ‘Ok’.
  1. Depending on the chosen brainwave frequencies, such graph will be displayed.
  2. Save this plot as JPG file
Advertisement

11 responses to “EEG Data Process Using EEGLAB on MatLab

  • onedaybefore

    Thank you for a very informative post. This is so helpful to refer to so it’s great you have made something like this. You seem to have referred to a few images or files in the text and they are not showing up on the post, would it be possible for you to add these on/ send them over please for reference. Thank you 🙂

    • nilo

      Thanks so much for your feedback and support! Yes, it seems that the images are not showing up, despite my efforts. Let me please see what the issue might be. Thanks!

    • Nilo

      Please also see my most recent eBook on Amazon Kindle Edition: https://www.amazon.com/dp/B07NQR9V7F

      This is a simple introduction to EEG wearable in non-neuroscience related disciplines. I am working on the next book, which will be a more detailed one with clear detailed step by step ways to collect, analyze and visualize these datasets. Thanks!

  • Fatima

    Hi
    thanks for your great post. But i cant see any pictures. I want to creat ced file but i dont have locations value. Can you help me plz?

    • Nilo

      Thank you for letting me know. Please also see my most recent eBook on Amazon Kindle Edition: https://www.amazon.com/dp/B07NQR9V7F

      This is a simple introduction to EEG wearable in non-neuroscience related disciplines. I am working on the next book, which will be a more detailed one with clear detailed step by step ways to collect, analyze and visualize these datasets. Thanks!

  • Fatima

    Hello.thank younfor your post but i can see any pictures .i wqnt to creat a ced file as you explained in number 10 but i dont have any value.can you help me plz?

    • Mukhtar

      You can create a location for the 14 channel modified combinational nomenclature Emotiv uses; In EEGlab go to Edit>channel locations, click on read locations and navigate to the sample location folder in the EEGlab installation package and select standard-10-20-cap81.locs. Here you’ll notice there are 81 channels present. All you have to do is delete all channels leaving just the 14 locations you need (AF3, AF4 ….etc). Then click on “save (as .ced)” and click ok.

    • Nilo

      Thank you for letting me. Please also see my most recent eBook on Amazon Kindle Edition: https://www.amazon.com/dp/B07NQR9V7F

      This is a simple introduction to EEG wearable in non-neuroscience related disciplines. I am working on the next book, which will be a more detailed one with clear detailed step by step ways to collect, analyze and visualize these datasets. Thanks!

  • kaka

    Thank you. this tutorial is so helpful. Just one point was a bit confusing for me: At instruction number 10, it is said that ”create a file as shown below”, but I can not find any link or something related below!

  • kaka

    Thanks again Nilo! Your tutorial is awesome and yet easy to follow!

    • Nilo

      Great to hear! Thank you for letting me know that this was helpful. Please also see my most recent eBook on Amazon Kindle Edition: https://www.amazon.com/dp/B07NQR9V7F

      This is a simple introduction to EEG wearable in non-neuroscience related disciplines. I am working on the next book, which will be a more detailed one with clear detailed step by step ways to collect, analyze and visualize these datasets. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: