BDF+


What is BDF+?

BDF+ is the 24-bits version of EDF+. EDF+ is the popular medical time series storage fileformat.
EDF+ stores digital samples (mostly from an analog to digital converter) in two bytes, so the maximum
resolution is 16 bit. However, 24-bit ADC's are becoming more and more popular. The data produced
by 24-bit ADC's can not be stored in EDF+ without losing information.
BDF+ stores the datasamples in three bytes, giving it a resolution of 24 bit.

Like EDF+ is an extension of EDF, BDF+ is an extension to BDF. BDF is the 24-bits version of EDF used
by Biosemi, hence the name Biosemi Data Format. A description of the BDF fileformat can be found at the
website of Biosemi: http://www.biosemi.com/faq/file_format.htm

(Note that the author is not affiliated to Biosemi.)

The idea behind BDF+ is that EDF+ software can be easily modified to accept BDF+ because the headers
are the same, only the samplesize of the datapart increased from two to three bytes per sample.

BDF+ is compatibel with BDF. BDF+ files can be read and processed by older BDF software.


Why BDF+ instead of BDF?

For the same reasons like it is better to use EDF+ instead of EDF.

EDF+ and BDF+ can:

- contain more patient- and other info in the header.
- contain annotations/events.
- be discontinuous (can store interrupted recordings).
- store the date in four digit format instead of two digits ("2008" instead of "08").


Differences between BDF+ and EDF+:

For a complete format description of BDF+, you need the EDF+ format description as well.
It can be found here: http://www.edfplus.info/specs/edfplus.html

Because the differences between EDF+ and BDF+ are small, only these differences will
be described here:

- The filename must end with ".bdf" or ".BDF" without the quotes.

- The version field must contain the following 8 octets: 0xff, 0x42, 0x49, 0x4f, 0x53, 0x45, 0x4d, 0x49.

- In case the recording is continuous (uninterrupted recording), the reserved field (44 octets) must start with the string "BDF+C" without the quotes.
In case the recording is not continuous (interrupted recording), the reserved field (44 octets) must start with the string "BDF+D" without the quotes.
The rest of this field must be filled with spaces (0x20).

- The label field of the BDF annotationchannel(s) (16 octets) must contain "BDF Annotations " without the quotes.

- The digital minimum field of the BDF annotationchannel(s) (8 octets) must contain "-8388608" without the quotes.

- The digital maximum field of the BDF annotationchannel(s) (8 octets) must contain "8388607 " without the quotes.

- Contrary to EDF+, there is no size-recommendation (or limitation) for the datarecords.

- Contrary to EDF+, annotations, for instance stimuli, that are related to information in only one particular data record,
  do not need to be in that same data record.

- Any datarecord duration value greater than 0 is allowed, like 1234, 1.4567, 0.0001, etc.

- The 24-bit data samples are two's complement and little endian:


     +-----------------------+-----------------------+-----------------------+
 LSB |01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24| MSB
     +-----------------------+-----------------------+-----------------------+
     |       byte 1          |       byte 2          |       byte 3          |
     |                                                                       |
     |<-------------------------- one sample ------------------------------->|


Differences between BDF+ and BDF:

- In BDF+ the patientfield is divided in five subfields:
- patientcode
- sex
- birthdate
- patientname
- additional info

- In BDF+ the recordingfield is divided in five subfields:
- the text "Startdate" followed by the startdate itself
- administrationcode
- a code specifying the responsible investigator or technician
- a code specifying the used equipment
- additional info

For details about how to write these subfields, read the EDF+ specification.

- In BDF+ the reserved field (44 octets) starts with the string "BDF+C" without the quotes or
  "BDF+D" without the quotes.

- A BDF+ file contains at least one signal which has the label "BDF Annotations ". No other signals
  will have this label except for annotations.
  The first annotations-signal must contain a timestamp for every datarecord as described in the
  EDF+ format description. For details, read the EDF+ specification.


What software is available to view, check and convert BDF+ files?

EDFbrowser supports BDF+. It has also a built-in BDF+ format checker which makes it easy to check your files
for possible errors.

EDFbrowser has a BDF+ to EDF+ converter.

EDFbrowser is available for download here.

EDFlib is a programming library for C/C++ for reading and writing EDF, EDF+, BDF and BDF+ files.

EDFlib is available for download here.