http://informahealthcare.com/jmt ISSN: 0309-1902 (print), 1464-522X (electronic) J Med Eng Technol, Early Online: 1–18 ! 2014 Informa UK Ltd. DOI: 10.3109/03091902.2014.990159

INNOVATION

A combined application of lossless and lossy compression in ECG processing and transmission via GSM-based SMS S. K. Mukhopadhyay*1, S. Mitra2, and M. Mitra1 J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

1

Department of Applied Physics, Faculty of Technology, University of Calcutta, 92 A.P.C. Road, Kolkata, India and 2Department of Electronics, Netaji Nagar Day College (affiliated to University of Calcutta), N.S.C. Bose Road, Regent Estate, Kolkata, India Abstract

Keywords

This paper presents a software-based scheme for reliable and robust Electrocardiogram (ECG) data compression and its efficient transmission using Second Generation (2G) Global System for Mobile Communication (GSM) based Short Message Service (SMS). To achieve a firm lossless compression in high standard deviating QRS complex regions and an acceptable lossy compression in the rest of the signal, two different algorithms have been used. The combined compression module is such that it outputs only American Standard Code for Information Interchange (ASCII) characters and, hence, SMS service is found to be most suitable for transmitting the compressed signal. At the receiving end, the ECG signal is reconstructed using just the reverse algorithm. The module has been tested to all the 12 leads of different types of ECG signals (healthy and abnormal) collected from the PTB Diagnostic ECG Database. The compression algorithm achieves an average compression ratio of 22.51, without any major alteration of clinical morphology.

ASCII character, grouping, GSM transmitter, SMS, standard deviation

1. Introduction Cardiovascular diseases (CVDs) still remain the leading killer all over the world. As per World Health Organization’s (WHO) estimation, in 2008, 17.3 million people died from CVDs, representing 30% of all global deaths. It is alarming that, by the year 2030, 23.6 million people will die from CVDs, and the effect will be terrible in South-East Asia [1]. Proper medicine or cardiac surgery may save some of these lives if precautionary measures can be taken at an earlier stage of the cardiac abnormality. The electrocardiogram (ECG) is a diagnostic means that is often used to judge the electrical and muscular functions of the heart. ECG is described by waves, segments and intervals. The letters P, QRS, T and U are used to mark different ECG waves. These alphabets were chosen in the early days of ECG history and were chosen arbitrarily [2]. The U wave may not be visible always. Shapes, sizes and durations of these P-QRS-T waves, intra-wave and also interwave intervals have their own clinical morphology. A typical ECG trace is shown in Figure 1. Bio-signals are highly subjective. Hence, reflection of abnormalities would be random, i.e. the syndrome may not show up all the time, but would manifest at certain irregular intervals during a day. Therefore, ECG pattern analysis has to be carried out for extended periods of time, as done in a *Corresponding author. Email: [email protected]

History Received 11 July 2014 Revised 10 November 2014 Accepted 16 November 2014

Holter monitoring system. As an expected outcome, the volume of data to be handled becomes gigantic. A good number of high quality dedicated research and efficient methods have come out in the field of ECG data compression over the last 40 years. ECG compression algorithms are generally divided into three main categories: (i) a transformation-based method, (ii) a parameter extraction-based method and (iii) a direct data compression technique. Among transformation-based techniques, Wavelet transformation [3–5], DCT [6] and Legendre Transform [7] have become popular. Parameter extraction-based techniques [8] are mainly based on prediction algorithms. Direct compression techniques [9] preserve and process only those samples having important clinical information and discard the rest. As well as these, Pattern Matching technique [10], TDM-based method [11], DPCM Quantizer [12], Variable-Length Classified Signature and Envelope Vector Sets (VL-CSEVS) [13] and Delta Coding and Optimal Selective Huffman coding [14] have also been used in ECG compression. Apart from these, ECG compression techniques can also be classified into lossy and lossless methods. A lossy compression method can achieve a better data reduction ratio than the lossless one, but it may drop some important clinical features. Use of lossless compression is very important from a juridical perspective [14–16]. Inadequate healthcare services, a shortage of medical staff personnel and also a lack of general awareness are some

2

S. K. Mukhopadhyay et al.

J Med Eng Technol, Early Online: 1–18

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

Figure 1. A typical ECG trace.

serious healthcare issues in developing nations like India. These problems originated the idea of extending the healthcare services beyond the hospital boundary. Twothirds of the total Indian population lives in rural areas where the availability of properly trained medical staff personnel is inadequate [17]. As a result, a large portion of the total population does not even get the minimum healthcare facilities. The objective of this proposed research work is to develop an automated ECG processing module which would be able to efficiently compress the digitized ECG signal and transmit the same using 2G-GSM technology to some distant healthcare centre or to some expert cardiologist in case of emergency or also for periodic check-up. Telemedicine systems have been established in a few city-based hospitals and clinics to fulfil the need of the healthcare service but, obviously, this is inadequate to serve the vast rural population. The latest wireless communication technologies such as 3G, WiMAX and General packet radio service (GPRS) are superior in data transmission rate compared to 2G GSM technology. These high-end communication technologies have become popular in economically advanced metropolitan cities [18]. A report says there were more than two billion GSM users in 2006 and the majority (80.8%) of the 3.8 billion cellular phone users in the world were 2G GSM users in 2009 [19]. In the past few years a good number of mobile telemedicine systems have been proposed in the literature [20,21]. The GSM link was used in Pavlopoulos et al. [22] for developing a portable telemedicine device. Use of the Wireless Mesh Network (WMN) [23] and the Code Division Multiple Access (CDMA) network [21] are also introduced in tele-monitoring and tele-cardiology applications. SMS was used in various studies [24–28] to transmit compressed ECG data to remote healthcare centres. A mobile phone based Holter recorder and tele-monitoring system using 2G GSM SMS was proposed in Kaewfoongrungsie et al. [29]. The system detects R peaks and sends warning SMS only in the case of abnormal heart rate. A similar type of system is also developed in Sankari and Adeli [30]. In Pollonini et al. [31] a system is developed for acquiring two lead ECG and photoplethysmography (PPG) signals, bioelectrical impedance and wireless transmission of key cardiac parameters. A digital image-based ECG diagnosis in emergency telemedicine is implemented in Hsieh and Lo [32]. Cloud and pervasive computing based 12-lead ECG service is reported in Hsieh and Hsu [33]. A Bluetooth Piconet-based

real time ECG monitoring system is developed in Pandya et al. [34]. The Bluetooth device captures real time simulated signals and relays the data to a Bluetooth enabled laptop where received signals are further processed. A strict lossless and an acceptable lossy ECG compression technique have been proposed by Mukhopadhyay et al. [35,36], respectively. These two methods are combined together in Mukhopadhyay et al. [37,38], but in a completely different way where the compression performance solely depends on the R-peak detection accuracy. Any false detection or failure of R-peak detection degrades the quality of the reconstructed signal. Internet-based free SMS sending websites are used in Mukhopadhyay et al. [38] to transmit the compressed ECG data. A GSM transmitter is also used in Mukhopadhyay et al. [39,40]. In Mukhopadhyay et al. [39], the ECG data is compressed using the lossless technique and in Mukhopadhyay et al. [40], the lossy compression method is used. In the present work, at first, standard deviation (SD) of a section of the ECG signal is computed. If the calculated SD exceeds an empirically determined threshold, then that portion of the ECG signal (probable QRS regions) is compressed in a lossless manner, otherwise in a lossy manner with negligible loss of clinical information. The shapes, sizes, intra-wave and inter-wave intervals of QRS complexes have a significant impact on disease diagnosis. For example, different bundle branch blocks (BBB), degree of atrio-ventricular block, Myocardial Infarction (MI), bradycardia, trachycardia and so many other symptoms can be identified from QRS complex regions [11]. Other parts of the ECG wave, i.e. P, T waves, ST segments, etc., are also important in ECG interpretation. Symptoms of myocardial ischaemia, atrial fibrillation, etc. [2] are generally reflected in these sections of ECG. However, the lossy compression technique is capable enough in reconstructing those portions without alteration of clinical morphology. Both these compression techniques are such that they encode digitized ECG samples into ASCII characters which are then transmitted using an ‘‘i-300’’ GSM transceiver module in the form of SMS. At the receiving end, all SMSs are taken together, concatenated and then ECG signal is reconstructed using the reverse programming logic of compression. In Mukhopadhyay et al. [41], a standard deviation based ECG compression method is also proposed by us, but the threshold factor is not well specified there and the algorithm

ECG processing and transmission via GSM-based SMS

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

DOI: 10.3109/03091902.2014.990159

3

Figure 2. Block schematic of the proposed module.

is tested only on few ECG data files. Here the threshold factor is chosen through a rigorous testing on all the 12 leads of 84 ECG data files of different diseases. Moreover, the system is upgraded for being used in long distance wireless telecardiology application.

2. Methodology The whole module is divided into three main sections: (i) Data compression; (ii) Transmission-Reception; and (iii) Data reconstruction. Data compression in part is further divided into three sub-sections (a) Standard Deviation (SD) calculation, (b) Lossless compression in high SD regions (L2CHSR) and (c) Lossy compression in low SD regions (LCLSR). The data reconstruction algorithm is also divided into two subsections: (a) Lossless reconstruction in high SD regions (L2RHSR) and (b) Lossy reconstruction in low SD regions (LRLSR). All these compression, transmission-reception and reconstruction algorithms are explained sequentially in the following sections. A block schematic of the proposed module is shown in Figure 2. 2.1. Data compression protocol In PTB-DB, the sampling frequency of the ECG signal is 1 KHz. Hence, the sampling interval is 0.001 s. As these parameters are known, one can easily generate the time axis using an arithmetic progression (AP) series. Hence, the time axis is discarded since it bears no clinical information.

A block schematic of the proposed compression module is shown in Figure 3. 2.1.1. Standard deviation (SD) calculation From the digitized ECG data file at a time 2000 samples of a particular ECG lead are taken, the mean is calculated using Equation (1). In PTB-DB, the sampling frequency of the ECG signal is 1 kHz. Therefore, 2000 samples correspond to an ECG signal of 2 s. After testing the compression algorithm on a huge number of ECG data files taken from this database, it is observed that the heart rate will never fall below 30. Therefore, we will find at least one complete ECG cycle (P, QRS, T waves) within any 2-s time span of the ECG signal. One can also choose 1500, 1000 or even 800 samples instead of 2000. However, for those cases, one has to assume that the heart rate will never fall below 40, 60 or 75, respectively. All these calculations are valid for sampling frequencies of 1 KHz. ECG signals having a sampling frequency other than 1 KHz require a slightly different calculation. From those 2000 samples, starting from the first, a group of 16 consecutive samples were taken and the standard deviation (SD) was calculated using Equation (2). Equations (1) and (2) are shown in Table 1. Now, if this calculated SD exceeds 2.5-times the mean, then those 16 samples are compressed using a lossless compression technique, otherwise using a tolerable lossy compression technique. The database contains 559 records from 294 subjects with healthy, Bundle Branch Block, Myocardial infarction, Myocarditis, Hypertrophy, Cardiomyopathy,

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

4

S. K. Mukhopadhyay et al.

J Med Eng Technol, Early Online: 1–18

Figure 3. Block schematic of the proposed compression module.

Table 1. List of equations used for SD calculation. Equation no 1

2

Equation Pn xi mean ¼ i¼1 n sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi Pn 2 i¼1 ðxi  meanÞ SD ¼ n

Meaning of symbols xi is the ith ECG sample. i ¼ 1, 2, 3, . . . n ‘‘n’’ is the total number of sample

Dysrhythmia and Valvular Heart Disease patients and each record contains simultaneous 15 leads ECG recordings (I, II, III, aVR, aVL, aVF, V1–V6, Vx, Vy and Vz) and other physiological signals. The factor 2.5 is chosen through a rigorous testing of the compression algorithm on all the 12 leads of 84 ECG records collected from PTBDB. It is observed that this particular threshold value helps well in detecting not only the R peak regions, but the whole QRS complex (QRS onset, Q, R, S and QRS offset points) regions also. Figure 4 demonstrates the operation. At a time, 16 consecutive samples are taken. This is because, after processing, ECG samples are encoded into ASCII characters. It is well known that the maximum size of an ASCII character is 8-bit (1 byte). Therefore, the number of sample in a data block should be a multiple of 8. The algorithm is described elaborately in the next two subsections.

designed on the basis of three main sections: viz., intersample difference computation, sign byte generation and grouping. Those 16 samples having SD greater than the threshold are taken into consideration and L2CHSR algorithm is applied on those. The algorithm is described below. To reduce the amplitudes of ECG samples and to get better compression performance, a difference array is constructed by subtracting every sample from its preceding. Every sample of this difference array is checked to identify positive and negative numbers. A binary zero (0) is taken for marking every positive number and every negative number is marked by a binary (1). Decimal equivalent of this binary string is used as the sign byte of those original ECG samples. Negative numbers in the difference array, if any, are made positive after generating the sign byte. To get integer value, every number in the difference array is multiplied by 1000 because, in all standard ECG databases including PTB-DB, European ST-T database (edb) and MIT-BIH ECG compression test database (cdb), ECG samples are recorded up-to three decimal points. After modification, neighbour integers are grouped, if possible, maintaining some fundamental logical criteria. Grouping is done in such a way that those numbers can be easily separated at the receiving end. Every set of grouped or not-grouped integer values and other necessary information (sign byte, grouping index, etc.) are printed in the output file in the form of ASCII character. 2.1.3. Programming logic of LCLSR

2.1.2. Programming logic of L2CHSR The compression algorithm proposed in Mukhopadhyay et al. [35] is used here to compress the high standard deviating QRS complex regions in lossless fashion. The algorithm is

The algorithm proposed in Mukhopadhyay et al. [36] is implemented here in a slightly different way to achieve an acceptable lossy compression in low standard deviating regions (ST, TP segment, P and T wave regions, etc.). From

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

DOI: 10.3109/03091902.2014.990159

ECG processing and transmission via GSM-based SMS

5

Figure 4. ECG signal of 2 s duration (A); File S0004RE, lead II, its mean value (B), first derivative of the signal (C) to check the high frequency QRS complex regions, SD for each consecutive 16 ECG samples (D) and those samples having SD greater than 2.5-times of the mean (E).

these regions also, consecutive 16 ECG samples are taken. It is well established that the clinical bandwidth of 12-lead ECG ranges from 0.05–100 Hz [42]. Therefore, 1 KHz sampling frequency is more than sufficient. Hence, before compression, the sampling frequency of these regions is reduced to one half (500 Hz), i.e. down sampling is implemented. To implement this, only eight alternative samples (1st, 3rd, 5th . . .) out of those 16 are taken for processing and saved in an array. A sign byte of these eight ECG samples is generated in the same way as described in section 2.1.2. Now, for these eight samples, a suitable amplification factor is generated in such a way that, after amplification, the integer part of each of these voltage values will be either less than or equal to nine. These eight amplified integers are grouped into four by combining every two neighbours. Grouped integers and other related information are printed in the output file in their corresponding ASCII characters. Both L2CHSR and LCLSR algorithms are executed repeatedly until all the samples of the digitized ECG data file become compressed. In LCLSR, amplification is done in such a way that the integer parts of amplified voltage values become either less than or equal to nine. This is done in order to increase the grouping possibility and consequently the compression ratio. The process of amplification and fixing does not depend on the sampling frequency of the ECG signal. It was mentioned earlier that the time axis is discarded for both L2CHSR and LCLSR algorithms. Hence they are completely time independent and do not depend on the sampling frequency of the ECG signal. Therefore, these two algorithms can also be applied independently on ECGs having different sampling rates. In signal processing, down-sampling is used to reduce

the sampling rate of a signal. This is usually done to reduce the data rate or the size of the data. Nowadays, it has become a common practice to implement in various types of signal processing algorithms including image compression [43]. Down-sampling works well where the original signal or image is smooth. Often images have large smooth areas (sky, out-of-focus areas, etc.). Down-sampling can be implemented only for these parts of the signal or image [44]. This technique is valid until it distorts the reconstructed signal. Use of downsampling in ECG compression was also implemented by Mueller [45] in 1978. Later, in 1982, Abenstein and Tompkins [46] proposed an ECG compression algorithm (CORTES) using Cox et al. [9] and Mueller [45]. Figure 5 shows a snapshot of the content of a compressed ECG data file. 2.2. Data transmission and reception protocol After compression there is the need to transmit the signal to a diagnostic centre or to an expert cardiologist for decisionmaking purposes. Here the compressed file contains only ASCII characters and, therefore, 2G GSM-based SMS is found to be the most suitable to connect the remote patient and expert doctor or cardiologist. For this purpose an ‘‘i-300’’ GSM modem connected through a computer serial port is used to send SMS. The application software developed for this purpose offers one to choose the compressed file and transmit the same using the GSM modem, obeying its protocol. The GSM modem works on ‘‘AT’’ commands. AT is the abbreviation of Attention. Every command line starts with ‘‘AT’’. Few examples are: ‘‘ATD’’ is used for dialing a number, ‘‘ATA’’ is used for answering an incoming call, ‘‘CMGS’’ is used to send SMS in text mode, etc.

6

S. K. Mukhopadhyay et al.

J Med Eng Technol, Early Online: 1–18

Table 2. Character division table. 0

! 255

0

! 31

32

1st group

32



59

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

0

.....

27

...

..

60

! 218

219

3rd group

61

..

4th group

91

DATA Same as original

! 255

...

RANGE 35

127

DATA Number - 6

Figure 7. 8 to 7-bit conversion algorithm adopted for group 2.

128 29

128

2nd group

RANGE 34

Figure 5. Snapshot of the content of a compressed ECG data file.

! 127



155

156

157



187



218

31 RANGE 36

RANGE DATA 32 32+ that 8-bit ASCII RANGE DATA 33 Number+33

DATA number - 100 + 4 RANGE 37

DATA Number - 100 - 4

Figure 8. 8 to 7-bit conversion algorithm adopted for group 3. Figure 6. Schematic of an ECG transmission protocol using GSM transceiver module.

2G GSM SMS supports only 7-bit ASCII characters ranging from 0–127; but, the compressed file contains all 8bit ASCII characters ranging from 0–255. Therefore, every character in the compressed file is mapped into two 7-bit ASCII characters. Although 2G GSM SMS supports 7-bit ASCII characters, a few specific 7-bit characters cannot be transmitted through SMS. For example, all characters between 0–31, 59, 61, 91–94, 96 and 123–127 cannot be transmitted. Characters ranging from 0–31 are reserved for some special operation [47]. ASCII characters of 59 (;), 61 (¼), 91 ([), 92 (\), 93 (]), 94 (^), 96 (‘), 123 ({), 124 (j), 125 (}), 126 () and 127 ( ) can be transmitted through 2G GSM SMS, but in the received SMS file there will be some other characters except these. Hence, these problematic characters should be modified properly before transmission. A schematic of such an ECG transmission protocol using a GSM transceiver module is shown in Figure 6. The algorithm followed here to convert 8- to 7-bit ASCII characters is described below. At first, 8-bit ASCII characters are divided into four groups. All characters between 0–31 are taken as the 1st group. Characters ranging from 32–127 are in the 2nd group; 128–218 belong to the 3rd group; and the rest of the characters, i.e. 219–255, reside in the 4th group. Table 2 illustrates the group division. Two variables have been taken, named ‘‘RANGE’’ and ‘‘DATA’’ to store two 7-bit ASCII characters.

2.2.1. Algorithm applied for 1st group For this group, RANGE is set to 32 and DATA is set to ‘‘32 + that 8-bit ASCII’’. Therefore, both RANGE and DATA will always be greater than 31 and, hence, can be transmitted through SMS. Although 27 and 29 fall in this range, after adding 32 with these two, they become 59 and 61, respectively. These two characters can’t be transmitted through SMS. For these two, RANGE is set to 33 and DATA is set to ‘‘Number + 33’’ (Figure 7). 2.2.2. Algorithm applied for 2nd group For these numbers, RANGE is set to 34 and DATA is assigned as the same as the original number. Although 59, 61, 91–94, 96 and 123–127 fall in this range, these characters can’t be transmitted through SMS. Therefore, these numbers are modified in a different way. For these numbers RANGE is set to 35 and DATA is set to ‘‘Number  6’’ (Figure 8). This is simply to overcome the difficulty. 2.2.3. Algorithm applied for 3rd group For this group, RANGE is set to 36 and DATA is set to ‘‘number  100 + 4’’. All characters in this range are 8-bit ASCII. ‘‘100’’ is subtracted to make them 7-bit ASCII and ‘‘4’’ is added to move them up above 31. Here also the same problem occurs for the numbers 155, 157, 187–190 and 192.

ECG processing and transmission via GSM-based SMS

DOI: 10.3109/03091902.2014.990159

219

RANGE 38



246

DATA Number - 200 + 13

247

248

RANGE 39

….

7

255

DATA Number - 200

Figure 9. 8 to 7-bit conversion algorithm adopted for group 4.

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

Figure 11. Used i-300 GSM modem.

Figure 10. Schematic of an ECG transmission protocol using GSM transceiver module.

RANGE and DATA are also modified for these numbers in the same way described earlier (Figure 9). 2.2.4. Algorithm applied for 4th group For the last set of characters (219–255), RANGE is set to 38 and DATA is set to ‘‘Number  200 + 13’’. Also in this range, a problem arises for the numbers 246 and 248 (Figure 10).

It is to keep into consideration that both RANGE and DATA must be valid 7-bit ASCII characters and the combination of these two must be unique for every 8-bit character. At last both RANGE and DATA are printed in the output file. Utmost 160 characters can be delivered through a single SMS if the GSM modem is used under text mode. Therefore, the developed algorithm divides the compressed data file into small data files each containing 160 7-bit characters. Out of those 160 characters, the first character is allotted for patient ID, second and third characters are allotted for SMS number and the remaining 157 characters are used for transmitting the compressed ECG data. Now those small data files are transmitted to doctors’ or cardiologists’ mobile phone through the ‘‘i-300’’ GSM modem with the help of proper AT commands. Excluding those problematic characters (0–31, 59, 69, etc.), at a time, 84 (128 7-bit ASCII characters – 44 problematic characters ¼ 84) patients’ compressed ECG file can be transmitted simultaneously to a particular mobile phone and each patient ID can have 7056 (84  84) SMSs, if needed. Using this proposed compression module it is observed that, on average, 10 SMSs are enough to transmit two-to-three complete ECG cycles, but sometimes doctors may need to check a long time ECG record and that is why provision has been kept. Since the patient ID and SMS number are included inside the SMS body, multiple patients’ compressed ECG can be sent simultaneously. Used the GSM modem for this purpose is shown in Figure 11. The packet structure for sending a single SMS is shown in Table 3. At the receiving end, received SMSs are to be taken from the mobile phone to the computer or laptop using Bluetooth or a USB cable. There is also a reverse algorithm which concatenates all those SMSs according to their serial number of a particular patient ID, converts 7-bit to 8-bit ASCII characters, creates separate files for different patient IDs and also tracks SMS senders’ mobile phone numbers from the SMS body so that fast communication can be made with patient parties at critical conditions. 7-bit ASCII characters are converted to 8-bit using the reverse algorithm. A block schematic of the ECG signal reconstruction protocol is shown in Figure 12. At the receiving end a ‘‘Samsung Wave 525’’

8

S. K. Mukhopadhyay et al.

J Med Eng Technol, Early Online: 1–18

Table 3. Packet structure of a single SMS. PID ! (ASCII of 33) 1

SMS no

SMS no

Compressed data

! (ASCII of 33) 2

$ (ASCII of 36) 3

% (ASCII of 37) 4

... ...

& (ASCII of 38) 160

region (LRLSR). From the compressed data file at a time, one set of ASCII characters is taken. For lossless compression, there are at least 12 characters and, for lossy compression, there are only seven characters in a set. Hence, if the number of characters is more than seven, the set will be decompressed in a lossless manner, otherwise in a lossy method.

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

2.3.1. Programming logic of L2RHSR The algorithm is developed using just the reverse logic of the L2CHSR, as described in section 2.1.2. One set of ASCII characters is taken from the compressed ECG data file and equivalent ASCII values are saved in an array. A decompression algorithm is applied on those to restore the original eight samples. Ungrouping is done using just the reverse logic of grouping. Reserved ASCII characters are replaced in the compression module. Now it is the time to bring back originals in proper places. In the next step, the sign-byte is converted into its 8-bit binary equivalent. In the binary string if any bit is ‘‘1’’, then the corresponding ungrouped integer is multiplied by (1). Now, every number is divided by 1000 and added with its previous value to regenerate original ECG samples. These new values are stored in another array. PTBDB ECG database uses 1 KHz sampling frequency which corresponds to a sampling interval of 0.001 s. Hence, the time axis is easily generated and printed with the reconstructed ECG samples. 2.3.2. Programming logic of LRLSR

Figure 12. Block schematic of the signal reconstruction protocol.

mobile is to receive SMS. Generation and concatenation of SMSs are done on MATLAB 7.1 platform. Snapshots of the used ‘‘Samsung Wave 525’’ mobile phone and few intermediate processes are shown in Figure 13.

A LRLSR algorithm is also developed by means of reverse logic of LCLSR. Here, also, one set of characters is taken from the compressed data file and equivalent ASCII values are saved. Ungrouping is done using the reverse logic of grouping as described in section 2.1.3, ungrouped numbers are divided by the amplification factor and saved in an array (say e[] array). The sign bit regeneration process is the same as described in section 2.3.1. The sampling frequency is reduced to one half in section 2.1.3. Now it is the time to create 16 samples from these eight to keep track of the sampling frequency of the reconstructed ECG signal with its original. This is implemented by inserting the average of two neighbour samples in between. The operation is depicted in Figure 14. Here also the time axis is generated as described earlier and printed with the reconstructed ECG samples.

2.3. Data reconstruction protocol Now it is time to bring back the original ECG signal for doctor’s visual inspection and decision-making purposes. The data reconstruction algorithm is divided into two subsections: (i) Lossless data reconstruction in High SD regions (L2RHSR) and (ii) Lossy data reconstruction in Low SD

3. Result The performance of the proposed ECG processing module is tested on all the 12 ECG leads of different ECG data files taken from PTB-DB and the results are shown below. In biomedical data compression, clinical acceptability of the

DOI: 10.3109/03091902.2014.990159

ECG processing and transmission via GSM-based SMS

9

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

Figure 13. Snapshots: (A) Samsung Wave 525’ mobile phone, (B) Received SMSs, (C–E) Transferring SMSs from mobile phone to memory card, (F) Phone is connected to PC via USB cable and (G) Transferring SMSs from memory card to PC.

reconstructed signal is usually tested through visual inspection [42]. Mathematical measures are also there such as percentage root-mean-square difference, PRD, given by Equation (3). Equations are included in Table 4. The modified and normalized version of PRD is PRDN. This measure does not depend on the signal mean value Smean and is defined in Equation (4). The Compression Ratio (CR), which is defined in Equation (5), is also calculated. The higher the value of CR, the better the performance of the compression algorithm. An additional numerical measure is Quality Score (QS), proposed in Fira and Goras [48] to compute the overall

performance of a compression algorithm. A high score represents a good compression performance. QS is defined in Equation (6). A statistical measure of the spreading of data points in a data series about the mean is called Coefficient of Variation (CV) and is calculated using the formula given in Equation (7). It is a powerful statistic for comparing the amount of deviation from one data series to another, even if the means are radically apart. The lower the value of CV, the better the performance of the algorithm. Average CR, PRD, PRDN and QS obtained for Hypertrophy, Myocardial Infarction, Normal and Bundle

J Med Eng Technol Downloaded from informahealthcare.com by University of Liverpool on 01/01/15 For personal use only.

10

S. K. Mukhopadhyay et al.

J Med Eng Technol, Early Online: 1–18

Branch Block patients are given in Table 5. The CV of each of these individual parameters is also calculated. From Table 5 it can be noted that the proposed algorithm provides an average CR of 22.51, PRD of 7.34%, PRDN of 17.26% and QS of 3.01. The CV of CR, PRD, PRDN and QS is 0.04, 0.07, 0.94 and 0.06, respectively. Figures 15 and 16 show the original (blue-A), reconstructed (black-B) and the difference between original and reconstructed ECG signals (magenta-C) processed by the algorithm. From Table 5 it can also be seen that the span of the CR (Maximum CR – Minimum CR ¼ 23.90  20.90 ¼ 3) is very low. It signifies that the compression module can handle different types of ECG signals, irrespective of their morphology. Except these numerical measurements, a different technique is implemented to ensure trustworthy performance of the compression algorithm, as done in Biswas et al. [49]. The ECG feature extraction algorithm proposed in Mukhopadhyay et al. [50] was applied on all the 12 leads of original and reconstructed ECG signals to check the deviation of feature values. Table 6 shows the time indexes (in terms of second) of different ECG characteristic points detected around the 3rd heartbeat of original and reconstructed signals of File S0273. The average percentage of deviation (PD%) of each individual

8-Ungrouped samples

0.030

0.020

0.010

e[0]

e[1]

e[2]

−0.015 −0.040 e[3]

e[4]

0.005

0.050

e[5]

e[6]

0.060 e[7]

0.070

…….

e[8]

Average Voltages

16 samples

Figure 14. The up-sampling operation.

ECG feature is also calculated. PD is calculated using Equation (8). 8 9

A combined application of lossless and lossy compression in ECG processing and transmission via GSM-based SMS.

This paper presents a software-based scheme for reliable and robust Electrocardiogram (ECG) data compression and its efficient transmission using Seco...
2MB Sizes 0 Downloads 9 Views