Home - nsrr/SpectralTrainFig GitHub Wiki

SpectralTrainFig

SpectralTrainFig is a MATLAB tool designed for the efficient processing of spectral analysis of multiple EEG traces from multiple EDF/XML files. SpectralTrainFig performs header checks on EDF and XML files, runs automated artifact detection and removal, applies a Fast Fourier Transform to the EEG data and outputs results containing spectral power/density results by lead and band, as well as a PowerPoint summary for visual adjudication.

Overview

Spectral analysis is a commonly used approach to analyze EEG signal data, but can be time consuming due to the need for manual artifact identification and removal. SpectralTrainFig was developed to streamline spectral analysis by automating artifact detection prior to analysis and export spectral summary data analogous to hand-scored results. Artifact detection contains two processes, one based on the accompanying XML file and another comparing running averages of the EEG signal’s frequency. The XML file is used to remove all sections marked wake while automated detection flags periods of EEG data whose frequency varies greatly compared to its background EEG signal. This automated analysis of EEG spectral density lowers the amount of time needed to obtain results from hours of hand scoring to under a minute using SpectralTrainFig. While approximating hand scoring, results from SpectralTrainFig are not guaranteed free of artifact and still require some manual review for optimal results.

Limitations of SpectralTrainFig

Limitations of SpectralTrainFig include the inherent challenges associated with automation and large scale analysis, residual artifacts, the need for additional post processing tools, and the need for further validation studies. SpectralTrainFig’s validation study was performed using a population of older women including a large number of women with mild cognitive impairment and dementia. Additional validation studies with different populations, with different spectral parameters/methods and with different artifact detection parameters are required to better understand how the current analysis pipeline performs in relation to the spectral studies analyzed with manual artifact detection. We did not perform spectral studies with simulated data due to the lack of open source tools for simulating EEG signals during sleep. Studying the effect of spectral methods and parameters with simulated data could result in specific recommendations for setting spectral parameters for studying EEG dynamics that occur during sleep. Automated artifact detection can also fail to recognize consistent artifacts that occur over a prolonged period of time (ex. sweat, popping, ECG artifact, electrical interference.)

Due to limited artifact detection employed, we recommend that spectral data for band estimates that exceed three (3) standard deviations from the mean band estimate be reviewed manually/excluded.

Compiled Application & Source Code

A MATLAB App installer is available for SpectralTrainFig at MATLAB File Exchange

Hardware and Software Requirements
  • 8GB RAM minimum (16-32GB recommended)
  • Windows-based operating system
  • MATLAB R2013b (v8.2) or later
  • MATLAB Signal Processing Toolbox, available here
  • MATLAB Statistics Toolbox, available here
  • SpectralTrainFig app for MATALB, available here
PSG Recording Requirements
  • Paired EDF and EDF.XML files located in the same directory.
  • EDF identity headers, EDF signal headers and XML files free from error.
  • EDF files with clean EEG data and an accompanying XML containing scored sleep. Note: only Compumedics-formatted XMLs are currently supported by SpectralTrainFig.