Non uniform intervals in the timestamps
I am experiencing challenges in acquiring uniformly sampled EEG data using the OpenBCI Cyton+Daisy (16 channels) platform, both with the official OpenBCI_GUI and custom Python scripts via BrainFlow. Despite the board’s claimed 125 Hz sampling rate (8 ms interval), the data arrives in bursts with periodic gaps of around 0.06 s, resulting in clusters of samples.
As I am into preparing the EEG dataset for Motor Imagery task, accurate, millisecond-level timing is crucial with perfectly regular timebase. While I understand that some of these issues are due to the board’s wireless transmission and buffering, I am seeking advice on how to best mitigate or correct for these timestamp inconsistencies in my datasets. Is there a recommended approach—either in acquisition or in post-processing—that ensures samples are placed on a truly uniform grid without sacrificing fidelity or introducing artefacts? Are there acquisition settings, firmware updates, or best practices that can help achieve a dataset with actual 8 ms accuracy between samples?
Any guidance from the community or OpenBCI team on how to minimize or eliminate these timing irregularities, or how to robustly reconstruct an accurate, uniformly sampled dataset when milliseconds matter, would be greatly appreciated. If others have faced and solved this, please share your strategies or recommendations.
Thank you!
Comments
Hi Sand,
Please read some of these previous Forum posts. The timestamps are not generated inside the Cyton, but instead by Brainflow in the laptop after the radio packet samples have been buffered by Bluetooth, OS, USB data streaming.
https://www.google.com/search?as_q=timestamp+buffering&as_sitesearch=openbci.com
That search produced by the blue button in the upper right column.
William
Thank you for your response, I know that the time stamps that are generated is not the actual time taken during eeg acquisition. These delays and jitters are caused by the latency and the buffering during the transmission processes. Can I conclude myself that for my offline data acquisition, I can just manually set the time intervals to 8ms so that the dataset will have uniform data points across the session?
But while doing so how do I know if there is any data loss if it had occur during acquisition or during transmission of eeg signal to my laptop.
And for the real time analysis like in BCI applications, how to tackle the latency issues so that the data streaming is consistent.
There are two metrics, jitter and latency. There is no jitter, the samples / packets are generated at the fixed interval you mention 8 ms (4ms for 8 channel). If you read the previous Forum posts, the sample clock is not crystal controled, so actual rate may differ slightly from 125.000 Hz slightly, but is constant frequency.
The latency is also relatively constant, but can vary if there is a lot of Bluetooth or Wifi activity in your area. Typically only couple milliseconds or less.
For detecting lost samples, that is what the 'packet counter' in the data stream is for. It cycles by one from 0 to 255 and back again. Missing values would indicate missing samples. Generally this should be rare.
Regards,
Thank you, I will be looking at the packet counter in the data stream. What do you say for this "Can I conclude myself that for my offline data acquisition, I can just manually set the time intervals to 8ms so that the dataset will have uniform data points across the session?" And this "And for the real time analysis like in BCI applications, how to tackle the latency issues so that the data streaming is consistent".
I thought I already answered those questions. The latency is minimal and only a few ms at most. Your sample interval is 8 ms, so no issue. Yes the time intervals are 125.xxx Hz, but the xxx is constant and could be a few hundredths of a hz.
Okay thank you