# Wavelet transform and Huffman coding based electrocardiogram compression algorithm: Application to telecardiology

Sid Ahmed Chouakri, O Djaafri, Abdelmalik Taleb-Ahmed

► To cite this version:

Sid Ahmed Chouakri, O Djaafri, Abdelmalik Taleb-Ahmed. Wavelet transform and Huffman coding based electrocardiogram compression algorithm: Application to telecardiology. 24th IUPAP Conference on Computational Physics, IUPAP-CCP 2012, Oct 2012, Kobe, Japan. pp.012086, 10.1088/1742-6596/454/1/012086. [https://doi.org/10.5281/epub.13330](https://doi.org/10.5281/epub.13330)

HAL Id: hal-03613330

https://uphf.hal.science/hal-03613330

Submitted on 28 Apr 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
OPEN ACCESS

# Wavelet transform and Huffman coding based electrocardiogram compression algorithm: Application to telecardiology

To cite this article: S A Chouakri et al / 2013 J. Phys.: Conf. Ser. **454** 012086

View the [article online](#) for updates and enhancements.

You may also like

- [Signal quality in cardiorespiratory monitoring](#)
Gari D Clifford and George B Moody

- [Simultaneous Monitoring of ECG and EDA Using a Wearable Armband for Analyzing Sympathetic Nerve Activity](#)
Farzad Mohaddes, Yilu Zhou, Jenna Pedersen et al.

- [National Instruments LabVIEW Biomedical Toolkit for Measuring Heart Beat Rate and ECG LEAD II Features](#)
W L Khong, M Mariappan and N S V Kameswara Rao

<figure><img src="image_2.png" /></figure>

The Electrochemical Society
Advancing solid state & electrochemical science & technology

## 241st ECS Meeting

Vancouver, BC, Canada. May 29 – June 2, 2022

<figure><img src="image_3.png" /></figure>

ECS Plenary Lecture featuring

Prof. Jeff Dahn,
Dalhousie University

<figure><img src="image_4.png" /></figure>

Register now!

<figure><img src="image_5.png" /></figure>
# Wavelet transform and Huffman coding based electrocardiogram compression algorithm: Application to telecardiology

S A Chouakri¹, O Djaafri¹ and A Taleb-Ahmed²

¹Laboratoire de Télécommunications et Traitement Numérique du Signal, University of Sidi Bel Abbes, Algeria

²Laboratoire LAMIH, Université de Valenciennes et du Hainaut Cambrésis, France

E-mail: sa_chouakri@hotmail.com

**Abstract.** We present in this work an algorithm for electrocardiogram (ECG) signal compression aimed to its transmission via telecommunication channel. Basically, the proposed ECG compression algorithm is articulated on the use of wavelet transform, leading to low/high frequency components separation, high order statistics based thresholding, using level adjusted kurtosis value, to denoise the ECG signal, and next a linear predictive coding filter is applied to the wavelet coefficients producing a lower variance signal. This latter one will be coded using the Huffman encoding yielding an optimal coding length in terms of average value of bits per sample. At the receiver end point, with the assumption of an ideal communication channel, the inverse processes are carried out namely the Huffman decoding, inverse linear predictive coding filter and inverse discrete wavelet transform leading to the estimated version of the ECG signal. The proposed ECG compression algorithm is tested upon a set of ECG records extracted from the MIT-BIH Arrhythmia Data Base including different cardiac anomalies as well as the normal ECG signal. The obtained results are evaluated in terms of compression ratio and mean square error which are, respectively, around 1:8 and 7%. Besides the numerical evaluation, the visual perception demonstrates the high quality of ECG signal restitution where the different ECG waves are recovered correctly.

## 1. Introduction

Telemedicine is defined as a part of medicine that uses the transmission, by telecommunication means, of medical information (images, recording, etc.), to obtain a diagnosis, from a specialized, remote monitoring of a patient and a therapeutic decision [1]. For the World Health Organization (WHO) [2], telemedicine is a branch of medicine. It enables to bring the health to where the distance and isolation are factors limiting its access. They use NICT (New Information and Communication Technologies) for diagnosis, treatment and prevention, research and ongoing prevention.

The history of telemedicine began in the 1960s in the United States, with particular networking tele-consultation and tele-education around the Nebraska Psychiatric Institute programs [3-6]. Technological developments have helped remote transmission, in real time, of medical data that involved, firstly, voice and image transmission.

Technically, telemedicine is based on the exchange of data between several terminals. Several technical solutions have been tested with varying degrees of success to enable the transmission of

<figure><img src="image_6.png" /></figure>

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
information. The main physical supports for data transmission are the twisted pair (Ethernet, for example), coaxial cables, telecommunications, satellite links network and optical fiber.

Telecardiology, a widespread discipline of telemedicine, is a method of remote sensing a cardiovascular pathology. Compression is a method to manipulate an initial set of data by coding to save storage space. Electrocardiogram (ECG) signal compression has become more important with the development of telemedicine; it can significantly reduce the costs of transmission of medical information through telecommunication channels. There are two broad categories of the ECG signal compression algorithms: lossy and lossless.

Numerous works have been developed in the context of analysis and compression of the ECG signal, using various techniques of processing of the signal such as AZTEC, SAPA, KLT, DCT and the Fourier transform; we quote principally [7-11].

The time-frequency joint analysis (and we focus mainly on the wavelet transform) seemed one of the alternatives to the theory of Fourier. Wavelets are applied in the analysis of the signal (for example, the location of discontinuities in a signal), functional analysis (e.g. numerical analysis) and the processing of the signal (the coding into sub-bands) [12]. Wavelets are considered to be one of the most interesting tools for various ECG signal processing applications; we cite a few techniques: compression, denoising, analysis of the ECG signal. Mentioning a few works in the wavelet domain [13-15], who used the wavelet transform for compression of the signal ECG, Chen et al. (1993) [16] got a compression ratio of the ECG signal up to 22.9:1, Bradie (1996) [17] completed the compression by wavelet packets for the ECG signal compression. Miaou and Lin (2002) [18] have worked on biorthogonal wavelets [19]. Ku CT et al. (2010) [20] conducted research on the ECG signal compression by the wavelet transform based on the calculation of linear control quality.

Advanced telemedicine applications require a sophisticated and expensive telecommunications infrastructure. The main technologies used in wireless systems, namely GSM, 3G (W-CDMA, CDMA2000 and TD-CDMA), wireless GPRS, satellite and local area network wireless [21-24].

## 2. Telemedicine system

A telemedicine system can essentially be composed of a material with a computer that transmits signal/image to another computer remotely. Each of the computers must be connected to a modem that ensures the interface of the PC an analog channel. The images can be viewed, stored and transmitted to the remote computer. Software includes tools to scan, transmit, process and compress images. A communication network connects the two computers between which data is to be exchanged. A classic telemedicine channel, used in biomedical devices, is represented in figure 1 [25].

<figure><img src="image_7.png" /><figcaption>**Figure 1.** Synoptic scheme of telemedicine channel.</figcaption></figure>

The components of the telemedicine channel, from the patient until the distant doctor, are first the collection of physiological signals by electrodes then the processing of data (decorrelation). The physiological signal decorrelation requires transformation methods, which operate a transformation of the original data. The physiological signal is decomposed on a basis of functions, and then the coefficients of the decomposition are quantified. The quantized coefficients are stored in a vector in a pre-determined order. The coding is the last step in the chain of compression.
### 3. Compression

Typical signal processing for automated medical systems acquired a large amount of data difficult to store and transmit [26-27]. The compression is to reduce the amount of data required for the description of the information. It is a technique to manipulate a set of initial data by a given encoding to save storage space. Note that compression can be divided into two types: lossy compression and lossless compression. In order to achieve these effects, it is desirable to find a method to reduce the amount of data without loss of important information [6, 28].

In the case of lossless compression, information (signal, sound, image, etc.) rebuilt after decompression is identical to the original data. No distortion is introduced on the bits of information. Thus, the process of compression will not alter the original signal. In contrast, lossy compression introduces irreversible disruption but allows a much greater compression rate than that obtained by lossless methods.

There is a wide variety of information compression techniques. In order to compare these methods, different criteria are necessary.

#### 3.1. The measurement of the compression

The measurement of the compression and the reconstruction error are usually mutually dependent and are generally used for the calculation of the rate of deformation of the compressed signal induced by the algorithm.

##### 3.1.1. Error criteria

Most of ECG compression algorithms use the Percentage of Root Mean Square Difference (PRMSD) between the original signal and the compressed one [26]

$$PRMSD = \sqrt{\frac{\sum_{n=1}^{N}(x(n)-\bar{x}(n))^2}{\sum_{n=1}^{N}x(n)^2}} \times 100, \quad (1)$$

where $x(n)$ is the original signal, $\bar{x}(n)$ is the reconstructed signal, and N represents the number of samples of the signal. There are other measures of error to compare original signal versus the reconstructed one, such as the root mean square error (RMS)

$$RMS = \sqrt{\frac{\sum_{n=1}^{N}(x(n)-\bar{x}(n))^2}{N}}. \quad (2)$$

Another measure of deformation is the SNR signal-to-noise ratio, which is been expressed as

$$SNR = 10 \log \left( \frac{\sum_{n=1}^{N}(x(n)-\bar{x}(n))^2}{\sum_{n=1}^{N}(x(n)-\bar{x}(n))^2} \right), \quad (3)$$

where $\bar{x}$ is the average value of the original signal.

#### 3.1.2. Compression evaluation

The compression rate (CR) is defined as the ratio to the bitrate of the original signal to the compressed signal bitrate.

### 4. Materials

#### 4.1. Wavelet analysis

Signal analysis dates back to 1807, when J. Fourier developed his famous theory [29-30]. New technologies pushed researchers to introduce new techniques; among those one called the time-frequency representation, mainly presented by Gabor in 1946, and Wiegner-Ville in 1948. However these techniques had some limitations. A. Grossman and J. Morlet, in 1983, introduced the "wavelet"
the main feature of which was the variable scale. After that date many works enriched the wavelet theory; we limit ourselves to quote the work of Y. Meyer, in 1985, who introduced the orthogonal basis for DWT, that of S. Mallat, in 1988, who introduced the multiresolution analysis (MRA), and that of I. Daubechies, in 1988, who developed regular wavelets with compact support [12, 31-33]. One of the various fields of application of wavelet theory is biomedical signal. There are, generally, two principal applications: analysis and filtering. The first one mainly includes the detection and recognition of forms of different waves of ECG signals, while the second one includes the ECG signal denoising and compression techniques.

### 4.1.1. The continuous wavelet transformation (CWT)

The CWT of a signal $f(t) \in L^2(R)$ is the inner product of the function $f(t)$ and the set of the functions $\psi_{s,\tau}(t)$, called wavelet and given by [34]

$$ Wf(s, \tau) = \langle f, \psi_{s,\tau} \rangle = \frac{1}{\sqrt{s}} \int f(t) \psi^* \left( \frac{t-\tau}{s} \right) dt \quad (4) $$

The wavelet functions $\psi_{s,\tau}(t)$ are generated from a prototype function called 'mother wavelet' $\psi(t)$ by scaling and translation:

$$ \psi_{s,\tau}(t) = \frac{1}{\sqrt{s}} \psi\left(\frac{t-\tau}{s}\right) \quad (5) $$

where $s$ is the scaling factor, with $s > 0$, and $\tau$ is the shifting factor.

### 4.1.2. The discrete wavelet transform DWT

The CWT allows the time-frequency analysis of a signal $f(t)$ with its fine details as the factor of scale and translation are iterated continuously. However, the CWT is very redundant. Y. Meyer has shown that they exist of wavelet functions $\psi_{s,\tau}(t)$ such as $s = 2^j$ and $\tau = k \cdot 2^j$ with $j$ and $k \in \mathbb{Z}$. The functions $\psi_{j,k}(t)$ constitute an orthonormal basis in $L^2(R)$. These wavelets $\psi_{j,k}(t)$ are given by:

$$ \psi_{j,k}(t) = 2^{-j/2} \psi(2^{-j}t - k), \quad (6) $$

which means that any function $f(t) \in L^2(R)$ can be decomposed upon the bases $\psi_{j,k}(t)$ as follows:

$$ f(t) = \sum_{j,k} \sum_{L} d_{j,k}(t) \psi_{j,k}(t) \quad (7) $$

$$ \text{with } d_{j,k}(t) = \langle f, \psi_{j,k} \rangle = \int f(t) \psi_{j,k}(t) dt. \quad (8) $$

More generally, the function $f(t) \in L^2(R)$ can be expressed as follows:

$$ f(t) = \sum_{k \in \mathbb{Z}} a_L(k) \phi_{L,k}(t) + \sum_{j=1}^{L} \sum_{k \in \mathbb{Z}} d_j(k) \psi_{j,k}(t) \quad (9) $$

$$ \text{with } a_L(k) = \langle f(t), \phi_{L,k}(t) \rangle \quad (10) $$

The DWT consists of applying the discrete signal to a bank of octave band filters. Figure 2 illustrates the DWT process.

### 4.2. Thresholding

Wavelet thresholding is a non-linear method to suppress noise corrupted to the signal of interest. A threshold is estimated and referring to it the noise is removed. The choice of the threshold is a very delicate and important statistical problem. On the one hand, a big threshold leads to a large bias of the estimator. But on the other hand, a small threshold increases the variance of the smoother.
<figure><img src="image_8.png" /><figcaption>Figure 2. Schematic wavelet series decomposition.</figcaption></figure>

The threshold value is computed, using a set of strategies, according to the model of the signal to denoised - s(i) - and the corrupted noise - e(i) -. The underlying model for the noisy signal is the superposition of the signal s(i) and a Gaussian white noise with a noise power of σ, that is [35-36]:

$$f(i) = s(i) + \sigma e(i) \qquad (11)$$

Two strategies of thresholding are used: 'hard' and 'soft' (T<sub>soft</sub> and T<sub>hard</sub> respectively). In hard thresholding, known as crude thresholding, the coefficients whose absolute values are lower than the threshold *Thr* are eliminated that is set to zero. The soft thresholding, known as shrinkage algorithm, is a nonlinear operation that sets to zero the coefficients whose absolute values are lower than the threshold *Thr*, and then shrinks the nonzero coefficients towards zero.

Mathematically saying, this can be expressed as follows:

$$T_{soft}=sign(x) . (|x|-Thr) \qquad (12)$$

$$T_{hard}=x.I(|x|>Thr)$$

### 4.3. High order statistics (HOS)

High Order Statistics measures are extensions of second-order measures (such as the autocorrelation function and power spectrum) to higher orders. The second-order measures work fine if the signal has a Gaussian (Normal) probability density function, but many real-life signals are non-Gaussian.

In probability theory and statistics, kurtosis is any measure of the "peakedness" of the probability distribution of a real-valued random variable. *Kurtosis* is a descriptor of the shape of a probability distribution [37-39].

For univariate data $Y_1, Y_2, ..., Y_N$, the formula for kurtosis is:

$$kurtosis = \frac{\sum_{i=1}^{N} (Y_i - \bar{Y})^4}{(N-1)s^4}, \qquad (13)$$

where $\bar{Y}$ is the mean, s is the standard deviation, and N is the number of data points.

The kurtosis for a standard normal distribution is three. For this reason, some sources use the following definition of kurtosis (often referred to as "excess kurtosis"):

$$kurtosis = \frac{\sum_{i=1}^{N} (Y_i - \bar{Y})^4}{(N-1)s^4} - 3. \qquad (14)$$

This definition is used so that the standard normal distribution has a kurtosis of zero. In addition, with the second definition positive kurtosis indicates a "peaked" distribution and negative kurtosis indicates a "flat" distribution.
### 4.4. Huffman coding

In Huffman coding, the data are represented as a set of variable length binary words. The lengths depend on the occurrence frequency of the symbols used for representing each signal value. Characters that are used often are represented with fewer bits, and those that are seldom used are represented with more bits. This is a statistical data compression method that allows reducing the average length of the coding of an alphabet [40].

The Huffman coding algorithm allows building a variable length coding with an average length that is close to the entropy of the source. The principle illustrated by figure 3 is as follows:

1) The symbols are listed in order of decreasing probability. Is then assigned two low probability symbols 0 and 1 bits.

2) The two symbols are combined into a fictional symbol which the probability is the sum of the probabilities of elementary symbols. A new bit 0 and 1 are arbitrarily attributed to each branch.

3) The procedures 1) and 2) is repeated until the list has more than two elements to which we affect bits 0 and 1.

4) The code for each initial symbol is then obtained from the root of the tree to the leaves. Figure 3 illustrates an example of Huffman coding of an alphabet with five symbols {$a_1, a_2, a_3, a_4, a_5$}.

<figure><img src="image_9.png" /><figcaption>Figure 3. An example of Huffman coding.</figcaption></figure>

### Linear prediction

The applications of the linear prediction coding are multiple from signal compression to digital control. In General, the calculation of the coefficients of the linear prediction [41] is summarized as follows.

The problem is set as follows: If one knows N samples of a signal $x[n]$, how to determine the p "optimal" coefficients $a_j$ such that the prediction error is the smallest possible on the block duration N.

$$e[n] = x[n] - \sum_{j=1}^{p} a_j x[n-j] \quad \text{where} \quad p[n] = \sum_{j=1}^{p} a_j x[n-j] \quad (15)$$

is the prediction at time n of the sample $x[n]$.

We can see the Predictor as a filter that takes $x[n]$ input, and which produces the prediction error output $e[n]$. By applying the Z-transform to the difference equation, we obtain
$$E(z) = \left(1 - \sum_{j=1}^{p} a_j z^{-j}\right). \qquad (16)$$

So $A(z)$ of this predictor filter transfer function is given by

$$A(z) = 1 - \sum_{j=1}^{p} a_j z^{-j} \qquad (17)$$

and the inverse predictor transfer function is given by:

$$\frac{1}{A(z)} = \frac{1}{1 - \sum_{j=1}^{p} a_j z^{-j}} \qquad (18)$$

<figure><img src="image_10.png" /><figcaption>Figure 4. Typical scheme of the linear prediction encoder.</figcaption></figure>

In the diagram of figure 4, $x(n)$ is the original signal, $e(n)$ is the output of the Predictor filter "analysis", $\hat{e}(n)$ is the inverse Predictor filter entry "synthesis" and $\hat{x}(n)$ is the reconstructed signal with $A(z) = 1 + a_1 z^{-1} + \cdots + a_p z^{-p}$.

## 5. Algorithm description

We propose in this paper, an ECG signal compression algorithm based on the wavelet transform and higher-order statistics (HOS), using the linear prediction coding followed by Huffman encoding to transmit the compressed signal via an ideal channel, and evaluate the performance of the compression system. The particularity of the ECG signal is to be compressed in the irreversible cases (non-conservative compression) under severe quality constraints that can be measured in terms of the PRD (Percentage of the RMS Difference). Our work is registered in the thesis of the telecardiology. The WHOSC method was proposed in [42-43], where the encoding of the ECG data is performed by linear prediction coding (LPC) of wavelet coefficients. Our contribution is the introduction of Huffman coding whose objective is an improvement in quantifying quality gains by reducing the number of bits representing the samples. Figure 5 shows the proposed algorithm.

<figure><img src="image_11.png" /><figcaption>Figure 5. ECG signal compression algorithm scheme.</figcaption></figure>
A more detailed flowchart of the proposed algorithm is shown in figure 6. The algorithm is applied to the ECG signals extracted from the MIT-BIH ARRYTHMIA database. Two criteria are used as metrics of the quality of the obtained signal: CR compression ratio and the mean square error RMSE (MSE).

## 5.1. Transmission

The transmission phase of our algorithm consists of the following steps:

### A) Decoding of MIT-BIH ARRYTHMIA records

The decoding of the MIT-BIH ARRYTHMIA records phase allows extracting and decoding. Each record contains 560000 samples and which would be partitioned into segments of 8192 = (2¹³) samples.

### B) ECG signal pre-processing

The preprocessing phase consists of ECG signal high pass filtering by the 4th order Butterworth filter model with a normalized very low cutoff frequency signal frequency of 0.001 to remove the DC component presented in the original ECG signal. The Butterworth filter transfer function is given by [44]:

$$H(f) = \frac{1}{\sqrt{1+(f/f_c)^{2n}}} \qquad (25)$$

H(f): Transfert function of the filter

f_c: normalized cutoff frequency and n: Butterworth filter order

### C) DWT based ECG signal decomposition

The wavelet transform can effectively represent the non-stationarities and the localized time components of the ECG signal. The ECG signal could well be coded with a scheme of wavelet-based coding; the wavelet function "db6" was chosen because it offers a better result, likewise we chose the level three of decomposition of the ECG signal based on DWT because it gives a good quality of the reconstructed ECG signal.

### D) HOS based thresholding

The significant DWT coefficients selection procedure involves the application of HOS based thresholding. In particular, each DWT scale j (j∈z) is estimated by the flattening (kurtosis) k_j, and the used kurtosis is multiplied by an adjustment factor F_{aj} as a criterion of thresholding at each scale of DWT. The method used to calculate the threshold is the kurtosis, given by:

$$w_j^s > THR_j = k_j F_{aj}, \qquad (26)$$

where w_j^s represent the significant details DWT coefficients at scale j.

The choice of the value adjustment factor was set at $F_{aj} = 1/10$.

### E) LPC coding

In our algorithm, we use the linear prediction coding (LPC) applied to the thresholded coefficients. The basic idea behind this method in the analysis of the ECG signal is that the thresholded ECG data can be approximated as a linear combination of samples from ECG signal. At the output of the predictor filter output it is seen a decrease on the ripples as it is presented in figure 7.

We remark, well, there is a decrease in the mean amplitude of the samples of the prediction error, and a greater correlation between the prediction filter input signal and the prediction error.

### F) Huffman coding

Huffman coding is to associate with each symbol an optimized code. The probability of occurrence of the symbol in the message is taken into account, combining the shortest possible code for the 'common' symbol i.e. with the highest probability.
<figure><img src="image_12.png" /><figcaption>**Figure 6.** ECG signal compression algorithm flowchart.</figcaption></figure>
<figure><img src="image_13.png" /><figcaption>**Figure 7.** The thresholded ECG signal (blue line) in superposition with the ECG signal coded by the LPC filter (red line).</figcaption></figure>

The quantification is the primary step in the encoding of the source in which the volume of information is reduced in a significant way at the cost of a loss of information. Quantization rule is imposed by the processing system at each voltage levels is associated with a binary value bits; N voltage levels ranging from peak-to-peak value. There is thus a uniform step which is equal to $V_{pp}/N$.

In the course of the first scan is posed the following problem: how to define the closest samples at each level and the evolution of the quantization noise? The possible answer to result an accurate and best resolution is to establish a second scan based on centered quantification in order to reduce the quantization error. Dividing the, yet established, intervals in two and choose the Ceiling function to find the samples nearest the first scan levels resulting from (N + 1) ranging from peak-to-peak voltage value levels. We represent the final portioning with its two sweeps in figure 8.

The phase of portioning arises the quantified values and each vector, containing the number of samples with the same value of quantification, corresponds a value of probability of occurrence.

The probability of occurrence relative to a 'given' level is the ratio of the number of samples close to this level and the total number of samples of the ECG signal. The next step is to apply the Huffman coding resulting binary 'optimal' train and will be passed through an ideal channel.

## 5.2. Reception

At the reception end-point, the inverse operations of those at the transmission phase are applied to reconstruct the original ECG signal. They are the Huffman decoding to render the bit stream of the quantified ECG signal, the inverse linear prediction filter and finally the inverse wavelet transform (IDWT). The obtained result of the reconstructed original ECG signal is represented in figure 9.

The ECG signal reconstruction error, illustrated in figure 10, is the difference between the original signal and the reconstructed version. This error is produced, mainly, because of the effect of thresholding and quantization error and the effect of filtering etc.

The numerical study of our algorithm is based on the calculation of the compression ratio (CR) and the mean square error (MSE), i.e. the number of bits that we were earning when transmitting the compressed ECG signal. As the MIT-BIH ARRYTHMIA database records have a resolution of 11 bits and the ECG signal was transmitted with a resolution of almost 1.5 bits (Avglen: average length of words: Avglen = 1.5083 bits), so we have a significant gain on the number of transmitted bits.
<figure><img src="image_14.png" /><figcaption>**Figure 8.** Double scanning of the ECG signal; 1st scanning in red and 2nd one in green.</figcaption></figure>

The number of bits to be transmitted is equal to 12403 bits, so the compression ratio is 1:7.2653. The mean square error MSE = 0.0741 and the percentage of the difference of the mean square error (Percentage of Root mean square Difference, PRD) is 19.35%. The PRD is most important, when receiving the ECG signal, the set of waves {P, T, Q and S} are well restored while the R waves are attenuated. However, this distortion of the ECG signal does not destroy the useful information carried by that signal as it does not reveal non-existent pathological cases.

<figure><img src="image_15.png" /><figcaption>**Figure 9.** The reconstructed (red line) in superposition with the original ECG signal (blue line).</figcaption></figure>
<figure><img src="image_16.png" /><figcaption>**Figure 10.** Reconstruction error (red line) in superposition with the original ECG signal (black line).</figcaption></figure>

# 6. Evaluation of algorithm

## 6.1. *Numerical evaluation*

Table 1 lists the rate of compression CR values, root mean square error RMS, average length of words (Avglen: Averagelength) corresponding to a set, chosen arbitrarily, of pathological case extracted from the MIT-BIH ARRHYTHMIA database records.

<table><caption>**Table 1.** Assessment of the ECG compression algorithm applied to the MIT-BIH ARRHYTHMIA records exhibited pathological cases.</caption><thead><tr><th>File name</th><th>Number of segment</th><th>CR</th><th>MSE</th><th>Avglen</th><th>Pathological Case</th></tr></thead><tbody><tr><td>100.dat</td><td>67</td><td>1:8.0342</td><td>0.0719</td><td>1.3640</td><td>Premature Ventricular Contraction</td></tr><tr><td>101.dat</td><td>5</td><td>1:7.1780</td><td>0.0795</td><td>1.5267</td><td>Huge base line wandering</td></tr><tr><td>228.dat</td><td>2</td><td>1:7.4117</td><td>0.0412</td><td>1.4785</td><td>Artefacts</td></tr><tr><td>233.dat</td><td>1</td><td>1:7.1055</td><td>0.0740</td><td>1.5423</td><td>Premature Ventricular/auricular Contraction</td></tr></tbody></table>

## 6.2. *Visual evaluation*

Despite the interest of the numerical evaluation of the ECG signal compression algorithm, the quantitative one based upon the visual perception is essential for clinical cases. Figure 11 shows the good performance of the application of the algorithm to the ECG signal with premature ventricular contractions.

# 7. Comparative study

The ECG signal compression algorithms are several. In order to promote our algorithm it is indispensable to compare it to works, already realized, and that the results are satisfactory. Among these algorithms for which the sampling rate is 360 Hz, 11-bit resolution and the MIT-BIH ARRHYTHMIA database records are used, we quote:

Djohan algorithm used the discrete wavelet transform [27]. It carried a value of PRD 3.9% with a compression ratio of 12.5% for the MIT-BIH ARRHYTHMIA database 117.dat record.
The algorithm developed by Robert S. H. Istepanian et al. is based on the wavelet transform and using two methods of encoding; the first named Optimal Zonal Wavelet Coding (OZWC) and the other one is called wavelet transform Higher Order Statistics based Coding (WHOSC) [43]. They carried out a compression ratio of 1:8.16 and 1:17.51 for OZWC and WHOSC, respectively, applied to the 100.dat of the MIT-BIH ARRHYTHMIA database record.

The algorithm based on the combination of wavelet transform and Set Partitioning in Hierarchical Tree (SPIHT) [45]; it provided a PRD value of 1.31% and a compression ratio of 45% applied to the 117.dat record of the MIT-BIH ARRHYTHMIA database. The set of the results are shown in table 2.

<figure><img src="image_17.png" /><figcaption>**Figure 11.** Application of the algorithm to the ECG signal with premature ventricular contractions.</figcaption></figure>

<table><caption>**Table 2.** Comparative study of the proposed algorithm.</caption><thead><tr><th>Algorithm</th><th></th><th>PRD (%)</th><th>CR (%)</th><th>F<sub>s</sub> (Hz)</th></tr></thead><tbody><tr><td>Djohan 117.dat</td><td></td><td>3.9</td><td>12.5%</td><td>360</td></tr><tr><td rowspan="2">Istepanian</td><td>OZWC 100.dat</td><td>NRMSE=0.5778%</td><td>8.16</td><td>360</td></tr><tr><td>WHOSC 100.dat</td><td>NRMSE 1.7399%</td><td>17.51</td><td>360</td></tr><tr><td>SPIHT117.dat</td><td></td><td>1.31</td><td>45%</td><td>360</td></tr><tr><td rowspan="2">Our algorithm</td><td>100.dat</td><td>19.35</td><td>13.76</td><td>360</td></tr><tr><td>117.dat</td><td>4.75</td><td>14.01</td><td>360</td></tr></tbody></table>
The comparative study, illustrated by the table above, shows, that even though our algorithm does not outperform the most of the compared algorithms, the obtained results are acceptable and encouraging. Examining the table of the comparative study shows, in other hands, as examples, that the proposed algorithm outperforms Djohan's and Istepanian based on OZWC algorithms in sense of compression ratio.

## 8. Conclusion

The ECG signal compression finds more importance with the development of telemedicine. Indeed, compression can significantly reduce the cost of the transmission of medical information through telecommunications channels. Higher-order statistics are tools which have played a very important role in the field of signal processing. We can envisage utilizing the HOS for denoising and compression. With the use of wavelet and probabilistic and statistical mathematical tools, the methodology is appropriate for the future integration of mobile applications of telemedicine in providing one of the mechanisms of compression improved for the coding of ECG.

The proposed ECG compression algorithm combining wavelet and higher-order statistics was discussed. This offered a good compression ratio and quality of the rendered ECG signal. Our proposed ECG compression algorithm has strengths and weaknesses. We believe that the strength of our proposed algorithm is the double scanning of the portioning used for Huffman encoding; this double scanning has considerably lessened the quantification error. However, the weakness of the algorithm is due to the overall LPC filtering. Adaptive LPC filtering based on optimal segmentation will, surely, improve the performance of the algorithm. But, on the other hand, this overall LPC filtering process lowers, considerably, the complexity of the algorithm and, consequently, gains time of processing.

## References

[1] Guedat C and Gindis D 2007 Services de télésanté' département télécommunications services et usages insa de lyon services de télésanté p 1-43

[2] Lavaill L 2011 THESIS, Télémédecine Définition, applications et enquête auprès des médecins généralistes de Franche-Comté UNIVERSITE DE FRANCHE-COMTE FRANCE

[3] Sörnmo L and Laguna P 2006 Electrocardiogram (ECG) signal processing. **2** 1298-1313

[4] Pandian P S 2007 Store and Forward Applications in Telemedicine for Wireless IP Based Networks **2**(6) 58-65

[5] Pattichis C S, Kyriacou E, Pattichis M S, Panayides A and Pitsillides A 2006 A review of m-Health e-Emergency Systems 1-8

[6] Alesanco A and Jose García 2007 A Simple Method for Guaranteeing ECG Quality in Real time Wavelet Lossy Coding Article ID 93195, 9 pages

[7] Cox J R, Nolle F M, Fozzard H A, and Oliver G C 1968, AZTEC, a preprocessing program for real-time ECG rhythm analysis **15** 128-129

[8] Ishijima M, Shin S B, Hostetter G H and Sklansky J 1983 Scan along polygon approximation for data compression of Electrocardiograms **30** 723-729

[9] Ahmed N, Milne P J and Harris S G, Nov. 1975 *Electrocardiographic data compression via orthogonal transforms* **22** 484-487

[10] Philips W and Jonghe G D 1992 Data Compression of ECG's by High-Degree polynomial approximation **39** 330-337

[11] Madhukar B and Murthy I S N 1993 ECG Data Compression by Modeling AMIA, Inc. 586-591.

[12] Graps A 1995 An introduction to wavelets. *IEEE Computational Sciences and Engineering.* **2**(2) 50-61.

[13] Crowe J A, Gibson N M, Woolfson M S and Somekh M G 1992 Wavelet transform as a potential tool for ECG analysis and compression. *J. Biomed. Eng.* **14** 268-72

[14] Jalaleddine S, Hutchens C, Strattan R and Coberly W 1990 ECG data compression techniques—a unified approach *IEEE Trans. Biomed. Eng.* **37** 329-343.
[15] Thakor N V, Sun Y C, Rix H and Caminal P 1993 Multiwave: a wavelet-based ECG data compression algorithm *IEICE Trans. Inf. Syst. E76D* 1462-9.

[16] Chen J, Itoh S and Hashimoto T 1993 ECG data compression by using wavelet transform *IEICE Trans. Inf. Syst. E76D* 1454-61

[17] Bradie B 1996 Wavelet packet-based compression of single lead ECG *IEEE Trans. Biomed. Eng.* **43** 493-501

[18] Miaou S G and Lin C L 2002 A quality-on-demand algorithm for wavelet-based compression of electrocardiogram signals *IEEE Trans. Biomed. Eng.* **49** 233-9

[19] Addison P S 2005 Wavelet transforms and the ECG: a review *INSTITUTE OF PHYSICS PUBLISHING* physiological measurement **26** 155-199

[20] Ku C T, Hung K C, Wu T C and Wang HS 2010 Wavelet-Based ECG Data Compression System With Linear Quality Control Scheme *IEEE engineering in medicine and biology society*

[21] Pattichis C S, Kyriacou E, Voskarides S, Pattichis M S, Istepanian R and Schizas C N 2002 Wireless Telemedicine Systems *IEEE Antennas & Propagation Magazine*, **44**(2) 143-153

[22] Laxminarayan S and Istepanian R 2000 Unwired e-Med: The next generation of wireless and Internet telemedicine systems [Editorial] *IEEE Transactions on Information Technology in Biomedicine* **4** 189-193

[23] Perez R 1998 Wireless Communications Design Handbook, Volume I: Space (Interference: Aspects of Noise, Interference, and Environmental Concerns), Spacecraft Design Jet Propulsion Laboratory, California Institute of Technology, Academic Press. San Diego, CA

[24] Varshney U 2006 Patient monitoring using infrastructure oriented wireless LAN. *Int. J. Electronic Healthcare* **2** 149-163

[25] Brims W 2002 WIRELESS ECG Bachelor of Engineering In the Division of Electrical Engineering University of Queensland 1-84

[26] Tompkins W J 1993 *Biomedical Digital Signal Processing*. Englewood Cliffs, New Jersey, Prentice-Hall.

[27] Djohan A, Nguyen T Q and Tompkins W J 1997 ECG compression using discrete symmetric wavelets transform *IEEE-EMBC and CMBEC*, 167-168

[28] Bottou L and Pigeon S 1998 Lossy Compression of Partially Masked Still Images 1-10

[29] Bourdreaux-Bartels G 1996 *Chapter 12 Classified Time-Frequency Representations* The transforms and applications handbook, IEEE Press.

[30] Qian S and Chen D 1999 Understanding the nature of signals whose power spectra change with time: Joint Analysis. *IEEE Signal Processing Magazine*. 52-67.

[31] Cohen A and Kovačevič A 1996 Wavelets: The mathematical background. *Proceeding of the IEEE*. **4** 514-522.0

[32] Mallat S 1999 *A Wavelet Tour of Signal Processing*. Academic Press, 2nd edition.

[33] Truchetet F 1998 *Ondelettes pour le signal numérique*, Edition HERMES, Paris.

[34] Sheng Y 1996 Chapter 10. Wavelet Transform Handbook CRC Press Inc. 748-827.

[35] Donoho D 1995 De-noising by soft-thresholding *IEEE Trans. Inform.Theory* **41**(3): 612-627

[36] Sardy S, Tseng P and Brune P 2001 Robust Wavelet Denoising IEEE Transactions on Signal Processing **49**(6) 1146-1152

[37] McLaughlin S, Stogioglou A and Fackrell J 1995 Statistiques Présentation ordre supérieur (HOS) pour la détection des non-linéarités.

[38] Lacoume J L, Amblard O and Comon P 1999 Statistiques d'ordres supérieurs pour le Traitement du Signal.

[39] Ravier P 1992 Détection de transitoires par ondelettes adaptées -Critères d'adaptation fondés sur les statistiques d'ordre supérieur-, Thèse, INSTITUT NATIONAL POLYTECHNIQUE DE GRENOBLE FRANCE

[40] Wickramasinghe N and Geisler E 2008 ‘Encyclopedia of Healthcare Information Systems’ Volume I A-D Medical Information science reference 2008, p 157-166 Pedro de A. Berger, Francisco A de O Nascimento, Leonardo R A X de Menezes, Adson F da Rocha, Joao L A
Carvalho ‘Biomedical Signal Compression B’

[41] Moreau N 1995 Techniques de compression des signaux. ENST-Masson

[42] Ramakrishnam A G and Saha S 1997 ECG coding by wavelet-based linear prediction. *IEEE Trans. Biomed. Eng.* **44**(12) 1253–1261

[43] Istepanian R S, Leontios J Hadjileontiadis and Stavros M Panas 2001 ECG Data Compression Using Wavelets and Higher Order Statistics Methods, *IEEE TRANSACTIONS ON INFORMATION TECHNOLOGY IN BIOMEDICINE*, **5**(2) 108-115

[44] Bellanger M 1990 Traitement numérique du signal. MASSON 4th edition

[45] Ktata S, Ouni K, and Ellouze N 2009 A Novel Compression Algorithm for Electrocardiogram Signals based on Wavelet Transform and SPIHT World Academy of Science, Engineering and Technology **35** 855-860