Binary file format
This article describes the binary file format used when you export raw accelerometer data with the file format Binary. For how to export the file, see Data export. For example scripts in R and Python, see Processing of raw accelerometer data.
The binary file has no header — it consists only of samples, stored back to back. Each sample is 12 bytes, with the most significant byte first (big-endian):
- 6 bytes = Unix timestamp in milliseconds (UTC)
- 2 bytes = X, signed 16 bit integer x 0.0078125 G
- 2 bytes = Y, signed 16 bit integer x 0.0078125 G
- 2 bytes = Z, signed 16 bit integer x 0.0078125 G
Range: -4G to +4G, 10 bit resolution
Example (three samples, with the bytes shown in hexadecimal):
- 016C87D85F170022FFD9FFAC
- 016C87D85F6E0022FFD9FFAC
- 016C87D85FC50022FFD9FFAC
The first line decodes as:
- Timestamp 016C87D85F17 = 1565647200023 ms = 12 August 2019, 22:00:00.023 UTC
- X 0022 = 34 × 0.0078125 = 0.27 G
- Y FFD9 = −39 × 0.0078125 = −0.30 G
- Z FFAC = −84 × 0.0078125 = −0.66 G
