You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some EDF readers will complain when they get an EDF+ format file (as all exports from EDF.jl are) that does not have an annotation signal. When I went back to the spec, it does seem to say that an annotation signal is required, although it's not perfectly clear to me.
As I'm reading it now, the relevant parts of the EDF+ spec are
2.2.1. The 'EDF Annotations' signal
EDF+ data records can (and often do) contain ordinary signals. EDF+ introduces one other kind of signal, in which the values are annotations that can occur at any arbitrary point of time. This signal is identified by giving it (in the EDF+ header) the label 'EDF Annotations'. As in EDF, the 'nr of samples in each data record' field in the header specifies how many 2-byte integers this 'EDF Annotations' signal occupies in each datarecord. But instead of storing 'ordinary signal' samples, those 2-byte integers are filled with characters. The character-bytes are stored byte-by-byte without changing their order. For instance, the text 'abc' is represented by successive byte values 97, 98 and 99 in the 'EDF Annotations' signal. Even if no annotations are to be kept, an EDF+ file must contain at least one 'EDF Annotations' signal in order to specify the starttime of each datarecord (see section 2.2.4). Of course, the label 'EDF Annotations' is not allowed for ordinary signals.
and
2.2.4. Time keeping of data records
Because data records need not be contiguous, the starttime of each data record must be specified in another way. So, the first annotation of the first 'EDF Annotations' signal in each data record is empty, but its timestamp specifies how many seconds after the filestartdate/time that data record starts. So, if the first TAL in a data record reads '+5672020', then that data record starts 567s after the startdate/time of the file. If the data records contain 'ordinary signals', then the starttime of each data record must be the starttime of its signals. If there are no 'ordinary signals', then a non-empty annotation immediately following the time-keeping annotation (in the same TAL) must specify what event defines the starttime of this data record. For example, '+3456.7892020R-wave20 indicates that this data record starts at the occurrence of an R-wave, which is 3456.789s after file start.
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.
I think fixing this is pretty easy: we already check whether the signals contain an AnnotationsSignal when writing a discontiguous (EDF+D) format and error if not; we might be able to just insert an empty one if it's missing for continguous files. However, if I'm not totally clear that that satisfies the requirement that every datarecord in teh first EDF Annotations signal contains the timestamp for that data record even for a totally empty signal, so we might need to a bit of extra massaging.
The text was updated successfully, but these errors were encountered:
Some EDF readers will complain when they get an EDF+ format file (as all exports from EDF.jl are) that does not have an annotation signal. When I went back to the spec, it does seem to say that an annotation signal is required, although it's not perfectly clear to me.
As I'm reading it now, the relevant parts of the EDF+ spec are
and
I think fixing this is pretty easy: we already check whether the signals contain an
AnnotationsSignal
when writing a discontiguous (EDF+D) format and error if not; we might be able to just insert an empty one if it's missing for continguous files. However, if I'm not totally clear that that satisfies the requirement that every datarecord in teh firstEDF Annotations
signal contains the timestamp for that data record even for a totally empty signal, so we might need to a bit of extra massaging.The text was updated successfully, but these errors were encountered: