ECG signal compression using ASCII character encoding and transmission via SMS

ECG signal compression using ASCII character encoding and transmission via SMS

Biomedical Signal Processing and Control 8 (2013) 354–363 Contents lists available at SciVerse ScienceDirect Biomedical Signal Processing and Contro...

2MB Sizes 0 Downloads 28 Views

Biomedical Signal Processing and Control 8 (2013) 354–363

Contents lists available at SciVerse ScienceDirect

Biomedical Signal Processing and Control journal homepage: www.elsevier.com/locate/bspc

Technical note

ECG signal compression using ASCII character encoding and transmission via SMS S.K. Mukhopadhyay a,1 , S. Mitra b , M. Mitra a,∗ a b

Department of Applied Physics, Faculty of Technology, University of Calcutta, 92 A.P.C. Road, Kolkata 700 009, India Department of Electronics, Netaji Nagar Day College (Affiliated to University of Calcutta), 170/436, N.S.C. Bose Road, Regent Estate, Kolkata 700 092, India

a r t i c l e

i n f o

Article history: Received 10 October 2012 Received in revised form 18 February 2013 Accepted 26 February 2013 Available online 2 April 2013 Keywords: Differentiation Sign byte Grouping Critical numbers SMS generation

a b s t r a c t Software based efficient and reliable ECG data compression and transmission scheme is proposed here. The algorithm has been applied to various ECG data of all the 12 leads taken from PTB diagnostic ECG database (PTB-DB). First of all, R-peaks are detected by differentiation and squaring technique and QRS regions are located. To achieve a strict lossless compression in the QRS regions and a tolerable lossy compression in rest of the signal, two different compression algorithms have used. The whole compression scheme is such that the compressed file contains only ASCII characters. These characters are transmitted using internet based Short Message Service (SMS) and at the receiving end, original ECG signal is brought back using just the reverse logic of compression. It is observed that the proposed algorithm can reduce the file size significantly (compression ratio: 22.47) preserving ECG signal morphology. © 2013 Elsevier Ltd. All rights reserved.

1. Introduction The electrocardiogram (ECG) is a representative signal containing information about the condition of the heart. The shape and size of the P-QRS-T wave and the time intervals between various peaks contain useful information about the nature of possible disease afflicting a heart [1]. P, Q, R, S and T letters were chosen in the early days of ECG history and were chosen arbitrarily [2]. A normal ECG trace is shown in Fig. 1. However, by the very nature of bio-signals, reflection of abnormalities would be random in the timescale. Hence the study of ECG pattern and heart rate variability have to be carried out for extended periods of time (i.e., for 24 h) as done in holter monitoring system. Naturally the volume of the data handled would be enormous. Therefore we must need a way to reduce the data storage place. ECG signal compression techniques can be broadly classified into three major categories: (i) direct compression, (ii) transformation methods and (iii) parameter extraction techniques. Direct data compression techniques [3–7] generally retain samples that contain important information and discard the rest. Transformation based compression techniques generally detect the redundancies

∗ Corresponding author. Tel.: +91 033 2350 8386x461; fax: +91 33 2351 9755. E-mail addresses: [email protected] (S.K. Mukhopadhyay), [email protected] (S. Mitra), [email protected], [email protected] (M. Mitra). 1 Tel.: +91 033 2350 8386x461; fax: +91 33 2351 9755. 1746-8094/$ – see front matter © 2013 Elsevier Ltd. All rights reserved. http://dx.doi.org/10.1016/j.bspc.2013.02.007

utilizing the spectral and energy distribution analysis. Among transformation schemes, wavelet transformation [8–13], orthogonal transform [14], discrete cosine transform [15], fast Fourier transform [16] and discrete Legendre transform [17] have been used for compressing the ECG signal. On the other hand parameter extraction methods [18] for compression are mainly based on linear prediction and long-term prediction methods. Beside these, time division multiplexing based method [19], Max–Lloyd quantizer [20], spline approximation [21] and pattern matching methods [22] have also been used in ECG compression. In addition to the previous categorization, ECG signal compression schemes can also be classified into lossy and lossless methods. From juridical and clinical point of view [23,24], lossless compression is very much important. Our intension is to get maximum reduction of ECG data volume without jeopardizing clinical morphology features upon reconstruction. One of the rising issues in rural health care system in India is to broaden the service among the poor population distributed at vast geographical area with poor connectivity in terms of infrastructure. ECG is considered as one of the principal physiological signals to detect the cardiac abnormalities of human being. In [46,47], ECG signal compression techniques were proposed in lossless and lossy manner respectively. These two methods are combined in such a way that the combined method gives better result. The same lossless and lossy compression techniques were also combined in [60] but in a completely different way where standard deviations of different sections of the ECG signal were taken into account. Chief motivation behind this work is to develop

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

355

the lossy compression is not so lossy that those portions would not be identified after reconstruction. Both the lossless and lossy compression methods are such that they outputs only ASCII characters. After compression it is needed to transmit the data to some distant health care center or to some expert cardiologist for immediate action. In recent years, huge numbers of mobile telemedicine system design techniques were proposed in the literature [25–39]. In [34], a telemedicine system was proposed where full channel model with multiple faders, co-channel or adjacent channel interference, and noise profiles were considered as the main modeling parameters of GSM (Global System for Mobile Communication) channel. GSM link was also used in [40] to develop a portable emergency telemedicine device. Use of Wireless Mesh Networks (WMN) [41] and Code Division Multiple Access (CDMA) network [28] was also proposed in telemedicine system. SMS was also used in [42–44] to transmit compressed ECG signal for remote health care system. In [42], the ECG data is encoded using Coding Function, transformed to ASCII codes, and then it is sent using a SMS emulator and mobile phone at the transmitter end. Here the compressed file contains only ASCII characters. Therefore SMS system is used to transmit the compressed data. In the reconstruction part of the algorithm, all messages are taken together and then using just the reverse programming logic of compression, original ECG signal is reconstructed. Fig. 1. A normal ECG trace.

2. Methodology a low cost remote tele-cardiology system for compression and transmission of ECG signal which will give support to the rural health care system. In the present work, at first, R peaks are detected using differentiation and squaring technique. ECG data of 160 ms (maximum QRS duration) about the R peak are compressed without loss and rest of the signal is compressed with negligible loss of clinical information. The shape and size of QRS complex and its duration have a great significance in disease diagnosis. For example, left bundle branch block (LBBB), right bundle branch block (RBBB), degree of atrio-ventricular block and so many symptoms can be identified from the QRS complex. Other parts of the ECG wave i.e. P and T wave regions are also very important for ECG interpretation but

Proposed algorithm is divided into following three main sections: (1) data compression, (2) transmission and reception and (3) data reconstruction. Data compression part is further divided into three sub-parts: (1) R peak detection, (2) Lossless compression in QRS regions (L2CQR) and (3) Lossy compression in non-QRS regions (LCNQR). The data reconstruction algorithm is also divided into two sub-parts: (1) Lossless reconstruction in QRS regions (L2RQR) and (2) Lossy reconstruction in non QRS regions (LRNQR). All these compression, transmission-reception and reconstruction algorithms are explained sequentially in the rest of the sections. Block schematic of the proposed algorithm is shown in Fig. 2.

Fig. 2. Block schematic of the proposed algorithm.

356

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

Fig. 3. Detected R-peaks of file S0305, lead I, Normal (first 5000 samples).

2.1. Data compression protocol Data compression protocol is divided into three sections: (1) R peak detection, (2) L2CQR and (3) LCNQR. Each part is described in the following sections. 2.1.1. R-peak detection algorithm ECG samples are generally affected by various sources of high frequency noises including power-line interference and electrosurgical noise at the time of signal acquisition. To remove such high frequency noises, standard filtering software is used prior to any other process. At first a low pass filter is used to remove all noises above 100 Hz [48] and then a 60 Hz notch filter is used to remove power line interference. The R peak detection algorithm is developed on the basis of conventional differentiation technique. Every ECG sample is subtracted from its preceding. It is basically a high pass filtering. In flat or low frequency regions (P wave, T wave, ST segment, etc.), difference of sample voltages will be close enough to zero whereas higher differences will result in QRS regions because these regions always have the maximum slope. Now these differentiated voltage values are squared to enhance the high frequency regions. Those particular samples are noted where the square of the difference becomes maximum within a window size 0.25 s i.e. it is assumed that the heart rate will not exceed 240. Now, returned back to the original ECG signal, maximum amplitude is searched within 160 ms (maximum QRS duration [45]) about the maximum squared position which gives a true R peak. Detected R peaks of particular ECG data file are shown in Fig. 3. Once R-peaks are properly detected, QRS regions can be easily detected by taking 160 samples around the R-peak (consecutive 80 samples before and after the R-peak). As the maximum QRS duration is 160 ms [45], Q and S points must reside inside this time span. Therefore instead of detecting Q and S points separately all 160 samples around each R peak are taken. Various methods have been developed to detect ECG peaks [66,67]. Combination of differentiation and squaring technique is a common practice in R-peak detection algorithm. In [68,69], a band-pass filter was used prior to the differentiation and squaring operation to reduce various high and low frequency noises and to enhance the R peak detection accuracy. Similar approach was also used in [70] to detect R peaks. 2.1.2. Programming logic of L2CQR The algorithm proposed by us in [46] is used to compress the ECG data of QRS regions in lossless manner. From the input ECG data file only the ‘Voltage’ values of QRS region are taken. For getting smaller numbers and hence better compression a difference

array is constructed which contains the difference of every voltage and its preceding. The sign of every element of this array is checked. For every positive number a binary zero (0) and for every negative number a binary (1) is taken as sign bit for that corresponding ‘Voltage’ value. Decimal equivalent of this binary string will be used as the sign byte of these corresponding eight ‘Voltage’ values. But the problem occurs, if the corresponding ASCII of any sign byte becomes some special characters like 10 (line feed), 13 (carriage return), 26 (substitution) or 255 (blank). At the time of data reconstruction these values (13, 26 and 255) will be considered as ‘End of File (EOF)’ by the compiler and the program will get terminated. Therefore those numbers are replaced with some other suitable numbers provided an extra bit say (‘rs’) is sent along with this sign byte. Now each number in the array is multiplied by 1000 because in standard ECG database and also in PTB-DB, voltages are recorded up-to three decimal points. Those amplified integers are normalized maintaining some logical criteria and normalization constant is placed in a variable (say ‘ii’). Finally ‘rs’ and ‘ii’ are printed in character form. Three variables have been taken (say q, r and s) to denote the position of those critical numbers (255, 10, 13, and 26) in the amplified integer values. Amplified integers are grouped maintaining some essential logical criteria. Three types of grouping are considered here namely (1) forward grouping, (2) reverse grouping, (3) no grouping. Three variables have been taken (k, z and u) to denote the positions of these groupings. Each set of grouped or not-grouped ‘Voltage’ values along with other necessary information (sign byte, k, z, u, etc.) will be printed in the output file in character form maintaining the following format. Sign-Bit

Grouped/Ungrouped Integers

k

z

u

r

s

q

rs + ii

Every character set is separated from each other by an ‘ENTER’ character. The above-described L2CQR algorithm will be executed repeatedly until all the ECG samples of QRS region are become compressed. 2.1.3. Programming logic of LCNQR To achieve a tolerable lossy compression in non-QRS regions, the algorithm proposed by us in [47] is implemented in a slight different way. At a glance 16 ECG samples are taken from the non-QRS section. It is well known that the standard clinical bandwidth for the 12-lead clinical ECG is 0.05–100 Hz [48] whereas in PTB-DB the sampling frequency used is 1 kHz and this is more than enough. Therefore, before compressing these samples, sampling frequency of these regions is reduced to one half (500 Hz). This will not violate the Nyquist principle. Hence, out of those 16 samples only 8 alternative samples (1st, 3rd, 5th, etc.) are taken for later processing and saved in an array. Sign-byte generation process for those 8 voltage values is same as described in Section 2.1.2. In the next step, maximum number is found out from that array. Using this maximum number a common amplification factor for those eight “voltage” values is generated in such a way that after multiplication, integer part of each of these “voltage” values will be either less than or equals to nine (9). The algorithm is given Appendix. Now these eight amplified ‘Voltage’ values are grouped into just four. If any grouped integer becomes 10 or 13 or 26, they will be changed to 11, 14 and 27 respectively to avoid the previously described problem. Every set of four grouped integers and other associated information like ‘sign-byte’, ‘rs’ and ‘Amplification factor’ will be printed in their corresponding ASCII characters maintaining the following format. Every character set is separated from other by an ‘ENTER’ character. Sign-bit

Four Grouped Integers

rs

Amplification factor

The above-described LCNQR algorithm will be executed iteratively until all the ECG samples of non-QRS region are become compressed.

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

2.2. Data transmission and reception protocol The compressed data file contains only ASCII characters. Therefore internet based SMS service is used to transmit the compressed data. There are several numbers of free SMS sending websites through which almost 140 characters per SMS can be transmitted

357

For the numbers ranging from 32 to 127 a different technique is used. For these numbers, HEADER is set to 33 and INFO is kept same as the original number. Although 92, 96 and 127 falls in this range but these three characters cannot be transmitted through SMS. Therefore these three are treated in a different way. For these numbers HEADER is set to 34 and INFO is se to ‘number-1’. This is nothing but to overcome the problem.

For the numbers ranging from 128 to 223, HEADER is set to 35 and INFO is set to (number −100 + 4). Here also the same problem arises for the numbers 188, 192 and 223 and solved in the same way described before.

very quickly to any mobile phone inside a country. One of such websites is used to send SMS. SMS system can transmit only 7-bit ASCII characters (0–127) but the compressed file contains all 8-bit ASCII characters (0–255). Therefore every character in the compressed file is converted to two suitable 7-bit ASCII characters. Although SMS support 7-bit ASCII characters but not all. There are some specific 7-bit characters which cannot be transmitted through SMS. For example, all characters between 0 and 31, 92, 96 and 127 cannot be transmitted through SMS. ASCII characters ranging from 0 to 31 are reserved for some special operation [49]. ASCII characters for 92 (\), 96 () and 127 ( ) can be transmitted through SMS but in the received SMS file there will be some other characters other than these. Therefore these characters should be treated in a different way. The rule followed here to convert 8-bit to 7-bit ASCII character is very simple and is described as below. Two variables are taken and named ‘HEADER’ and ‘INFO’ to hold two 7-bit ASCII characters. For any 8-bit ASCII less than or equals to 31, HEADER is set to 32 and INFO is set to ‘32+ that 8-bit ASCII’. Therefore, both HEADER and INFO will be always greater than 31 and hence can be transmitted through SMS.

For the last set of characters (224–255) HEADER is set to 37 and INFO is set to ‘number −200 + 9 .

The thing is to be noted that both HEADER and INFO must reside under valid 7-bit ASCII characters for transmission through SMS and the combination of these two must be unique for every 8-bit ASCII character. At last both HEADER and INFO are printed in the output file. An algorithm is developed which divides the compressed data file into a number of small data files each containing 140 7-bit ASCII characters. Out of those 140 characters, the first character is reserved for patient ID, second and third characters are reserved for message numbers and rest 137 characters are used for transmitting the compressed ECG data. Now those small data files are transmitted via free SMS sending website. Excluding those ‘not used’ characters, at a time 92 patients’ compressed ECG file can be transmitted to a particular mobile phone and each patient ID can have 8464 (92 × 92) SMS (if needed). As the patient ID and SMS number is embedded inside the message body, multiple patients’ messages can be transmitted simultaneously to a particular mobile phone and if any SMS is transferred before it’s previous due to some network problem or something else, there will be no effect at the time of data reconstruction. At the receiver end all those received messages are to be transferred from the mobile phone to the computer or laptop via USB

358

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

cable, Bluetooth technology or by any means. There is also a reverse algorithm at the receiver end which concatenates all the SMS according to their SMS number of a particular patient ID, converts 7-bit ASCII characters to 8-bit ASCII characters and makes separate file for different patient ID. 7-bit to 8-bit ASCII conversion is done using just the reverse algorithm. The algorithm is given in Appendix. The SMS generation and concatenation algorithm is implemented on MATLAB 7.1 platform. Fig. 4 shows a sample SMS after transferring to the receiver’s computer. From Fig. 4, it is seen that the patient ID is ‘$’ whose decimal equivalent is 36. The next two characters are ‘!’ whose decimal equivalent is 33. Starting from 32 (space), 36 ($) is the 5th number and hence it is the 5th patient’s SMS. Following two characters i.e. the 2nd and 3rd character also start from 32 (space). 2nd character position will be incremented by one if the 3rd position exceeds all valid 92 characters. 3rd character is then again reset to 32. Following this rule, 2nd position became 33 (!) after one increment and

3rd position became 33 (!) after 94th increment. Therefore this is the 94th SMS of the 5th patient. A ‘Samsung Wave 525’ mobile is used at the receiver end to receive SMS. 2.3. Data reconstruction protocol After transmission and reception it is necessary to bring back the original ECG signal for making decision about the condition of the patient’s heart. The whole data reconstruction algorithm is divided into two sections: (i) Lossless data reconstruction in QRS region (L2RQR) and (ii) Lossy data reconstruction in non-QRS region (LRNQR). From the compressed data file at a time one set of ASCII character is taken. For lossless compression, there will be at least 12 characters and for lossy compression, there will be only 7 characters in a set. 2.3.1. Lossless data reconstruction in QRS region (L2RQR) L2RQR algorithm is developed using just the reverse logic of the L2CQR as described in Section 2.1.2. This module takes one set of ASCII characters of the compressed ECG data file and equivalent ASCII values are saved in an array and then the decompression algorithm is applied on those ASCII values. Depending on the value stored in ‘rs’, ‘Sign-byte’ is modified. From rest of the ASCII values original eight ‘Voltage’ values are generated. The variables ‘k’, ‘z’, and ‘u’ denote the positions of forward, reverse, no grouping, respectively. Ungrouping is done using just the reverse logic of grouping. Now ‘r’, ‘s’ and ‘q’ variables are taken into account. These variables indicate the position of the critical numbers (10, 13, 26 and 255) in the ungrouped data. So, original values are brought back. Using the variable ‘ii’, ungrouped integers are properly modified. In the next step, the sign-byte will be converted into its corresponding 8-bit binary equivalent. In the binary string if any bit is ‘1’ then the corresponding ungrouped integer will be multiplied by (−1). Now, every number is divided by 1000. To get the original, each number is added with the previous value. The new values are stored in another array. This array is identical to the original ECG voltage values. A variable ‘x’ (say) is declared and is

initialized with zero. For PTB-DB ECG database, the sampling interval is 0.001 second. Hence, in each iteration ‘x’ will be incremented by the sampling interval and will be printed with the reconstructed ECG samples. 2.3.2. Lossy data reconstruction in non-QRS region (LRNQR) LRNQR algorithm is developed using just the reverse logic of LCNQR. From the compressed data file at a time one set of character is taken. Equivalent ASCII values of those 7 characters will be saved in an array. Grouped integers are ungrouped using the reverse logic of grouping as described in Section 2.1.3. Now, every ungrouped number is divided by the ‘Amplification factor’ and saved in an array (say d [] array). The sign byte regeneration process is same as described in Section 2.3.1. In Section 2.1.3, the sampling frequency was reduced to one half. Now it is the time to generate 16 ‘voltage’ values from these 8 to keep track the sampling frequency of the reconstructed ECG signal with its original. To do this, average of every two neighbor numbers is introduced in between. The operation is depicted below.

Again, ‘x’ will be incremented by the sampling interval and will be printed with these reconstructed ECG samples. 3. Result The algorithm is tested on all the 12 ECG leads of a large number of ECG data file and the result is shown below in tabular form. In biomedical data compression, we usually determine the clinical acceptability of the reconstructed signal through visual inspection. We may also measure the difference between the original and the reconstructed signal mathematically. Such a numerical measure is the percent root-mean-square difference, PRD, given by

 PRD% =

n (y − y¯ i )2 i=1 i n y2 i=1 i



× 100

where yi and y¯ i represents the original and reconstructed ECG sample respectively. The normalized version of PRD is PRDN, which does not depend on the signal mean value Smean , defined as

  n (yi − y¯ i )2 PRDN% = n i=1 i=1

(yi − smean )2

× 100

The compression ratio (CR), which is defined as below, is also calculated. The higher the value of CR, the better the performance of the compression algorithm. CR =

Original ECG Data File Size Compressed File Size

One another numerical measure Quality Score (QS) was proposed in [50] to quantify the overall performance of compression algorithm. A high score represents a good compression performance. QS =

CR PRD

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

359

Fig. 4. Received SMS.

A statistical measure of the spreading of data points in a data series about the mean is called ‘Coefficient of Variation (CV )’. It is calculated as below: CV =

Standard Deviation Mean

It is a powerful statistic for comparing the degree of deviation from one data series to another, even if the means are drastically different from each other. The lower the value of CV , the better the performance of the algorithm. Average CR, PRD, PRDN and QS obtained for Myocardial Infarction, Normal and Bundle Branch Block patients are given in Table 1. CV of each of these individual parameters is also calculated. From the above tables, we can see that using the proposed algorithm we can get average PRD of about 7.58%, CR of about 22.47, PRDN of about 13.28% and QS of about 2.97. CV of CR, PRD, PRDN and QS are found over 0.02, 0.05, 1.08 and 0.05 respectively. Figs. 5 and 6

show the original (blue – A), reconstructed (black – B) and difference between original and reconstructed (magenta – C) ECG signals processed by this algorithm. Only the reconstructed ECG signal will be produced at the doctors’ end. Differences between original and reconstructed signals are publicized here only to give an idea about the performance of the proposed algorithm. From Table 1 we can see that the span of the CR (maximum CR − minimum CR = 23.45–21.95 = 1.5) is very low. This indicates that the compression module is capable enough to handle any type of ECG signal regardless of their morphology. One ECG cycle consist of a P wave followed by a QRS complex and a T wave. It is observed that on average 10 SMS are required to transmit two complete ECG cycles. Both the compression and reconstruction algorithms require less than 1.7 s for processing 29,345 samples of one signal and the message generation and reconstruction algorithm requires less than 0.35 s and 0.42 s respectively to process 10 messages which makes suitable to

Table 1 Average CR, PRD, PRDN and QS obtained for different types of ECGs. File

Lead

Samples/lead

CR

S0274 (N) S0275 (N) S0299 (N) S0301 (N) S0304 (N) S0305 (N) S0004RE (MI) S0010RE (MI) S0019RE (MI) S0029LRE (MI) S0038LRE (MI) S0060LRE (MI) S0075LRE (MI) S0083LRE (MI) S0148LRE (MI) S0421RE (BBB) S0422RE (BBB) S0424RE (BBB) S0425RE (BBB) S0427RE (BBB) S0429RE (BBB) S0430RE (BBB) S0431RE (BBB) Average

All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads All 12 leads

29,345 1112 18,526 22,085 26,343 23,771 15,000 10,000 15,000 15,000 15,000 15,000 15,000 15,000 15,000 60,000 60,000 60,000 60,000 60,000 60,000 60,000 60,000

22.60 21.95 22.13 22.06 23.45 23.15 22.14 22.12 22.23 22.16 22.23 22.33 22.38 22.11 22.07 22.41 23.18 22.50 22.33 22.19 23.32 22.54 23.12 22.47

N → Normal; MI → Myocardial Infarction; BBB → Bundle Branch Block.

CV

PRD (%)

0.02

7.46 8.74 7.01 7.50 7.46 8.03 8.08 7.56 7.16 7.14 6.85 7.26 7.39 7.74 7.75 7.94 7.71 7.73 7.34 7.26 8.21 7.48 7.62 7.58

CV

0.05

PRDN (%) 8.65 54.69 8.45 10.06 30.60 16.58 9.28 10.33 11.53 47.71 10.64 13.40 31.41 19.08 8.14 2.05 1.70 2.14 1.74 1.99 1.78 2.46 1.04 13.28

CV

QS

CV

1.08

3.03 2.51 3.16 2.94 3.15 2.88 2.74 2.93 3.10 3.10 3.25 3.08 3.03 2.86 2.85 2.82 3.01 2.91 3.04 3.06 2.84 3.01 3.03 2.97

0.05

360

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

Fig. 5. Original ECG signal (blue – A), reconstructed ECG signal (black – B) and difference between A and B (magenta – C) of file S0038lre, lead I, Myocardial Infarction (first 2000 samples).

compress, transmit and reconstruct real time ECG signals. Compression and reconstruction was done by “TURBO C++ IDE Version 3.0” and message generation and reconstruction was done by MATLAB 7.1 with a computer having RAM 2 GB DDR1, Pentium 4 CPU 2.66 GHz and Windows XP operating system. As we get ASCII characters as output, some standard ASCII compression algorithm can further compress the data. Original and reconstructed ECG signals are checked by renowned doctors and they have given their valuable comments. According to their visual inspection there is no difference between the original and reconstructed ECG signal. Doctor’s opinion about the original and reconstructed ECG signal of a particular ECG data file is given in Appendix. To evaluate the performance of the proposed algorithm, PTB diagnosis ECG database (http://physionet.org/cgi-bin/atm/ATM) is used. This library contains a collection of all 12 lead simultaneous ECG recordings and the database contains a high percentage of pathological ECG.

4. Performance comparison Comparison of CR, PRD, PRDN and QS of various lossy, lossless and near lossless methods with the proposed method is given in Table 2. It is observed that the proposed method achieves batter CR as compared to other methods reported in Table 2. It is interesting to note that in the original ECG signal, if there is any shift of base line, the denominator part in the expression of PRD becomes high and shows a low PRD. Due to this low PRD, QS value often gets raised. Actual error is represented by PRDN, which does not depend on the signal mean value. Average PRDN of the proposed method is comparable with [50]. PRDN of other methods listed in Table 2 is not available in literature hence not included. CR of the proposed method is comparable with the methods [47,50,59,60] as listed in Table 2.

Fig. 6. Original ECG signal (blue – A), reconstructed ECG signal (black – B) and difference between A and B (magenta – C) of file S0424re, lead V6 Bundle Branch Block (first 2000 samples).

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

361

Table 2 Performance comparison between other methods and the proposed method. Algorithm

CR

PRD (%)

PRDN (%)

QS

m-AZTEC [56] Hilton [12] Djohan et al. [57] SPIHT [54] Shrouf et al. [52] Perceptual masks [51] Fira and Goras [50] USZZQ and Huffman coding of DSM [53] Linear prediction, interpolation, and entropy coding [7] Fourier descriptors [58] Multirate signal processing [55] Wang and Meng [59] Mukhopadhyay et al. [46] Mukhopadhyay et al. [47] Mukhopadhyay et al. [60] Lorentzian functions model [61] Proposed

5.6 8 8 8 11.6 3.5 12.74 11.06 7.8 7.4 9.41 12 7.18 15.72 23.62 11.62 22.47

25.5 2.6 3.9 1.8 5.3 1.24 0.61 2.73 3.5 7.0 5.94 1.6 ± 0.98 0.023 7.89 7.43 0.67–9.51 7.58

– – – – – – 48.38 (max.) − 7.42 (min.) – – – – – – 20.60 – – 13.28

0.22 3.08 2.05 6.78 2.19 2.82 20.89 4.05 2.23 1.06 1.58 5.0 312.17 1.99 3.18 17.3–1.2 2.97

5. Conclusion and discussion The lossless compression technique [46] which is used to compress the QRS regions gives PRD of about 0.023%. Therefore almost no difference can be expected in QRS regions between original and reconstructed signal. On the other hand, according to the doctor’s opinion the lossy compression technique [47] which is used here in a different way to compress the non-QRS regions is not so lossy (PRD = 7.89%) that those regions could not be interpreted after reconstruction. The method performs well with both normal and abnormal (Myocardial Infarction and Bundle Branch Block as shown in Figs. 5 and 6) ECG data and morphological features are well preserved in the reconstructed signal. According to the visual inspection of two renowned cardiologists, there is no difference between the original and the reconstructed ECG signal. Compressed file can be preserved for later diagnosis purpose or it can also be transmitted to doctors’ mobile phone to consult about the condition of the patient’s heart in case of emergency. Information about the patient’s age, sex, blood pressure, photoplethysmogram (PPG), medical history, etc. which are also important during diagnosis, can also be transmitted through an extra SMS. This will be included in our future research. Things to be done at the doctors’ end are to transfer all those SMS to the computer or laptop via USB cable, Bluetooth technology or by any means and to run the reconstruction algorithm to check the ECG signal visually. If any cardiac abnormality is found, doctor can easily send back his/her concern over phone or also by an SMS. It is obvious that at emergency or poor cardiac condition such as heart attack (Myocardial Infarction), one will try to reach hospital instead of sending SMS to a physician. But, preliminary level of abnormalities can be detected and cured if the module is used at an earlier stage. The algorithm was applied on ECG data of Myocardial Infraction only to test the performance of the algorithm. As free SMS sending website is used to transmit the compressed data, the module is very much cost effective. Any one who has only the preliminary knowledge about computer and internet can use the module at the transmitter end. Instead of free SMS sending website, one can also use some GSM transmitter module at patient site but the overall expense of such setup and also the SMS charges are to be considered. Whereas, now a days, internet connection is available at an affordable rate. Once internet connection is present, virtually an infinite number of SMS can be transmitted. Multi patient simultaneous ECG transmission to a particular mobile phone is an added advantage of this proposed scheme over other methods [42,43]. Moreover the number of SMS to be sent for a fixed number of ECG cycle strongly depends on the compression ratio and also on the

sampling frequency of the original signal. These parameters are not available in [42,43]. Research on ECG feature extraction [62–64] and classification [65] is being carried out. It is also the need to bring all these ECG processing modules in a common programming platform and this will be reflected in our future research to come. This combined module of ECG signal compression, transmission, reconstruction, feature extraction and classification could be a better choice in telemedicine application. Moreover the system could be a solution to the poor infrastructure in rural health management in India. In certain season, the connectivity in remote villages particularly in hilly regions becomes very poor. Therefore the vast rural population in India can be benefited from using this system. Simplicity of the algorithm makes one greedy to use in portable and mobile ECG data monitoring system. The algorithm was tested by three types (Normal, Bundle Branch Block and Myocardial infarction) of 12 different leads i.e., of 36 types of ECG waves taken from PTB diagnosis ECG database in order to evaluate the performance of the proposed algorithm. Among those, few results are tabulated and some figures are given for visual inspection purpose.

Acknowledgements The authors acknowledge their deepest gratitude to Dr. Suranjan Bhattacharya and Dr. R.C. Saha, cardiologist, Kolkata, India, for their valuable clinical advice. The authors are thankful to TEQIPPhase II, University College of Technology, University of Calcutta for providing financial assistance.

Appendix. 1.

Grouping criterion Amplification factor = 9/largest number So that, every number in the array X Amplification factor ≤ 9

2.

A variable ‘Y’ (say) is taken to hold 8-bit ASCII characters. The conversion algorithm is given below. if HEADER = = 32 Y = INFO − 32. if HEADER = = 33 Y = INFO. if HEADER = = 34 Y = INFO + 1 if HEADER = = 35

362

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363 Y = INFO + 100 − 4 if HEADER = = 36 Y = INFO + 100 + 1 if HEADER = = 37 Y = INFO + 200 – 9 At last ‘Y’ will be printed in the output file.

3.

Doctor’s opinion about the original and reconstructed ECG signal.

References [1] A.L. Goldberger, Clinical Electrocardiography: A Simplified Approach, Mosby Inc., St Louis, 2006, July. [2] J.R. Hampton, The ECG Made Easy, sixth ed., Churchill Livingstone, Edinburgh, 2003. [3] J.R. Cox, F.M. Nolle, H.A. Fozzard, G.C. Oliver, AZTEC, a preprocessing program for real time rhythm analysis, IEEE Transactions on Biomedical Engineering BME-15 (1968) 128–129. [4] W.C. Mueller, Arrhythmia detection software for an ambulatory ECG monitor, Biomedical Sciences Instrumentation 14 (1978) 81–85. [5] L.W. Gardenhire, Redundancy reduction the key to adaptive telemetry, in: Proc. of 1964 Nat. Telemetry Conf., 1964, pp. 1–16. [6] J.P. Abenstein, W.J. Tompkins, A new data reduction algorithm for real time ECG analysis, IEEE Transactions on Biomedical Engineering 29 (April) (1982) 43–48. [7] U.E. Ruttimann, H.V. Pipberger, Compression of the ECG by prediction or interpolation and entropy coding, IEEE Transactions on Biomedical Engineering 26 (November) (1979) 613–623. [8] C.T. Ku, H.S. Wang, K.C. Hung, Y.S. Hung, A novel ECG data compression method based on non-recursive discrete periodized wavelet transform, IEEE Transactions on Biomedical Engineering 53 (12) (2006) 2577–2583. [9] N. Thakor, Y. Sun, H. Rix, P. Caminal, Multiwave: a wavelet based ECG data compression algorithm, IEICE Transactions on Information and Systems (Japan) E76-D (1993) 1462–1469. [10] B. Bradie, Wavelet packet-based compression of single lead ECG, IEEE Transactions on Biomedical Engineering 43 (1996) 493–501. [11] S.G. Miaou, H.L. Yen, C.L. Lin, Wavelet-based ECG compression using dynamic vector quantization with tree codevectors in single codebook, IEEE Transactions on Biomedical Engineering 49 (7) (2002) 671–680. [12] M.L. Hilton, Wavelet and wavelet packet compression of electrocardiograms, IEEE Transactions on Biomedical Engineering 44 (5) (1997) 394–402. [13] R.S.H. Istepanian, A.A. Petrosian, Optimal zonal wavelet-based ECG data compression for a mobile telecardiology system, IEEE Transactions on Information Technology in Biomedicine 4 (September (3)) (2000) 200–211. [14] N. Ahmed, P.J. Milne, S.G. Harris, Electrocardiographic data compression via orthogonal transforms, IEEE Transactions on Biomedical Engineering BME-22 (November (6)) (1975) 484–487. [15] L.V. Batista, E.U.K. Melcher, L.C. Carvalho, Compression of ECG signals by optimized quantization of discrete cosine transform coefficients, Medical Engineering & Physics 23 (2001) 127–134. [16] H.A.M. Al-Nashash, A dynamic Fourier series for the compression of ECG using FFT and adaptive coefficient estimation, Medical Engineering and Physics 17 (3) (1995) 197–203. [17] A.A. Colomer, A.A. Colomer, Adaptive ECG data compression using discrete Legendre transform, Digital Signal Processing 7 (1997) 222–228, Article No. SP970295.

[18] G. Nave, A. Cohen, ECG compression using long-term prediction, IEEE Transactions on Biomedical Engineering 40 (September (9)) (1993) 877–885. [19] A. Nait-Ali, R. Borsali, W. Khaled, J. Lemoine, Time division multiplexing based method for compressing ECG signals: application for normal and abnormal cases, Journal of Medical Engineering & Technology 31 (5) (2007) 324–331, September/October. [20] M. Rodriguez, A.A. Yala, S. Rodriguez, F. Rosa, M.D. Gonzalez, Application of the Max–Lloyd quantizer for ECG compression in diving mammals, Computer Methods and Programs in Biomedicine 73 (2004) 13–21. [21] M. Karczewicz, M. Gabbouj, ECG data compression by spline approximation, Signal Processing 59 (1997) 43–59. [22] W.S. Chen, L. Hsieh, S.Y. Yuan, High performance data compression method with pattern matching for biomedical ECG and arterial pulse waveforms, Computer Methods and Programs in Biomedicine 74 (2004) 11–27. [23] A. Koski, Lossless ECG encoding, Computer Methods and Programs in Biomedicine 52 (1997) 23–33. [24] C.D. Giurcaneanu, I. Tabus, S. Mereuta, Using contexts and R–R interval estimation in lossless ECG compression, Computer Methods and Programs in Biomedicine 67 (2002) 177–186. [25] C.S. Pattichis, E. Kyriacou, S. Voskarides, M.S. Pattichis, R. Istepanian, Wireless telemed systems: an overview, IEEE Antennas and Propagation 44 (April) (2002) 143–153. [26] J. Bari, Y. Zhang, D. Shen, L. Wen, C. Ding, Z. Cui, F. Tian, B. Yu, B. Dai, J. Jhang, A portable ECG and blood pressure telemonitoring system, IEEE Engineering in Medicine and Biology Magazine 18 (August) (1999) 63–70. [27] E. Jovanov, A. Milenkovic, C. Otto, P.C. Goren, A wireless body area network of intelligent motion sensors for computer assisted physical rehabilitation, Journal of Neuro-Engineering and Rehabilitation (March) (2005) 2–6. [28] B.S. Kim, S.K. Yoo, Performance evaluation of wavelet-based ECG compression algorithms for telecardiology application over CDMA network, Medical Informatics and the Internet in Medicine 32 (September (3)) (2007) 177–189. [29] R.S.H. Istepanian, E. Jovanov, Y.T. Zhang, Guest editorial introduction to the special section on M-health: beyond seamless mobility and global wireless health-care connectivity, IEEE Transactions on Information Technology in Biomedicine 8 (December (4)) (2004) 405–414. [30] D. Malan, T.R.F.F. Jones, M. Welsh, S. Moulton, CodeBlue: an ad hoc sensor network infrastructure for emergency medical care, in: Proc. of the MobiSys 2004 Workshop on Applications of Mobile Embedded Systems (WAMES 2004), Boston, MA, USA, June 6, 2004, 2004, pp. 12–14. [31] S. Warren, Beyond telemedicine: infrastructures for intelligent home care technology, in: Pre-ICADI Workshop on Technology for Aging, Disability, and Independence, June, The Royal Academy of Engineering, Westminster, London, England, 2003. [32] E. Bielli, F. Carminati, S.L. Capra, M. Lina, C. Brunelli, M. Tamburini, A Wireless Health Outcomes Monitoring System (WHOMS): development and field

S.K. Mukhopadhyay et al. / Biomedical Signal Processing and Control 8 (2013) 354–363

[33]

[34]

[35]

[36]

[37]

[38]

[39]

[40]

[41]

[42]

[43]

[44] [45] [46]

[47] [48] [49]

[50]

testing with cancer patients using mobile phones, BMC Medical Informatics and Decision Making (June) (2004) 4–7. E. Jovanov, A. Milenkovi, C. Otto, P.D. Groen, B. Johnson, S. Warren, G. Taibi, A WBAN system for ambulatory monitoring of physical activity and health status: applications and challenges, in: Proceedings of the 2005 IEEE Engineering in Medicine and Biology 27th Annual Conference, Shanghai, China, September 1–4, 2005, 2005, pp. 3810–3813. R.S.H. Istepanian, A.A. Petrosian, Optimal zonal wavelet-based ECG data compression for a mobile telecardiology system, IEEE Transactions on Information Technology in Biomedicine 4 (September (3)) (2000). R.H. Istepanian, M. Brien, P. Smith, Modeling of photoplethysmography mobile telemedical system, in: Proc. 19th Annual IEEE Int. Conf. Engineering in Medicine and Biology, Chicago, IL, October 30–November 2, 1997, 1997, pp. 987–990. R.H. Istepanian, B. Woodward, E. Gorilas, P. Balos, Design of mobile telemedicine systems using GSM and IS-54 cellular telephone standards, Journal of Telemedicine and Telecare 4 (1998) 80–82. R.H. Istepanian, Modeling of GSM-based mobile telemedical system, in: Proc. 20th IEEE Annual Int. Conf. Engineering in Medicine and Biology, Hong Kong, November, 1998, pp. 1166–1169. M. Mitra, S. Mitra, J.N. Bera, B.B. Chaudhury, Preliminary level cardiac abnormality detection using wireless telecardiology system, in: Proc. of ICDS’07, Guadeloupe, French Caribbean, January 2–6, 2007, IEEE Computer Society, 2007, pp. 14–19. R. Gupta, C. Das, A. Mondal, J.N. Bera, M. Mitra, T.K. Mitra, Transmission of ECG signal using microcontroller based wireless bi-phase modulation technique, in: Proc. of International Conference MS’07, Kolkata, India, December 3–5, 2007, 2007, pp. 1–4. S. Pavlopoulos, E. Kyriacou, A. Berler, S. Dembeyiotis, D. Koutsouris, A novel emergency telemedicine system based on wireless communication technology - AMBULANCE, IEEE Transactions on Information Technology in Biomedicine – Special Issue on Emerging Health Telematics Applications in Europe 2 (4) (1998) 261–267. M. Siraj, K.A. Bakar, Minimizing interference in wireless mesh networks based telemedicine system, Journal of Computer Science 8 (8) (2012) 1263–1271. X. Xu, Y. Liu, A coding algorithm for SMS data transmission in tele-home care system, in: Proceedings of the 25th Annual International Conference of the IEEE, Cancun, Mexico, 17–21 September 2003, Engineering in Medicine and Biology Society 4 (2003) 3672–3675. C.P.D. Souza, T.P. Pereira, R.C.S. Freire, Electrocardiogram by mobile phone: a compression method for SMS, in: XIX IMEKO World Congress, Fundamental and Applied Metrology, September 6–11, 2009, Lisbon, Portugal, 2009, pp. 1707–1710. E.G. Giannopoulou, Data Mining in Medical and Biological Research, I-Tech Education and Publishing, Vienna, Austria, 2008, November. L. Schamroth, An introduction to Electro Cardiography, Wiley-Blackwell Publication, 1991. S.K. Mukhopadhyay, S. Mitra, M. Mitra, A lossless ECG data compression technique using ASCII character encoding, Computers and Electrical Engineering 37 (2011) 486–497. S.K. Mukhopadhyay, S. Mitra, M. Mitra, An ECG signal compression technique using ASCII character encoding, Measurement 45 (2012) 1651–1660. W.J. Tompkins, Editor Biomedical Digital Signal Processing, Prentice Hall of India Pvt. Ltd., New Delhi, 2006. M.F. Khan, S. Beg, H. Rehman, Transference of compressed audio through SMS using prediction by partial matching technique, International Journal of Advanced Science and Technology 41 (April) (2012) 49–54. C.M. Fira, L. Goras, An ECG signals compression method and its validation using NNs, IEEE Transactions on Biomedical Engineering 55 (4) (2008) 1319–1326.

363

[51] C.M.D. Rodrigo, M.M. Fabrizia, V.B. Leonardo, Near-lossless compression of ECG signals using perceptual masks in the DCT domain, CLAIB 2007, in: IFMBE Proceedings, vol. 18, Margarita Island, Venezuela, 2007, pp. 229–231. [52] A.A. Shrouf, M.A. Zahhad, S.M. Ahmed, A novel compression algorithm for electrocardiogram signals based on the linear prediction of the wavelet coefficients, Digital Signal Processing 13 (2003) 604–622. [53] M.S. Manikandan, S. Dandapat, Wavelet threshold based ECG compression using USZZQ and Huffman coding of DSM, Biomedical Signal Processing and Control 1 (2006) 261–270. [54] Z. Lu, D.Y. Kim, W.A. Pearlman, Wavelet compression of ECG signals by the set partitioning in hierarchical trees (SPIHT) algorithm, IEEE Transactions on Biomedical Engineering 47 (7) (2000) 849–856. [55] A.E. Cetin, H. Koymen, M.C. Aydin, Multichannel ECG data compression by multirate signal processing and transform domain coding techniques, IEEE Transactions on Biomedical Engineering 40 (5) (1993) 495–499. [56] V. Kumar, S.C. Saxena, V.K. Giri, D. Singh, Improved modified AZTEC technique for ECG data compression: effect of length of parabolic filter on reconstructed signal, Computers and Electrical Engineering 31 (4–5) (2005) 334–344. [57] A. Djohan, T.Q. Nguyen, W.J. Tompkins, ECG compression using discrete symmetric wavelet transform, in: IEEE International Conference on Engineering in Medicine and Biology Society, vol. 1, Montreal, Que., Canada, 1995, pp. 167–168. [58] B.R.S. Reddy, I.S.N. Murty, ECG data compression using Fourier descriptors, IEEE Trans. Biomed. Eng. Bme-33 (4) (1986) 428-434. [59] X. Wang, J. Meng, A 2-D ECG compression algorithm based on wavelet transform and vector quantization, Digital Signal Processing 18 (2008) 179–188. [60] S.K. Mukhopadhyay, M. Mitra, S. Mitra, An ECG data compression method via standard deviation and ASCII character encoding, in: Proc. of EAIT 2011, Kolkata, India, 19–20 February 2011, IEEE Computer Society, 2011, pp. 67–70. [61] A. Ouamri, A.N. Ali, ECG compression method using Lorentzian functions model, Digital Signal Processing 17 (2007) 319–326. [62] S.K. Mukhopadhyay, M. Mitra, S. Mitra, Time plane ECG feature extraction using Hilbert transform, variable threshold and slope reversal approach, in: Proc. of (CD) IEEE International Conference on Communication and Industrial Applications – ICCIA 2011, 26th–28th December 2011, Kolkata, India, 2011, pp. 1–4. [63] S.K. Mukhopadhyay, M. Mitra, S. Mitra, ECG feature extraction using differentiation, Hilbert transform, variable threshold and slope reversal approach, Journal of Medical Engineering and Technology 36 (October (7)) (2012) 372–386. [64] S.K. Mukhopadhyay, M. Mitra, S. Mitra, QRS complex identification using Hilbert transform, variable threshold and slope reversal approach, International Journal of Biomedical Engineering and Technology 9 (4) (2012) 301–315. [65] S. Mitra, M. Mitra, B.B. Chaudhuri, A rough-set-based inference engine for ECG classification, IEEE Transactions on Instrumentation and Measurement 55 (December (6)) (2006) 2198–2206. [66] N.M. Arzeno, C.S. Poon, Z.D. Deng, Quantitative analysis of QRS detection algorithms based on first derivative of the ECG, in: Proceedings of 28th IEEE EMBS Annual International Conference, August 30–September 3, 2006, New York, 2006, pp. 1788–1791. [67] S. Mitra, M. Mitra, B.B. Chaudhuri, Pattern defined heuristic rules and directional histogram based online ECG parameter extraction, Measurement 42 (2009) 150–156. [68] P.S. Hamilton, W.J. Tompkins, Quantitative investigation of QRS detection rules using the MIT/BIH ECG arrhythmia database, IEEE Transaction on Biomedical Engineering BME-33 (12) (1986) 1157–1165. [69] J. Pan, W.J. Tompkins, A real-time QRS detection algorithm, IEEE Transaction on Biomedical Engineering BME-32 (3) (1985) 230–236. [70] R. Gupta, M. Mitra, K. Mondal, S. Bhowmick, A derivative-based approach for QT-segment feature extraction in digitized ECG record, in: Proc. of EAIT 2011, 19–20 February 2011, Kolkata, India, IEEE Computer Society, 2011, pp. 63–66.