Get information about EDF file
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.
filename
— Name of EDF or EDF+ fileName of EDF or EDF+ file, specified as a character vector or string scalar.
Depending on the location of the file, filename
can take on one of
these forms.
Location | Form |
---|---|
Current folder or folder on the MATLAB® path | Specify the name of the file in
Example:
|
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:
Example:
|
Note
edfinfo
does not support EyeLink® EDF files.
Data Types: char
| string
Filename
— File nameThis property is read-only.
File name, returned as a string scalar.
Example: "ecg_20200411_120.edf"
Data Types: string
FileModDate
— Date last modifiedThis 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"
FileSize
— File size in bytesThis property is read-only.
File size in bytes, returned as an integer scalar.
Example: 4040992
Data Types: double
Version
— Data format version"0"
This property is read-only.
Data format version, returned as "0"
.
Data Types: string
Patient
— Patient identification detailsThis property is read-only.
Patient identification details, returned as a string scalar. Patient
identification details can include their Patient ID, their sex or gender, their birth
date in 'dd-MMM-yyyy'
format, and their name.
Example: "X F X 120 04-JUL-1982"
Data Types: string
Recording
— Recording identification detailsThis 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
StartDate
— Recording start dateThis property is read-only.
Recording start date, returned as a string scalar in 'dd.MM.yy'
format.
Example: "04.07.82"
Data Types: string
StartTime
— Recording start timeThis property is read-only.
Recording start time, returned as a string scalar in 'HH.mm.ss'
format.
Example: "17.16.37"
Data Types: string
HeaderBytes
— Header size in bytesThis 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
Reserved
— EDF+ interruption information"EDF+C"
| "EDF+D"
| ""
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
NumDataRecords
— Number of data records in fileThis 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
DataRecordDuration
— Duration of each data recordThis property is read-only.
Duration of each data record, returned as a duration scalar.
Data Types: duration
NumSignals
— Number of signals in fileThis property is read-only.
Number of signals in file, returned as an integer scalar.
Data Types: double
SignalLabels
— Signal namesThis property is read-only.
Signal names, returned as a string vector of length NumSignals
.
["Thorax 1";"Abdomen 3"]
Data Types: string
TransducerTypes
— Transducer detailsThis 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
PhysicalDimensions
— Signal data unitsThis 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
PhysicalMin
— Signal minimum physical valueThis 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
PhysicalMax
— Signal maximum physical valueThis 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
DigitalMin
— Signal minimum digital valueThis 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
DigitalMax
— Signal maximum digital valueThis 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
NumSamples
— Number of samples in signalThis 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
Prefilter
— Signal data unitsThis 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
SignalReserved
— Additional signal informationThis 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
Annotations
— Annotations present in signal recordsThis 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.
Annotation
— 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
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: "14-Apr-2020 20:55:44" FileSize: 31488 Version: "0" Patient: "patient1" Recording: "Startdate not recorded" StartDate: "27.03.20" StartTime: "10.00.00" 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"
You can convert an edfinfo
object to a MATLAB structure using the get
function. For
example:
info = edf('example.edf');
strc = get(info)
[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.
You have a modified version of this example. Do you want to open this example with your edits?