question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EDF+ Annotation Timestamps missing submillisecond accuracy

See original GitHub issue

It was noticed that the onset time for annotations in an EDF+ file might be missing the submillisecond accuracy accociated with the start time of the recording. This results in annotation timestamps being delayed from the true event time.

Expected results

The EDF+ file used here contains patient data and cannot be shared. However, if this bug is confirmed all EDF+ files will be affected.

If the EDF+ file is brought into EDFbrowser it will be noticed that the millisecond aspect of the start time is displayed in the Start field:

thumbnail_Outlook-ibjnd242

For instance, this results in the annotation timestamps being:

thumbnail_Outlook-of2qriv1

Actual results

When loading the data into MNE the annotation timestamps return:

thumbnail_Outlook-dnk5ugfi

If you take the difference between the MNE timestamp and the EDFbrowser timestamp it is equal to the submillisecond portion of the recording start time.

Additional information

I reached out to Teunis van Beelen, the developer of EDFbrowser, to get an explanation. The explanation provided was as follows:

EDF does not have support for subsecond precision of the starttime but EDF+ does. Because EDF+ needed to be backwards compatible with EDF and EDF doesn’t have the possibility to write subsecond precision for the starttime into the header, the subsecond part of the starttime is written outside of the EDF header. The way the subsecond part of the starttime is stored in EDF+ is described here: https://www.edfplus.info/specs/edfplus.html#timekeeping

Teunis van Beelen provided a quote from the EDF specs:

“The startdate/time of a file is specified in the EDF+ header fields ‘startdate of recording’ and ‘starttime of recording’. These fields must indicate the absolute second in which the start of the first data record falls. So, the first TAL in the first data record always starts with +0.X2020, indicating that the first data record starts a fraction, X, of a second after the startdate/time that is specified in the EDF+ header. If X=0, then the .X may be omitted.”

In other words, the subsecond part of the starttime is written in the EDF Annotations “signal”.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
skjernscommented, Jun 9, 2020

@greydongilmore this is because we haven’t integrated the new EDFlib version 1.17 yet (see https://github.com/holgern/pyedflib/pull/81)

I hope I find time soon to implement the changes.

0reactions
greydongilmorecommented, Jun 8, 2020

@cbrnr interestingly though pyEDFlib is a python wrapper for EDFlib and it also shows the incorrect behavior… just tested

Read more comments on GitHub >

github_iconTop Results From Across the Web

EDF+ / Annotations / Most are missing when importing the .edf ...
I've been trying to import some recordings that have events saved as annotations in the edf+ file and I'm having trouble to successfully...
Read more >
EDF+ specification - European Data Format
Text, time-keeping, events and stimuli are coded as text annotations in this 'EDF Annotations' signal. The annotations are listed in Time-stamped Annotations ......
Read more >
EyeLink Programmer's Guide - SR Research
Performing research with eye-tracking equipment typically requires a long-term investment in software tools to collect, process, and analyze data.
Read more >
Nanosecond Accuracy in Network Control Systems
The aim of this thesis is to prove it is possible to control and coordinate machines at sub-nanosecond accuracy. The demonstration case was...
Read more >
LITMUSRT: A Status Report∗ - UNC Computer Science
dition, features such as high-resolution timers, prior- ... NP-EDF, and S-PD2, a deadline is missed. ... dle applications requiring sub-millisecond.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found