Monitoring sleep with a smartphone accelerometer