Timestamp Correction for Accurate Temporal Reference

How timestamps are corrected during export to ensure accurate and consistent temporal alignment across signals

This section explains the nature of the timestamps collected in real-time and its correction during the export procedure to provide an accurate temporal reference. 

Each signal is associated with an initial timestamp (t₀), derived from the computer’s internal clock at the beginning of the recording. Due to Bluetooth communication between the amplifier and the computer, the raw timing information may include jitter.

To ensure accurate timing, robust statistical methods are applied during the export process to estimate corrected timestamps and provide a consistent temporal reference. 

EDF and CSV-Full formats 

In the EDF and CSV-Full export formats, all signals are synchronized to a common starting point (t₀). This means that each signal shares the same time base, enabling direct comparison across channels without additional processing. 

When a signal starts recording later than others, its initial samples are filled with NaN values so that alignment is preserved. In the same way, missing samples caused by temporary Bluetooth transmission losses are identified using the sequence numbers provided by the hardware and are also filled with NaNs. This approach ensures that the temporal structure of the data remains consistent and that all signals are properly aligned.

Along with the exported signal files, a metadata file (in JSON format) is generated. This file contains the initial timestamp (t₀), expressed both in the computer’s internal clock and as a UTC timestamp in microseconds. Based on this reference, the timestamp of each sample can be computed using the sampling rate (SR) of the signal, following the expression: 

ti = t0 + i / SR 

where ti represents the timestamp of sample i. Additionally, the timestamp estimation incorporates corrections for Bluetooth-related jitter, resulting in a more stable and reliable temporal reference. 

CSV-Lite format 

In the CSV-Lite format, synchronization between signals is not enforced, and the data is provided in a more raw form. Signals are not aligned to a common starting point, and missing samples are not filled with NaNs. 

Instead, the exported data includes the reception timestamps recorded at the computer, which inherently reflect the variability introduced by Bluetooth communication, as well as the sequence numbers of each data block. This information allows users to reconstruct the timing and perform their own synchronization procedures if needed. 

In addition, a corrected timestamp is provided for each sample. This corrected timestamp is computed using robust statistical methods to compensate for Bluetooth jitter and offers a more accurate temporal reference than the raw reception timestamps, while still allowing full flexibility for custom alignment.