My favorites | Sign in
Project Home Wiki Issues Source
Search
for
XliCompressionScheme  
Sierra ECG XLI Compression Scheme
Featured, Phase-Design
Updated Jan 9, 2012 by christop...@gmail.com

Introduction

This Sierra ECG XML format, utilized by Philips brand of cardiac monitors, compresses 12-Lead data using the XLI format. This format is not documented anywhere. Philips provided some example applications which decompress the XLI compressed data in the XML file. However, these are not easy to reuse, nor are they cross platform.

Details

The XLI compression format is relatively straightforward. It is chunked per lead, and utilizes both LZW compression and delta codes.

The general outline for decompression is the following:

  1. Read an 8-byte chunk header
    • The compressed data size is the first 32-bit integer
    • The next 16-bit integer is always 1
    • The next 16-bit integer is the first uncompressed delta code.
  2. Read size bytes
  3. Decompress using LZW (10-bit codes)
  4. The resulting 16-bit data is sorted with most significant byte in the first half and least significant byte in the bottom half. Reconstitute the data by interleaving the two halves.
  5. Decode the data from the delta codes
  6. Reconstruct leads III, aVR, aVL, and aVF from leads I and II

Decompressed Data

The decompressed data is split into two halves, the MSB in the first half and the LSB in the second half. This is presumably done to improve the compression as the is little difference amongst the MSBs.

# input contains the decompressed data
# output will contain the interleaved 16-bit delta codes
fun unpack( input[], output[], nSamples )
    for i <- 1..nSamples
        output[i] <- (input[i] << 8) | input[nSamples + i]
    endfor
endfun

Delta Compression Scheme

# output contains the 16-bit delta codes
# first is the 16-bit delta code from the chunk header
fun deltaDecompression( output[], nSamples, first )
    x <- output[1]
    y <- output[2]
    prev <- first
    for i <- 3..nSamples
        z <- (2 * y) - x - prev
        prev <- output[i] - 64
        output[i] <- z
        x <- y
        y <- z
    endfor
endfun

Limb Lead Reconstruction Scheme

Reconstruction of the remaining limb leads (III, aVR, aVL, and aVF) should be done after the completion of the delta decompression. The channel data for each of the leads appears to be used to ensure the proper sign of the output data, and also includes what appears to be a noise component.

# Lead III
for i <- 1..nSamples
    leads{III}[i] = leads{II}[i] - leads{I}[i] - leads{III}[i]
endfor

# Leads aVR, aVL, and aVF
# (these rely on Lead III, so be sure to calculate it first)
for i <- 1..nSamples
    leads{aVR}[i] = -leads{aVR}[i] - (leads{I}[i] + leads{II}[i]) / 2
    leads{aVL}[i] = (leads{I}[i] - leads{III}[i]) / 2 - leads{aVL}[i]
    leads{aVF}[i] = (leads{II}[i] + leads{III}[i]) / 2 - leads{aVF}[i]
endfor

Sign in to add a comment
Powered by Google Project Hosting