eWav file format

The eWav file format draws inspiration from the TIFF 6.0 standard and the Sun/NeXT audio file formats.

eWav files are organized in three areas: the eWav File Header (WFH), the eWav File Directory (WFD), and the eWav data area. An eWav file that contains multiple channels has one WFD and one eWav data area per channel stored. The data is stored in little-endian format.

Each WFD has zero or more tags containing information about the associated channel stored.


typedef struct {
    char magic[5];                 /* File major number */
    u_int8_t version_major;        /* Major version number */
    u_int8_t version_minor;        /* Major version number */
    u_int8_t version_sub;          /* Major version number */
    u_int64_t WFD_Offset;          /* Offset from beginning of file to first eWav File Directory */
} eWavHead;                        /* 16 bytes */

typedef struct { u_int32_t TagID; /* Tag identifier */ u_int32_t DataType; /* The scalar type of the data item */ u_int64_t DataOffset; /* Offset from beginning of file to data item */ } EWAVTAG; /* 16 bytes */

The TagID indicates what the tag information represents.

Time Offset 1000 uint32
Leads 1001 field8
Average Heart Rate 1002 float
Predominant Rhythm 1003 field8
Lead II P Wave Morphology 1004 field8
PQ Interval 1005 float
QRS Wave Duration 1006 float
S Wave Amplitude 1007 float
Q Wave Amplitude 1008 float
QT Interval 1009 float
ST Segment 1010 field8
ST Segment Displ 1011 float
ST Segment Displ Lead 1012 field8
T Wave Amplitude 1013 float
Artifacts 1014 field16
Abnormalities_Noted 1015 field16
Notes 1016 ASCII

DataType contains a value indicating the scalar data type of the information found in a tag. The following values are supported:

1 1 byte bit field u_int8_t field8
2 2 byte bit field u_int16_t field16
3 4 byte bit field u_int32_t field32
4 8 byte bit field u_int64_t field64
5 Unsigned 8 bit Integer u_int8_t uint8
6 Signed 8 bit Integer int8_t int8
7 Unsigned 16 bit Integer u_int16_t uint16
8 Signed 16 bit Integer int16_t int16
9 Unsigned 32 bit Integer u_int32_t uint32
10 Signed 32 bit Integer int32_t int32
11 Unsigned 64 bit Integer u_int64_t uint64
12 Signed 64 bit Integer int64_t int64
13 4-byte single-precision IEEE floating point value float float
14 8-byte double-precision IEEE floating point value double double
15 ASCII NULL terminated string char[] ASCII

typedef struct {
    u_int32_t  NumTagEntries;      /* Number of tags in WFD */
    EWAVTAG    Taglist[];          /* Array of tags */
    u_int64_t  NextWFDOffset;      /* Offset from beginning of file to next eWav File Directory */
    u_int64_t  ImageOffset;        /* Offset from beginning of file to ecg data */
    u_int32_t  offset;             /* offset from beginning of file to beginning of ecg sugnal data */
    u_int32_t  length;             /* Length of channel in samples */
    u_int8_t   samplebits;         /* Number of bits in sample (always 16 for version 1.x) */
    u_int32_t  scale_time;         /* This is the number of horizontal samples in one second */
    u_int32_t  scale_voltage;      /* This is the number of vertical samples in one second */
} eWavChannelheader;               /* variable size */


H. Paul Hammann
Last modified: Wed Oct 21 11:21:46 CDT 1998