Main Content

edfinfo

Get information about EDF/EDF+ file

Since R2020b

Description

Create an edfinfo object to get information about a European Data Format (EDF) or EDF+ file. edfinfo objects contain information such as file size, number of data records, number of signals, and number of samples.

Creation

Description

example

info = edfinfo(filename) returns an edfinfo object for the EDF or EDF+ file specified by filename.

Input Arguments

expand all

Name of EDF or EDF+ file, specified as a character vector or string scalar.

Depending on the location of the file, filename can take one of these forms.

Location

Form

Current folder or folder on the MATLAB® path

Specify the name of the file in filename.

Example: 'data.edf'

File in a folder

If the file is not in the current folder or in a folder on the MATLAB path, then specify the full or relative path name.

Example: 'C:\myFolder\data.edf'

Example: 'myDir\myFile.ext'

Note

edfinfo does not support EyeLink® EDF files.

Data Types: char | string

Properties

expand all

File Properties

This property is read-only.

File name, returned as a string scalar.

Example: "ecg_20200411_120.edf"

Data Types: string

This property is read-only.

Date last modified, returned as a string scalar with the date and time the file was last modified.

Example: "11-Apr-2020 15:38:37"

This property is read-only.

File size in bytes, returned as an integer scalar.

Example: 4040992

Data Types: double

Header Properties

This property is read-only.

Data format version, returned as "0".

Data Types: string

This property is read-only.

Patient identification details, returned as a string scalar. Patient identification details can include Patient ID, sex or gender, birth date in 'dd-MMM-yyyy' format, and name.

Example: "X F X 120 04-JUL-1982"

Data Types: string

This property is read-only.

Recording identification details, returned as a string scalar. Recording identification details may include its start date and time, the ID of the technician that made the recording, and the ID of the equipment that made the recording.

Example: "Startdate 04-JUL-1982 X X X"

Data Types: string

This property is read-only.

Recording start date, returned as a string scalar in 'dd.MM.yy' format.

Example: "04.07.82"

Data Types: string

This property is read-only.

Recording start time, returned as a string scalar in 'HH.mm.ss' format.

Example: "17.16.37"

Data Types: string

This property is read-only.

Header size in bytes, returned as an integer scalar. HeaderBytes is given by (256 + NumSignals × 256) bytes. The first 256 bytes correspond to a static header and are required for all EDF and EDF+ files. The other bytes depend on the number of signals present in the data records.

Example: 2048

Data Types: double

This property is read-only.

EDF+ interruption information, returned as "EDF+C" or "EDF+D" for EDF+ compliant files.

  • "EDF+C" — The recording is continuous: There are no interruptions and all data records are contiguous, such that the start time of each data record coincides with the start time of the previous record plus its duration.

  • "EDF+D" — The recording is discontinuous with interruptions between consecutive data records.

For files that are not EDF+ compliant, this property is an empty string ("").

Data Types: string

This property is read-only.

Number of data records in file, returned as an integer scalar.

Note

If filename is not EDF compliant, NumDataRecords can be set to -1 when the number of data records is unknown. If filename is EDF compliant, NumDataRecords must be set to a positive integer. If filename has Reserved set to a nonempty string and NumDataRecords set to -1, edfinfo throws an error.

Data Types: double

This property is read-only.

Duration of each data record, returned as a duration scalar.

Data Types: duration

This property is read-only.

Number of signals in file, returned as an integer scalar.

Data Types: double

Signal Record Properties

This property is read-only.

Signal names, returned as a string vector of length NumSignals.

["Thorax 1";"Abdomen 3"]

Data Types: string

This property is read-only.

Transducer details, returned as a string vector of length NumSignals. Each element of TransducerTypes contains details about the transducer used to obtain the corresponding signal in SignalLabels.

Example: ["AgAgCl electrodes";"thermistor"]

Data Types: string

This property is read-only.

Signal data units, returned as a string vector of length NumSignals. Each element of PhysicalDimensions contains the measurement units used to express the values of the corresponding signal in SignalLabels.

Example: ["uV";"mV"]

Data Types: string

This property is read-only.

Signal minimum physical value, returned as a numeric vector of length NumSignals. Each element of PhysicalMin contains the minimum physical value of the corresponding signal in SignalLabels.

Data Types: double

This property is read-only.

Signal maximum physical value, returned as a numeric vector of length NumSignals. Each element of PhysicalMax contains the maximum physical value of the corresponding signal in SignalLabels.

Data Types: double

This property is read-only.

Signal minimum digital value, returned as a numeric vector of length NumSignals. Each element of DigitalMin contains the minimum digital value of the corresponding signal in SignalLabels.

Data Types: double

This property is read-only.

Signal maximum digital value, returned as a numeric vector of length NumSignals. Each element of DigitalMax contains the maximum digital value of the corresponding signal in SignalLabels.

Data Types: double

This property is read-only.

Number of samples in signal, returned as a numeric vector of length NumSignals. Each element of NumSamples contains the number of samples in the corresponding signal in SignalLabels.

Data Types: double

This property is read-only.

Signal data units, returned as a string vector of length NumSignals. Each element of Prefilter contains details about the filters, if any, used to preprocess the corresponding signal in SignalLabels.

Example: ["HP:10Hz LP:80Hz N:60Hz";"HP:0.1Hz LP:90Hz N:60Hz"]

Data Types: string

This property is read-only.

Additional signal information, returned as a string vector of length NumSignals. Each element of SignalReserved contains additional information, if any, about the corresponding signal in SignalLabels.

Data Types: string

This property is read-only.

Annotations present in signal records, returned as a timetable containing these variables:

  • Onset — Time at which the annotation occurred, expressed as a duration indicating the number of seconds elapsed since the start time of the file.

  • Annotations — A string that contains the annotation text.

  • Duration — A duration scalar that indicates the duration of the event described by the annotation. If the file does not specify an annotation duration, this variable is returned as NaN.

Data Types: table

Examples

collapse all

Use the edfinfo function to create an edfinfo object containing information about the file example.edf.

info = edfinfo('example.edf')
info = 
  edfinfo with properties:

              Filename: "example.edf"
           FileModDate: "30-Oct-2020 12:27:26"
              FileSize: 31488
               Version: "0"
               Patient: "Patient 7"
             Recording: "Startdate not recorded"
             StartDate: "10.10.20"
             StartTime: "12.02.18"
           HeaderBytes: 768
              Reserved: ""
        NumDataRecords: 6
    DataRecordDuration: 10 sec
            NumSignals: 2
          SignalLabels: [2x1 string]
       TransducerTypes: [2x1 string]
    PhysicalDimensions: [2x1 string]
           PhysicalMin: [2x1 double]
           PhysicalMax: [2x1 double]
            DigitalMin: [2x1 double]
            DigitalMax: [2x1 double]
             Prefilter: [2x1 string]
            NumSamples: [2x1 double]
        SignalReserved: [2x1 string]
           Annotations: [0x2 timetable]

Display this information about the second signal in the file:

  • Its name

  • The physical units in which the data is expressed

  • The minimum and maximum physical values of the data

  • The number of samples it contains

nsig = 2;

disp([info.SignalLabels(nsig) info.PhysicalDimensions(nsig) ...
    info.PhysicalMin(nsig) info.PhysicalMax(nsig) info.NumSamples(nsig)])
    "ECG2"    "mV"    "-229.048"    "229.041"    "1280"

Tips

You can convert an edfinfo object to a MATLAB structure using the get function. For example:

info = edfinfo('example.edf');
strc = get(info)

References

[1] Kemp, Bob, Alpo Värri, Agostinho C. Rosa, Kim D. Nielsen, and John Gade. “A Simple Format for Exchange of Digitized Polygraphic Recordings.” Electroencephalography and Clinical Neurophysiology 82, no. 5 (May 1992): 391–93. https://doi.org/10.1016/0013-4694(92)90009-7.

[2] Kemp, Bob, and Jesus Olivan. "European Data Format 'plus' (EDF+), an EDF Alike Standard Format for the Exchange of Physiological Data." Clinical Neurophysiology 114, no. 9 (2003): 1755–1761. https://doi.org/10.1016/S1388-2457(03)00123-8.

Version History

Introduced in R2020b

See Also

| | | |

External Websites