Skip to content

Commit 7e1efd4

Browse files
committed
update hea example
1 parent ec26a82 commit 7e1efd4

1 file changed

Lines changed: 32 additions & 14 deletions

File tree

spec/header-files.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,35 @@ A header file contains:
2121

2222
Each line must be under 255 characters, and fields are separated by spaces or tabs (except where otherwise noted).
2323

24+
Detailed documentation on header files can be found at: [https://physionet.org/physiotools/wag/header-5.htm](https://physionet.org/physiotools/wag/header-5.htm)
25+
2426
---
2527

2628
## Record Line
2729

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

30-
| Field | Description |
31-
|:------|:------------|
32-
| Record name | Identifier for the record (letters, digits, underscores only). |
33-
| Number of segments (optional) | If present, appended as `/n`. Indicates a multi-segment record. |
34-
| Number of signals | Number of signals described in the header. |
35-
| Sampling frequency (optional) | Samples per second per signal. Defaults to 250 if omitted. |
36-
| Counter frequency (optional) | Secondary clock frequency, separated from sampling frequency by a `/`. |
37-
| Base counter value (optional) | Offset value for counter, enclosed in parentheses. |
38-
| Number of samples (optional) | Total samples per signal. |
39-
| Base time (optional) | Start time of the recording (`HH:MM:SS`). |
40-
| Base date (optional) | Start date (`DD/MM/YYYY`). |
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. |
40+
| 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`). |
4143

4244
**Example:**
4345
```text
44-
100 2 360 650000 12:00:00 01/01/2000
46+
12345 3 62.5 625 30/01/1989
4547
```
48+
- `12345`: Record name (must match the filename prefix).
49+
- `3`: Number of signals in the record.
50+
- `62.5`: Sampling frequency in Hz.
51+
- `625`: Total frames for each signal. When `samps_per_frame` = 1 (default), this will be the total samples.
52+
- `30/01/1989`: The date (`base_date`).
4653

4754
---
4855

@@ -69,9 +76,20 @@ Each signal has its own line immediately following the record line (for single-s
6976

7077
**Example:**
7178
```text
72-
100.dat 212 200 11 1024 995 0 MLII
73-
100.dat 212 200 11 1024 995 0 V5
79+
12345.dat 16x4 200/μV 12 0 0 2178 0 ECG
80+
12345.dat 16x2 16/mmHg 12 0 0 3497 0 ICP
81+
12345.dat 16x1 2500/Ohm 12 0 0 1366 0 RESP
7482
```
83+
- `12345.dat`: Filename of the signal file.
84+
- `16`: Storage format (16-bit integers).
85+
- `x4`,`x2`,`x1`: 4, 2, and 1 samples per frame, respectively. This indicates that the ECG signal has `157 * 4 = 628` samples while the ICP signal has 314 samples and the RESP signal has 157 samples.
86+
- `200/μV`, `16/mmHg`, `2500/Ohm`: ADC gain (i.e., number of digital values per physical unit).
87+
- `12`: ADC resolution (bits).
88+
- `0`: ADC zero value.
89+
- `0`: Initial value.
90+
- `2178 `, `3497`, `1366`: Checksum (sum of all signal samples modulo 2^16).
91+
- `0`: Block size.
92+
- `ECG`, `ICP`, `RESP`: Signal labels (e.g., lead names).
7593

7694
---
7795

0 commit comments

Comments
 (0)