Skip to content

EDF+ Annotation Timestamps missing submillisecond accuracy #7872

@greydongilmore

Description

@greydongilmore

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions