Polybench® for biosignals / reference 1.34.1

EDF+ File Format provider


Reads files with file header EDF+ SAMPLE FILEversion 2004 and writes EDF+ files (ver. 2004) in 16 bit resolution, with or without annotations.



This stream interface offers settings that specify how the interface should work. Those settings are available in the properties dialog as well as in variable parameters.

Physical range
Default value: 1(-100/100);2(-100/100);3(-1000/1000);
Defines the physical minimum and maximum in units of the physical dimension. Format: n(x/y);n+1(x/y); where n = channel number (starts with 1), and x/y means x = min and y = max. Some known channel names (e.g. EOG) may lead to a special automatic default range, to get the default min/max for that channel name (see manual). You may write ALL(x/y) to specify all channels to have a range; and RANGE[a/b](x/y), to let channel a until b have the specified range.

Transducer type
Default value:
Defines the transducer type of the electrode. Format: n(T);n+1(T); where n = channel number (starts with 1), and T = transducer type text (e.g. AgAgCl electrode). Use ALL(T) to set the same text for all channels. Use RANGE[a/b](T) to set the text for channel a until b.

Default value:
Defines the prefiltering of each channel. Format: n(P);n+1(P); where n = channel number (starts with 1), and P = prefiltering text (e.g. HP:0.1Hz LP:75Hz). Use ALL(P) to set the same text for all channels. Use RANGE[a/b](P) to set the text for channel a until b.

Default value: YES
Set to YES if event markers in the signal should be stored into the file as annotations, or NO if they should not be. The events will still be saved in a separate CSV-file.

Events Space
Default value: 100
Set the space into the file for annotations in digital words of 2 bytes. By default 100, which in a standard situation is enough for over 100 characters for event codes per second. Minimal value is 8. If you take this value too small, not all annotations can be stored! If that happens, the last annotation of a data block will be '!'.


If you want to record using this well known file format, then you have to consider two important things:

1. The format stores sample values in only 16 bit width. Polybench works with 64-bit values. In order to get the Polybench samples into the EDF+ file, the values are scaled so that they fit in the EDF+ format, as is described by Bob Kemp et al. in their EDF file format specification. As a result, the samples that you read from an EDF+ file may have a small deviation from the original values, because the resolution of the values have become smaller.
You have to specify yourself how the signals need to be scaled, because an optimal scaling depends on the range in which your signal is moving. You can specify this in the Storage operator ("Storage") properties, after you have selected the EDF+ file format. The signal range has to be specified for every channel (or you may define all channels to have an equal range).

Note that if you take the range too large, that you get a very bad resolution of your signal (your signal may even dissolve and look like a zero-signal afterwards). If you take the range too small, then signals that exceed the range will be cut off! So, if you specify the physical range 1(-1000/1000); and your signal on channel 1 get higher than 1000, then in the file the signal will be cut off to the value of 1000.

2. Event markers (called annotations in EDF+) need space that you have to specify in advance. In the Storage operator you specify the Event Space. If that value is too small to hold all event markers in a section of the signal (for example in one second worth of samples), then some annotations will get lost! If that happens, the last annotation of that section will become '!'. So if you see the annotation '!' you know that originally there were more event markers, but they have not been saved inside the EDF+ file. They do have been saved in the event CSV file, so you won't loose them completely.

Specification of EDF+

The original article about the European Data Format (EDF) was published by Elsevier. An extension of EDF, named EDF+, was developed in 2002 and is largely compatible to EDF. All existing EDF viewers also show EDF+ signals. But EDF+ files can also contain interrupted recordings, annotations, stimuli and events. Therefore, EDF+ can store any medical recording such as EMG, Evoked potentials, ECG, as well as automatic and manual analysis results such as deltaplots, QRS parameters and sleep stages. The specs are stricter than EDF which enables automatic localization and calibration of electrodes. And EDF+ fixed a few major (Y2K problem, little-endian integers, comma vs dot) and minor omissions in EDF.

EDF+ was published in 2003 in Clinical Neurophysiology 114, pages 1755-1761 and written by Bob Kemp, Alpo Vaerri, Thomas Penzel, and Jesus Olivan
The specification can be found online (search for EDF+ specification).

Typical settings of the physical limits of the signals

            Application    min. value    max. value
            BIP            -100 uV       100 uV
            DIG               0           32
            EAG            -100 uV       100 uV
            ECG            -100 uV       100 uV
            EEG              50 uV       -50 uV
            EGG            -100 uV       100 uV
            EMG            -100 uV       100 uV
            EOG            -125 uV       125 uV
            ExG            -100 uV       100 uV
            FLOW           -180 l/min    180 l/min
            FiO2             21 %        100 %
            Hypnogram      -0.9          6.9
            Pulse            30 BPM      250 BPM
            SaO2             75 %        100 %
            Saw             -64           64
            SpO2             90 %        100 %
            Defaults range settings are min. = -1000 and max. = 1000, if 
            the signal is not as called above.