Skip to content

Commit 7fdd573

Browse files
committed
add multiple header examples
1 parent 7e1efd4 commit 7fdd573

1 file changed

Lines changed: 45 additions & 13 deletions

File tree

spec/header-files.md

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,40 @@ Detailed documentation on header files can be found at: [https://physionet.org/p
2929

3030
The first non-comment line is the **record line**, which provides metadata about the overall record. It includes:
3131

32-
| Field | Description |
33-
|:------|:---------------------------------------------------------------------------|
34-
| Record name | Identifier for the record (letters, digits, underscores only). |
35-
| Number of segments (optional) | If present, appended as `/n`. Indicates a multi-segment record. |
36-
| Number of signals | Number of signals described in the header. |
37-
| Sampling frequency (optional) | Samples per second per signal. Defaults to 250 if omitted. |
38-
| Counter frequency (optional) | Secondary clock frequency, separated from sampling frequency by a `/`. |
39-
| Base counter value (optional) | Offset value for counter, enclosed in parentheses. |
32+
| Field | Description |
33+
|:------|:-----------|
34+
| Record name | Identifier for the record (letters, digits, underscores only). |
35+
| Number of segments (optional) | If present, appended as `/n`. Indicates a multi-segment record. |
36+
| Number of signals | Number of signals described in the header. |
37+
| Sampling frequency (optional) | Samples per second per signal. Defaults to 250 if omitted. |
38+
| Counter frequency (optional) | Secondary clock frequency, separated from sampling frequency by a `/`. |
39+
| Base counter value (optional) | Offset value for counter, enclosed in parentheses. |
4040
| Number of samples (optional) | Total samples per signal when `samps_per_frame`=1; total frames otherwise. |
41-
| Base time (optional) | Start time of the recording (`HH:MM:SS`). |
42-
| Base date (optional) | Start date (`DD/MM/YYYY`). |
41+
| Base time (optional) | Start time of the recording (`HH:MM:SS`). |
42+
| Base date (optional) | Start date (`DD/MM/YYYY`). |
43+
44+
### Examples
45+
46+
#### Basic header (uniform sampling frequency)(record 100 from the [MIT-BIH database](https://www.physionet.org/content/mitdb)):
47+
48+
```text
49+
100 2 360 650000
50+
```
51+
- `100`: Record name (must match the filename prefix).
52+
- `2`: Number of signals in the record.
53+
- `360`: Sampling frequency in Hz.
54+
- `650000`: Total samples for each signal.
55+
56+
#### Multi-frequency header (unique sampling rates per channel):
4357

44-
**Example:**
4558
```text
46-
12345 3 62.5 625 30/01/1989
59+
12345 3 62.5 625 12:00:00 30/01/1989
4760
```
4861
- `12345`: Record name (must match the filename prefix).
4962
- `3`: Number of signals in the record.
5063
- `62.5`: Sampling frequency in Hz.
5164
- `625`: Total frames for each signal. When `samps_per_frame` = 1 (default), this will be the total samples.
65+
- `12:00:00`: The time (`base_time`).
5266
- `30/01/1989`: The date (`base_date`).
5367

5468
---
@@ -74,7 +88,24 @@ Each signal has its own line immediately following the record line (for single-s
7488
| Block size (optional) | Number of samples per block (for formats supporting block I/O). |
7589
| Description (optional) | Free-text description of the signal (e.g., lead name `ECG Lead II`). |
7690

77-
**Example:**
91+
### Examples
92+
93+
#### Basic header (uniform sampling frequency)(record 100 from the [MIT-BIH database](https://www.physionet.org/content/mitdb)):
94+
```text
95+
100.dat 212 200 11 1024 995 -22131 0 MLII
96+
100.dat 212 200 11 1024 1011 20052 0 V5
97+
```
98+
- `100.dat`: Filename of the signal file.
99+
- `212`: Storage format (12-bit two's complement).
100+
- `200`: ADC gain (i.e. number of digital values per physical unit).
101+
- `11`: ADC resolution (bits).
102+
- `1024`: ADC zero value.
103+
- `995`, `1011`: Initial value.
104+
- `-22131`, `20052`: Checksum (sum of all signal samples modulo 2^16).
105+
- `0`: Block size.
106+
- `MLII`, `V5`: Signal labels (e.g., lead names).
107+
108+
#### Multi-frequency header (unique sampling rates per channel):
78109
```text
79110
12345.dat 16x4 200/μV 12 0 0 2178 0 ECG
80111
12345.dat 16x2 16/mmHg 12 0 0 3497 0 ICP
@@ -105,4 +136,5 @@ Each signal has its own line immediately following the record line (for single-s
105136

106137
- A header file may describe signals stored in multiple files or multiple signals in a single file.
107138
- Fields like sampling frequency, counter frequency, and base time/date improve time-aligned analysis but are optional.
139+
- Storage format options and details can be found at: [https://physionet.org/physiotools/wag/signal-5.htm](https://physionet.org/physiotools/wag/signal-5.htm)
108140
- Multi-segment records use a slightly different structure (described separately).

0 commit comments

Comments
 (0)