Biomedical Engineering Reference
In-Depth Information
non-zero elements of array d[] are copied in new array e[], while each zero
sequence is represented by two-byte combination. The first element is fixed as 255.
The second element is equal to 200 plus the number of successive zeros.
So, encoding rule for sequence of n-consecutive zeros:
First encoded byte = 255 (fixed)
Second encoded byte = 255 ? n, where n C 1
For example, a sequence of 15 zeros will be encoded as 255 and 215 combi-
nation. Now, if the number of zeros exceeds 54, the second element exceeds 255
and hence cannot be represented by a byte. Therefore, the excess number of zeros
above 254 will be represented by a separate two-byte combination. For example, a
sequence of 59 zero elements will be represented as (255, 254) and (255, 205)
combination.
Table 5.1 summarizes the encoding rules described in Sect. 5.3.1 .
For proper reconstruction, the amplified sampling time of the original dataset
and the normalization constant (k) are essential to be available to the decoding
device. Hence, these are prefixed as first five elements of the data array e[]. The
decoder extracts these five elements from the encoded byte stream and starts
decoding from 6th element onwards. After this final stage of compression, the
array elements in e[] are converted to corresponding 8-bit ASCII character and
stored sequentially in a data file, which is the final version of compressed data.
5.3.2 Stages of Decoding
The decompression algorithm developed follows an exact inverse sequence w.r.t.
compression stages to generate the original ECG samples. The starting point of
decompression is the ASCII formatted 8-bit data. So, at first, these are converted
into corresponding unsigned integer and a new array w[] is formed. The first 5
elements of this array are extracted out, and a new array p[] is formed from 6th
element of w[]. The successive stages of decompression are described in following
sections.
The decompression process starts with zero element extraction in array p[] by
searching a consecutive byte pair 255 followed by a number between 200 and 254.
The other elements are just copied in the new array q[]. At first, the number of
Table 5.1 Summary of encoding rules
Encoded element
Interpretation for decoding stage
255 followed by a number in the range 200-254
Zero sequence
Any value in the range 0-255 followed
by a number less than 200
Sign byte
Any value in the range 0-99
Combined elements
Any value in the range 100-199
Uncombined elements
Search WWH ::




Custom Search