欧洲数据格式----EDF+的格式释义及与BDF的区别

EDF+同EDF的区别

1:EDF+ 允许将多个非连续记录存储到一个文件中。这是与EDF唯一不兼容的地方。

2:EDF+ 标头记录可识别患者并根据 EDF 规范指定记录信号的技术特征,但第一个“保留(reserved)”字段(44 个字符)除外。-------------保留字段内容不同

3:如果记录不间断,“保留(reserved)”字段则必须以“EDF+C”开头,因此具有连续的数据记录,即每个数据记录的开始时间与前一个数据记录的结束时间(开始时间 + 持续时间)一致。如果记录中断,“保留(reserved)”字段必须以“EDF+D”开头,因此并非所有数据记录都是连续的。

4:EDF+的“版本(version)”字段必须仍然像EDF一样读'0       '。EDF+软件将从上述“保留(reserved)”字段中知道连续文件和不连续文件之间的区别。

5:“普通信号(ordinary signal)”:一系列 2 字节样本,后续样本表示该信号的后续整数值,以相等的时间间隔进行采样。

6:EDF+数据记录包含根据EDF规范(包括61440的大小限制)的普通信号,但数据记录可以无条件地短于1s,后续数据记录不需要形成连续记录。

7:EDF+中,普通信号的样本在每个数据记录包内必须具有相等的采样间隔,但到下一个数据记录包的第一个样本的间隔可能不同。

8:极端情况下,若每个普通信号在每个数据记录中仅占用一个样本,或文件是不连续的(EDF+D),则将“数据记录的持续时间(duration of a data record)”指定为 0。

9:EDF+中,在header头部分,仅使用字节值为 32到126 的可打印 US-ASCII 字符。

10:标题中的“开始日期(startdate)”和“开始时间('starttime)”字段应仅包含字符0-9,并将句点(.)作为分隔符,例如“02.08.51”。在“开始日期(startdate)”中,使用1985年作为剪辑日期,以避免Y2K问题。因此,1985-1999 年必须用 yy=85-99 表示,2000-2084 年必须用 yy=00-84 表示。2084年之后,yy必须是“yy”。

11:“本地患者标识(local patient identification)”字段必须以子字段开头(子字段不包含空格,但用空格分隔),子字段任何空格都必须替换为其他字符,例如下划线。

12: “数字最大值(Digital maximum)”必须大于“数字最大值(Digital minimum)”。在负放大器增益的情况下,相应的“物理最大值(Physical maximum)”小于“物理最大值(Physical minimum)”。

13:普通信号样本(2 字节 2 的补码整数)必须以“小端序little-endian”格式存储,即最低有效字节优先。这是 PC 应用程序中的默认格式。

14:旧的EDF软件只会将此“EDF注释(EDF Annotations)”信号视为(奇怪的)普通信号。

15:即使不保留注释,EDF+文件也必须至少包含一个“EDF Annotations”信号,以便指定每个数据记录的开始时间(见第2.2.4节)。当然,label中的“EDF Annotations”标签不允许用于普通信号。标头中的“每个数据记录中的样本数(nr of samples in each data record)”字段指定该“EDF Annotations”信号在每个数据记录中占多少2字节整数。

16:“EDF Annotations”信号只有有意义的标题字段“label”和“nr of samples in each data record(每个数据记录中的样本数量)”。为了与EDF兼容,字段“数字最小值(digital minimum)”和“数字最大值(digital maximum)”必须分别填写-32768和32767。“物理最大值(Physical maximum)”和“物理最小值(Physical minimum)”字段必须包含彼此不同的值。该信号的其他字段用空格填充。

17:在时间戳之后,可能会出现所有共享相同发病时间和持续时间的注释列表。每个注释后面都有一个单独的,并且可能不包含任何。一个字节(字节值为0的不可打印ASCII字符)跟在该TAL最后后面。所以TAL以 结尾,后面跟着

18:每个事件只被注释一次,即使它的持续时间使它扩展到其他数据记录的时间段。

19:“EDF注释(EDF Annotations)”数据记录通道的其余部分未使用字节也用字节填充。

20:“EDF注释信号(EDF Annotations signal)”通道中,TAL时间戳信息,以 结尾,后面跟着。多个TAL,则紧跟上一TAL的

21:因此,每个数据记录中第一个“EDF Annotations”信号的第一个注释为空,但其时间戳指定数据记录在文件开始日期/时间之后的秒数。

如果数据记录中的第一个 TAL 读取“+567”,则该数据记录在文件的开始日期/时间后 567 秒开始。

如果数据记录包含“普通信号(ordinary signals)”,则每个数据记录的开始时间必须是其信号的开始时间。例如,'+3456.789R-wav’表示此数据记录在发生 R 波时开始,即文件启动后 3456.789 秒。

22:文件的开始日期/时间在EDF+标题字段“录制开始日期(startdate of recording)”和“录制开始时间(starttime of recording)”中指定。这些字段必须指示第一个数据记录的开头所在的绝对秒。因此,第一个数据记录中的第一个 TAL 始终以 +0.X 开头。(两个空格)。

23:浮点型及16为以上的数据的存储及读取规则:需做对数转换后方可存储,读取后做对数转换后方可显示。另“预过滤(prefiltering)”字段需按以下规则特殊处理。

为了让EDF和EDF+软件知道转换,EDF或EDF+文件头中的“物理维度(physical dimension)”必须为“已过滤(Filtered)”。 ‘physical maximum’=‘digital maximum’=32767,‘digital maximum’=‘digital minimum’=-32767。请注意,数字最小值是-32767,而不是-32768。参数a和Ymin可以自由选择,并且必须与原始信号的维度一起在标头的“预过滤(prefiltering)”字段中指定。此字段应包含“sign*LN[sign*(physical dimension)/(Ymin)]/(a)”,其中“物理维度(physical dimension)”以及a和Ymin的值以8个ASCII字符的数组进行编码(左对齐并用空格填充)。

例如,如果a=0.002,Ymin=0.01,Y的物理尺寸physical dimension 为“uV      ”,则预过滤字段prefiltering field应包含: sign*LN[sign*(uV      )/(0.01    )]/(0.002   )。

Length in bytes

BDF Header:

EDF Header:

EDF Description

Description

EDF+

8 bytes

Byte 1: "255" (non ascii)

Byte 1: "0" (ASCII)

version of this data format (0)

Identification code

Bytes 2-8 : "BIOSEMI" (ASCII)

Bytes 2-8 : " "(ASCII)

80 bytes

User text input (ASCII)

 local patient identification (mind item 3 of the additional EDF+ specs)

Local subject identification

80 bytes

User text input (ASCII)

local recording identification (mind item 4 of the additional EDF+ specs)

Local recording identification

8 bytes

dd.mm.yy (ASCII)

startdate of recording (dd.mm.yy) (mind item 2 of the additional EDF+ specs)

Startdate of recording

8 bytes

hh.mm.ss (ASCII)

starttime of recording (hh.mm.ss)

Starttime of recording

8 bytes

(ASCII)

number of bytes in header record

Number of bytes in header record

44 bytes

"24BIT" (ASCII)

"BIOSEMI" (ASCII)

reserved

Version of data format.

EDF+D

EDF+C

8 bytes

(ASCII)

 number of data records (-1 if unknown, obey item 10 of the additional EDF+ specs)

Number of data records "-1" if unknown

8 bytes

e.g.: "1" (ASCII)

duration of a data record, in seconds

Duration of a data record, in seconds

4 bytes

e.g.: "257" or "128" (ASCII)

number of signals (ns) in data record

Number of channels (N) in data record

N x 16 bytes

e.g.: "Fp1", "Fpz", "Fp2", etc (ASCII)

Labels of the channels

N x 80 bytes

e.g.: "active electrode", "respiration belt" (ASCII)

Transducer type

N x 8 bytes

e.g.: "uV", "Ohm" (ASCII)

Physical dimension of channels

N x 8 bytes

e.g.: "-262144" (ASCII)

e.g.: "-32768" (ASCII)

Physical minimum in units of physical dimension

N x 8 bytes

e.g.: "262143" (ASCII)

e.g.: "32767" (ASCII)

Physical maximum in units of physical dimension

N x 8 bytes

e.g.: "-8388608" (ASCII)

e.g.: "-32768" (ASCII)

Digital minimum

N x 8 bytes

e.g.: "8388607" (ASCII)

e.g.: "32767" (ASCII)

Digital maximum

N x 80 bytes

e.g.: "HP:DC; LP:410"

e.g.: "HP:0,16; LP:500"

Prefiltering

N x 8 bytes

For example: "2048" (ASCII)

Number of samples in each data record

(Sample-rate if Duration of data record = "1")

N x 32 bytes

(ASCII)

Reserved

Byte in file

Which part of 24 bit

Which channel

Which sample of data record

Which data record

1

2

3

Byte 1

Byte 2

Byte 3

Channel 1

1

Duration of data set has been set to "1". So this block will be filled with (1x2048) samples from only "Channel 1"

1

4

5

6

Byte 1

Byte 2

Byte 3

Channel 1

2

7

8

9

Byte 1

Byte 2

Byte 3

Channel 1

3

etc.

Channel 1: sample 4 to sample 2045

6136

6137

6138

Byte 1

Byte 2

Byte 3

Channel 1

2046

6139

6140

6141

Byte 1

Byte 2

Byte 3

Channel 1

2047

6142

6143

6144

Byte 1

Byte 2

Byte 3

Channel 1

2048

6145

6146

6147

Byte 1

Byte 2

Byte 3

Channel 2

1

Duration of data set has been set to "1". So this block will be filled with (1x2048) samples from only "Channel 2"

6148

6149

6150

Byte 1

Byte 2

Byte 3

Channel 2

2

6151

6152

6153

Byte 1

Byte 2

Byte 3

Channel 2

3

etc.

Channel 2: sample 4 to sample 2045

12280

12281

12282

Byte 1

Byte 2

Byte 3

Channel 2

2046

12283

12284

12285

Byte 1

Byte 2

Byte 3

Channel 2

2047

12286

12287

12288

Byte 1

Byte 2

Byte 3

Channel 2

2048

etc.

Channel 03: sample 1 to sample 2048
Channel 04: sample 1 to sample 2048
Channel 05: sample 1 to sample 2048
Channel 06: sample 1 to sample 2048
Channel 07: sample 1 to sample 2048
Channel 08: sample 1 to sample 2048
Channel 09: sample 1 to sample 2048
Channel 10: sample 1 to sample 2048
Channel 11: sample 1 to sample 2048
Channel 12: sample 1 to sample 2048
Channel 13: sample 1 to sample 2048
Channel 14: sample 1 to sample 2048
Channel 15: sample 1 to sample 2048

This block will be filled with (13x2048) samples from "Channels 3-15"

92161
92162
92163

Byte 1

Byte 2

Byte 3

Channel 16

1

This block will be filled with (1x2048) samples from "Channel 16"

92164
92165
92166

Byte 1

Byte 2

Byte 3

Channel 16

2

92167
92168
92169

Byte 1

Byte 2

Byte 3

Channel 16

3

etc.

Channel 16: sample 4 to sample 2045

98296

98297

98298

Byte 1

Byte 2

Byte 3

Channel 16

2046

98299

98300

98301

Byte 1

Byte 2

Byte 3

Channel 16

2047

98302

98303

98304

Byte 1

Byte 2

Byte 3

Channel 16

2048

98305

Byte 1

Trigger LowByte

1

This block will be filled with (1x2048) samples from the Trigger/Status Channel

98306

Byte 2

Trigger HighByte

98307

Byte 3

StatusByte

98308

Byte 1

Trigger LowByte

2

98309

Byte 2

Trigger HighByte

98310

Byte 3

StatusByte

98311

Byte 1

Trigger LowByte

3

98312

Byte 2

Trigger HighByte

98313

Byte 3

StatusByte

etc.

Trigger/Status Channel: samples 4 to sample 2045

104440

Byte 1

Trigger LowByte

2046

104441

Byte 2

Trigger HighByte

104442

Byte 3

StatusByte

104443

Byte 1

Trigger LowByte

2047

104444

Byte 2

Trigger HighByte

104445

Byte 3

StatusByte

104446

Byte 1

Trigger LowByte

2048

104447

Byte 2

Trigger HighByte

104448

Byte 3

StatusByte

104448

104449

104450

Byte 1

Byte 2

Byte 3

Channel 1

1

This block will be filled with (1x2048) samples from only "Channel 1"

2

104451

104452

104453

Byte 1

Byte 2

Byte 3

Channel 1

2

etc

etc

etc

etc

举例:

The header record contains

8 ascii : version of this data format (0)

0

80 ascii : local patient identification

MCH-0234567 F 02-MAY-1951 Haagse_Harry

80 ascii : local recording identification.

Startdate 02-MAR-2002 EMG561 BK/JOP Sony. MNC R Median Nerve.

8 ascii : startdate of recording (dd.mm.yy)

17.04.01

8 ascii : starttime of recording (hh.mm.ss).

11.25.00

8 ascii : number of bytes in header record

768

44 ascii : reserved

EDF+D

8 ascii : number of data records (-1 if unknown)

2

8 ascii : duration of a data record, in seconds

0.050

4 ascii : number of signals (ns) in data record

2

1st signal

2nd signal

ns * 16 ascii : ns * label

R APB

EDF Annotations

ns * 80 ascii : ns * transducer type (e.g. AgAgCl electrode)

AgAgCl electrodes

ns * 8 ascii : ns * physical dimension (e.g. uV)

mV

ns * 8 ascii : ns * physical minimum (e.g. -500 or 34)

-100

-1

ns * 8 ascii : ns * physical maximum (e.g. 500 or 40)

100

1

ns * 8 ascii : ns * digital minimum (e.g. -2048)

-2048

-32768

ns * 8 ascii : ns * digital maximum (e.g. 2047)

2047

32767

ns * 80 ascii : ns * prefiltering (e.g. HP:0.1Hz LP:75Hz)

HP:3Hz LP:20kHz

ns * 8 ascii : ns * nr of samples in each data record

1000

60

ns * 32 ascii : ns * reserved

 参考:EDF specification

EDF+ specification

https://www.biosemi.com/faq/file_format.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值