This repository contains the functions necessary for processing the eeg data derived from SleepProfiler headbands. To perform analyses on your data derived from SleepProfiler device, you should run the SM_main_eeg_preprocess.m file.
#Prior to running this function, you need:
- Have eeglab installed. (and have its path added to your MATLAB)
- Have statistics toolbox installed
- Have the "Dependencies" folder added to your MATLAB path WITH SUBFOLDERS
- Have the "csc-eeg-tools-develop" folder added to your MATLAB path WITH SUBFOLDERS
- Have SPM12 installed. (and have its path added to your MATLAB) The inputs for this function are:
- subjects id
- source path: the path to your data (subject folder)
- dep_path: the path you have saved the dependency functions (on default, it should be in ...\DREEM3\Dependencies)
- epoch duration
- sesssion number : night number
%%%%%%%%%%%%%%%EXAMPLE INPUTS: %%%%%%%%%%%%%%%clc %%%%%%%%%%%%%%%clear all %%%%%%%%%%%%%%%sub_id = 'COV263'; %%%%%%%%%%%%%%%source_path = '/home/soodeh/Desktop/SleepProfiler/data/RawData'; %%%%%%%%%%%%%%%dep_path = '/home/soodeh/Desktop/SleepProfiler/SleepProfiler_Scripts/Dependencies'; %%%%%%%%%%%%%%%ses_num = 'ses-03'; %%%%%%%%%%%%%%%epoch_duration =30;
- Converts the .edf file to .set file. which is a structure that can be read by eeglab toolbox.
- Adds the lables to the sleep stages.
- Saves the .set file with sleep stages
- Pops up a visual control for the first time(you can check the overal quality of the whole data-REM and NREM- here)
- Creates a .set structure for N2N3 (which represent the NREM sleep)
- Detects and delete the bad signals using "wispic" method as implemented in eeglab
- visually check the data after artifact rejection only for NREM sleep
- check if you have even number of clips in deleting the bad signals
Note: You do not need to clip the signal at step 4, the code takes care of the signal processing later. but you HAVE TO at least clip a small portion at step7 (this is to make sure that you checked the data by eye at some point)