Code to replicate all results, tables, and figures of paper "Robust autoregressive hidden semi–Markov models applied to EEG sleep spindles detection"
- MATLAB R2016b or newer (the implemented algorithms require broadcasting capabilities)
- Statistics and Machine Learning Toolbox
- Signal Processing Toolbox
- Parallel Computing Toolbox (optional, but extremely recommended for EM-based learning)
- python 3
- jupyter notebook
- matplotlib
- daft to plot the probabilistic graphical model
- DREAMS sleep spindles dataset
- Add "Main_Code" folder to MATLAB path
- Download DREAMS sleep spindles dataset. A reliable source is here (make sure to download the DatabaseSpindles.rar file). Unpack .rar file.
- Run
reformatDREAMS.m
script to reformat and downsample the EEG and expert labels - Algorithms/scripts in the "DREAMS" folder are now ready to be run. These are the scripts that replicate results, tables, and Figure 2
- (Optional) Set up a python environment with matplotlib and daft to run
RARHSMM_GraphicalModel.ipynb
on a jupyter notebook
PS1: All main code is MATLAB, python is only used to render the probabilistic graphical model of Figure 1
PS2: The DREAMS sleep spindles dataset used to be hosted here but that website has been down for quite some time now