Documentation:

SleepAnalyser

About SleepAnalyser:

Sleep Analyser records your movement during your sleep.
It is able to visualise it on a graph to show how much you move during your sleep. This can help to indicate how you sleep.
It also has an alarm function. You can set the alarm and a time window (ex. 30 minutes). The Alarm will then go off sometimes during the time window (as soon as your movements are over the trigger level), but latest at the set alarm time.
Old records can be loaded and visualised. SleepAnalyser also has a test function. It will record and visualise much faster. Also it will make a beep when ever your movement goes over the trigger level.

How to start:

To start, just click on "Recording only" or "Alarm + recording" and put the phone beside your pillow onto the mattress. It will record all your movements and visualise it.
If you use the "Test recording" function, it will record and visualise much faster. Also it will make a beep when ever your movement goes over the trigger level.

Recording only:

After you clicked on "Recording only", the recording window will open and the recording starts. The recording is delayed for several seconds, so you have enought time to put the phone beside your pillow.
During or after the recording you can add a note, change the zoom and trigger level. It is useful to add a note of how your sleep really was. In that way it is later on easier to understand the graph. The trigger level defines how the sleep durations are indicated. If you have set an alarm (see below), it also defines when the alarm should be activated.
The recording is stopped when you close the Recording window or click on "Stop". A new window will open where you can chose if you want to keep the record or remove it. If you keep it, the record will be opened in the view window.

Alarm + recording:

If you click on "Set Alarm", you can set an alarm and a time window to wake you up.
The Alarm will then go off sometimes during the time window (as soon as your movements are over the trigger level), but latest at the set alarm.
Note: SleepAnalyser uses the MAEMO built in alarm functions. So even in the case that SleepAnalyser would crash, the alarm will go off at the set time.

After you set the alarm, the recording window will open and the recording starts. From now on it is the same as with "Recording only", except an alarm is set and shown in the graph.

View Record:

If you click on "View Record", the View window opens and shows the last created record. With the two arrow buttons on the left bottom side, you can go through the records stored in ~/MyDocs/SleepAnalyser/. Also you can open a specific record in any directory. If you click on the date button, you can select a record from a specific date (only from the folder ~/MyDocs/SleepAnalyser/) Like in during the recording, you can also set/change a note,m zoom in or out or change the trigger level. Additionaly, in the view window you can scroll through the graph and delete the record.

Settings

There are a few settings you can change:

More parameters can be set in the file ~/SleepAnalyser/SleepAnalyser.conf.
How ever you should only touch them if you know what you do! Normally they don't have to be adjusted.

Record files

During recording, the data is also written to a record file. Every time you start recording, a new file is created. The files are saved in the folder ~/MyDocs/SleepAnalyser/.

Graph:

In the Recording or View Window you will see the graph with your movements and other details: Graph
Your Movements are shown yellow. If the movements are stronger, the bars go higher.

At the bottom of the graph you can see horizontal bars in different colors. They represent the time between the movements over the trigger level:

The white line in the graph shows the currently set trigger level for the bars. There is also a white number on the right side indicating the trigger level. You can lower/raise it with the up/down buttons. You will have to experiment with it as it is different for everybody depending how soft your mattress is and how far away you put the phone. Those conditions will have an affect on how the phone records your movement.
The gray line and number (View window only) show the originally set trigger level for this record.

If you have set an alarm, you will see an orange bar in the graph with the set time window for the alarm.
If the alarm goes off, it will be marked with a red point:
Graph

Good to know:

The application will drain the battery around 20% per night. It is suggested to put the phone onto the charger while using SleepAnalyser for a longer time.

Make sure the phone is not covered with your pillow, so it will not overheat.

If you don't feel confident to have a phone close beside hour head for the whole night, activate the option "Offline Mode" in the settings window. It then will automatically change into Offline Mode while it records.

How it works:

SleepAnalyser uses the built in acceleration sensor to detect your movements. Every second it measures 10 times how the phone lies and calculates your movements. To make it more accurate, it always merges the values of 10 seconds together.

If the movement is over the set trigger point, it can set off the alarm and will visualise it in the graph. There is no magic behind it! All it does, is to visualise your movements. Please be aware that this can not be used scientific to figure out in which sleep phase you are. If you want to do that, you need a proper measurement equipment!
I know that the iPhone application "SleepCycle" indicates your sleep cycles, but scientists proved that it is not very accurate. I am sure "SleepCycle" use a similair methode than SleepAnalyser and has not more data.
As I do not want to trick you, I only show the information I really have and do not make anything up!

Disclaimer:

This application is distributed for free under the GPL. You may redistribute and modify it freely, as long as you follow the rules of the GPL.
I will not give any warranty for any harm on people, environment or the phone.
Feedback and donations are very welcome.

Copyright:

Copyright 2010 by George Ruinelli (george@ruinelli.ch).
For more information, please visit https://garage.maemo.org/projects/sleepanalyser/.

The icons are from KDE Nuvola theme (by David Vignoni) and KDE Oxygen theme (by Oxygen Team)