This repository contains the matlab code for calculating CSS (Circadian Sleep Sufficiency) via calculating Homeostatic sleep pressure and circadian sleep by tracked sleep patterns.
- CSS_package.m
The main file of this package. It calculates CSS and circadian necessary sleep for each sleep episodes of users by using the sleep patterns and the light profiles of users provided as Input1_sleep_light.csv and Input2_WASO_Main.csv.
- Input1_sleep_light.csv
This file is the input of CSS_package.m which need to consist of the sleep pattern of user as the 1st column and the light profile of user as the 2nd column. See the example for details
- Input2_WASO_Main.csv
This file is the input of CSS_package.m which need to consist of the WASO of each sleep episode and whether each sleep epsiode is an main sleep as the 1st and the 2nd column, respectively. See the example for details
- Sleep_make.m
This function create the Maked_sleep.csv which can be used as 1st column of Input1_sleep_light.csv. Users need to fill in date of sleep onset (year-month-day), sleep onset (h), date of sleep offset and sleep offset in the 1st, 2nd, 3rd and 4th column of ‘Input1_sleep.csv’, respectively which is the input of this function. See the example for details
- WASO_make.m
This function create the Maked_WASO.csv which can be used as 1st column of Input2_WASO_Main.csv. Users need to fill in ‘sleep/wake’ reading supplied by the Actiwatch after processing to avoid any missing period and the 1st column of ‘Input1_sleep_light.csv’ in the 1st and 2nd column of ‘Input2_WASO.csv’, respectively which is the input of this function. See the example for details