SpectralArt is an an interactive spectral analysis and automatic artifact detection program for sleep data that includes sleep-wake scoring information. The spectral analysis features include the ability to save epoch by epoch results, save summary results across the sleep session, and save summary figures. Total, absolute, and relative power are computed and summaries are created for user defined spectral bands. The automatic artifact detection features include the ability to set the thresholds, perform threshold sensitivity studies, and view the epochs identified with artifacts. The program is currently configured to load sleep data exported from Compumedics ProFusion software.



The user can set the sleep data file (EDF) and the scoring annotation file (XML). The header and signal information can be viewed once the files are loaded. The ability to view the EDF headers allows the users to verify the contents prior to analysis.

The spectral analysis functionality has been designed to allow the user to set the most commonly used spectral parameters. The program will make an attempt to set the signals to A2-C3 while loading the files. If the signal are selected correctly, the reference and EEG signal are set from popup menus located in the Spectral Parameters section.  The EEG Reference popup menu should be blank if a reference signal is not required. The spectral bin can be either sequential or overlapping. The program was tested with five-six second (5, 6) and ten-four second (10, 4) bins, which are the settings used for the Sleep Heart Health Study and in the Division of Sleep Medicine. Care should be taken when using other bin settings. Hanning and taper window functions can be selected. The Hanning window is appropriate for sequential bins and the taper window should be used for overlapping epochs. The spectral bins default to the bins used for the Sleep Heart Health Study. Note that the taper window uses the MATLAB signal processing toolbox.

The artifact detection approached is modeled after the methods described by Buckelmuller. Artifacts are defined as the epoch where the magnitude of the epoch is greater than a multiple of the moving average for either the Delta (0.6-4.6) or Beta (20-40) bands. Note that only the Threshold popup menus are enabled. The artifact detection options include the following (1-3). (1) A figure can be created with each band across the night with epochs identified with artifact across the night [Artifact, Save]. (2) A sensitivity study applying a range of threshold values can be completed [Eval]. The sensitivity study generates an Excel and PowerPoint summary. (3) Signal epochs identified as having artifacts are extracted and plotted on separate figures. In addition, a complementary number of figures that display signal epochs without artifact are also generated for comparison.

Spectral analysis and artifact detection can be applied either separately (first row of buttons) or sequentially (Art+Spec). SpectralArt creates a variety of Excel and PowerPoint output which are written to SpectralArt root directory. The user can change the output directory by choosing the Folder button.

SpectralArt is a MATALB application created with the MATLAB GUI Development Environment (GUIDE). The most recent version of SpectralArt can be found here.

Included Files:

blockEdfLoad.m, BlockEdfLoadClass.m, ConvertMonitorPosToFigPos.m, pb_select_edf_file.m, saveppt2.m, SignalRasterView.m, signalViewEdfSignals.m, and testSignalViewEdfSignals.m.


SignalRasterView uses saveppt2.m to create a PowerPoint summary. Note that the PowerPoint generation has been tested with PowerPoint 2010. The moving average program was downloaded from MATLAB Central.