Calibrating the device is easy. Start by examining your bed for a “safe” spot, where the phone can be left for the night. It has to be on your mattress. Next, find a source of power to keep the phone charging through the night.
This option is the quickest and easiest. The phone does not have to be at rest. Simply click “Quick calibration” and wait for the calibration bar to fill up. The calibration activity closes after it is done (may take a few seconds after the bar fills up).
Note: On some Samsung and Droid phones, the bar fills up very slowly. In such cases, take the phone and gently roll it around in your hand until the bar fills up. I tested this on a Droid phone and it took about 60 seconds.
Extended calibration: Pass 1
[notice]I changed the filter parameters in Version 0.7.3. They are now less sensitive, to fix the “app doesn’t score sleep” bug![/notice]
Some phones will require more precise calibration, as the built- in filter may not work for your device. In such case, you will need to perform an extended calibration:
- go to Preferences:Calibrate device sensors.
- Change calibration duration to 15 minutes.
- Click calibrate accelerometer
- On the accelerometer screen touch “extended calibration”
- Wait for the yellow bar to fill up, graphs will be shown after that. If your phone’s graph does not fill up, you may have to move it yourself. (I still need to test this).
When you see output like this, you can calibrate the app’s filter:
Now you may move the phone slightly, the graph will update next minute and show your movement. The image below registers device being rolled around in my hand. Notice that the blue line follows the output slower, resulting in larger activity count.
The goal is to find a value of R (Kalman Filter process noise covariance) high enough to produce output close to 0 when phone is at rest, yet responsive enough to movement. For example:
- I start the app and leave it flat on a desk without vibration.
- After a minute, I look at the calibration output. The activity counts (below the graph for each axis) that I see are: xFiltered Low R 15000, xFiltered 1000, xFilteredHighR 50;
- Activity counts for both xFilteredLow and xFiltered are too large for phone being at rest. I would like to reduce them. To do so I’ll need a new value of R
- The difference between the value of R for filtered, low filtered and high filtered is 10 times.
- This means that if the filter uses value R =0.0004 to filter the X axis output, the low R is 0.00004 and high R is 0.004.
- Based on the numbers I observed, I know that the output should be close to 0 when the phone is at rest on a table.
- To reduce the activity count output, I need to make R parameter larger. It is easy – I just assign the high R value for the next iteration.
- To change the value, I open the menu (menu button>Adjust R)
- I multiply the current value by 10: instead of 0.0004 I enter 0.004 for x R.
- I repeat the process, tweaking the R value until the app shows activity count close to 0 on all axis when the phone is at rest.
I then test the app with light vibration. Activity counts should be significantly higher than 0. If they are not, I may proceed to lower the R value for the axis which does not respond to vibration.
Extended Calibration: pass 2
Now that you have tweaked the value of R for your phone, you may leave the phone in an extended calibration mode for 15-60 minutes (configure this in preferences>Calibrate Device Sensors>Calibration Duration). This will adjust the sleep scoring constant based on the output of your device.
The default settings produce a constant of 0.0034, which is suitable for most beds and devices. If your bed is really stiff, you may want to lower the sensitivity threshold: Preferences> Sensitivity Tunin> Adjust Cole constant. Then Override cole constant.
The default setting is anything less than 44 activity counts a minute will be considered sleep. If your bed is stiff, you may wish to lower this value to 25 or so.
, so the app is more responsive to small movements.