Documentation‎ > ‎

01. How it works

Url Redirector Modified

Quick navigation
For quick navigation on this page, please use the links below:

Sleep actigraphy

During the night your body follows certain sleep cycles. It goes from light sleep to deep sleep and occasionally into the REM-sleep where the most memorable dreaming occurs. We use the method called sleep actigraphy (accelerometric movement measurement) which helps us to recognize your sleep phases when you are sleeping. This method in backed by scientific research which shows that even not as precise as PSG it still provides comparable outputs with more convenient use. The biggest advantage of actigraphy is definitely the simple setup which makes in perfect for every day use in home conditions.  

The phone has an accelerometer sensor build-in which is very sensitive. If placed in your bed, we start receiving a record of your movement over night. In deep sleep your muscular movements are suppressed and thus in this phase the sleep graph (we will reference to the output of sleep actigraphy as sleep graphs further on) gets nearly flat. In contrast, during light sleep you tend to turn around which exhibits as significant peaks in the sleep graph. 

Your body movements are directly related to your current sleep phase. In general, the more movement the lighter the sleep. The sensors on current Android smart phones are so sensitive, that even if you place the phone on the mattress near your body Sleep as Android is able to track significant differences in you sleep patterns. Please read more in 2. Sleep Tracking on how to correctly setup sleep tracking.

Measuring your sleep cycles allows us to do two important things:
  1. Smart wake up  finding the best moment for the alarm to wake you up in the optimal sleep phase for pleasant wake up and a good start into your day (see 3. Wake Up and Alarms)
  2. Calculating your deep sleep % and cycle count which may be an indicator of healthy/unhealthy sleep. For example very low deep sleep percentages may indicate sleep deprivation issues (see 4. Statistics and Data)

Raw data from the accelerometric sensor are aggregated into larger time frames and such aggregates are than used to plot the sleep graph. Below is an example real-life sleep graph.
Assuming you are a monophasic sleeper (see 9. Polyphasic Sleep) a healthy sleep is 7-8 hours long and consists of 5 sleep cycles where the first lasts for 70-100 minutes and the consequent cycles get longer but lighter. Each cycle consists of 5 stages lasting usually from 5-15 minutes. Stage 1 and 2 are considered as light sleep and this is the best time to be woken up in the morning. So a healthy sleep graph should look like a 10-30 minutes of light sleep (high peaks) followed with areas of deep sleep with less or no peaks lasting from 40 to 100 minutes. Although different resources on sleep may provide different figures. 

NOTE: Recently we introduced the REM figure in the sleep graphs. Please note that this figure is experimental and is not directly based on the accelerometric data. In general actigraphy is not powerful enough to recognize the REM phase on a generic - previously unknown device. So what we do is we assume the REM phase from the sleep phase data based on generic knowledge on sleep. A necessary precondition of correctness of the REM figure are your average and healthy sleep cycle.
From the above we can conclude that deep sleep % may actually range between 30%-70%. Figures out of this range may indicate either incorrect sleep tracking setup (see 2. Sleep Tracking) or some sleep issues. For example very low deep sleep % may indicate either sleep deprivation or issues in your life style such as higher alcohol or caffeine income, not enough sport etc. See an example of such sleep graphs in the figure below. 
Beside deep sleep marked with a green dashed line and light sleep marked in blue, there are several other events depicted in the sleep graphs.
For more details on the tracked sleep measured, please consult 4. Statistics and Data.


Normal alarm clocks don't care about sleep cycles and they trigger alarm regardless whether you are in a light or deep sleep phase. That's the reason why you may feel tired after wake up even though you slept long enough. Waking up from a deep sleep phase is unnatural and may cause you feel disoriented, exhausted and sleepy. 
Waking up in a light sleep phase on the other hand feels natural and is similar to the experience of waking up on the weekend without an alarm clock at all. 

Sleep as Android is different. It uses the sleep phase information based on accelerometric sensors in your mobile phone to recognize your sleep phases. In general you specify a time window during which you wish to be woken up and the Smart wake up algorithm looks for significant light sleep indications to trigger the alarm. 

For more info on Smart wake up please refer to 3. Wake Up and Alarms.


With the modern hectic lifestyle it is more and more difficult to get enough deep sleep. There is stress, noise from the street and many more factors which lower your deep sleep %. From that perspective we can see the aim of maximizing deep sleep % as an interesting goal in improving your sleep. 

We have implemented a simple polynomial regression analysis of your deep sleep % in relation to sleep length and fall asleep hours to advice you on better sleep habits to maximize deep sleep percentage. This analysis is available when opening Charts as you can see on the images below. In this example highest deep sleep percentages are achieved with fall asleep hour around 2:43 and sleep length 9:26. 
 
Of course such advice needs to be taken only as a slight guidance in which direction you may adjust your sleep habits. But we don't recommend to do any dramatic changes. Rather gradual iterative adjustments with feedback from the sleep tracking are recommended. Also the performed analysis always needs some correction and interpretation from the user. 

For example in second plot you see there are basically two extremes nearly on par with nearly the same deep sleep %. In addition we recommend to use longer period. We perform some basic anti data-noise techniques such as outlier filtering, but data noise or errors of measurement may still negatively affected the analysis . 

More on sleep data analysis in 4. Statistics and Data.


Over a long period of time we have been gathering snoring samples in order to use machine learning algorithms and to teach Sleep as Android to detect snoring. Currently our algorithm is already performing very well. It is based on a training set of 600 snoring recordings and we are constantly gathering new and adding to the set in order to improve snoring detection accuracy. 

For more on snoring please refer to 5. Snoring and Noise Rec.

Continue to next chapter 2. Sleep Tracking.
Comments