Giter VIP home page Giter VIP logo

eeg-analysis's Introduction

Process and analyse EEG signals using EEGlab

Scripts to automate the preprocessing and analysis of EEG signals using EEGlab.

These scripts were developed by Ricardo Dominguez Olmedo during a placement at the Physiological Signals and Systems Laboratory, Department of Automatic Control and Systems Engineering, The University of Sheffield.

Functionality

Main functionality included:

  • Preprocessing multiple data files by removing data at the start/end of the experiment, downsampling and bandpass filtering. Refer to convertRawFile2RawData.m and preprocessingICA.m.
  • Applying independent component analysis simultaneously to several data files, allowing the bulk of the computation to be performed at once. Thereafter the signal subcomponents of each data file can be examined and rejected if believed to be spurious. Refer to preprocessingICA.m and ICArejectChannels.m.
  • Computing automatically the spectral powers of multiple EEG data files. Refer to computeSpectralPowers.m.

Additional functionality included (used to measure cognitive workload):

Step by step use case example

Example of using the scripts to preprocess, apply ICA and extract the spectral powers of EEG signals collected with an Enobio headset.

  1. Add the folder containing the EEGlab toolbox to the MATLAB path.

  2. Create a \data folder at the base of the MATLAB path.

  3. Put the .easy files collected from the Enobio headset into a new folder (ie Data/rawFilesX).

  4. Run convertRawFile2RawData.m to create Data/rawDataX. Ensure that the folder Data and its subfolders are added to the path. The new folder contains .txt files with only the relevant EEG data as columns.

  5. Run preprocessingICA.m to preprocess the data and apply independent component analysis. Ensure that the folder toolboxes/EEGlab and its subfolders are added to the path. Ensure you have created a file with the EEG channel locations (using the EEGlab GUI Edit/Channel Locations) and said file is located in Data/rawDataX. The folder created /Data/icaX will contains EEGlab .set files.

  6. Run ICArejectChannels.m to reject the individual components extracted using ICA. Individual windows will appear in the screen with information about the components found using ICA. The pruned data will be stored at /Data/pruneX.

  7. Run computeSpectralPowers.m to compute the spectral powers of the clean signals. The values for each dataset are stored at /Data/powersX as .txt files.

Tips for rejecting ICA decompositions

Only cognitively related signals should not be rejected.

Rules of thumb to determine if a component is:

  • a) Cognitively related

    • Dipole-like scalp maps
    • Spectral peaks at typical EEG frequencies (5 to 20 Hz)
    • Regular ERP-image plots (meaning that the component does not account for activity occurring in only a few trials).
  • b) Muscle artifact

    • Spatially localized
    • Show high power at high frequencies (20-50 Hz and above)
  • c) Eye artifact

    • Smoothly decreasing EEG spectrum
    • Strong far-frontal projection
    • Possible to see individual eye movements in the component erpimage.m
  • d) Some other type of artifact

    • A single channel goes 'off'
    • Line-noise artifacts
    • Noise in a certain frequency, specially in specific trials

To make an informed choice look at:

  • The scalp map
  • The component time course
  • The component activity power spectrum
  • The erpimage.m

For further information refer to the Swartz Center for Computational Neuroscience wiki.

eeg-analysis's People

Contributors

ricardodominguez avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.