Compression of ECG signals using variable-length classifıed vector sets and wavelet transforms

In this article, an improved and more efficient algorithm for the compression of the electrocardiogram (ECG) signals is presented, which combines the processes of modeling ECG signal by variable-length classified signature and envelope vector sets (VL-CSEVS), and residual error coding via wavelet transform. In particular, we form the VL-CSEVS derived from the ECG signals, which exploits the relationship between energy variation and clinical information. The VL-CSEVS are unique patterns generated from many of thousands of ECG segments of two different lengths obtained by the energy based segmentation method, then they are presented to both the transmitter and the receiver used in our proposed compression system. The proposed algorithm is tested on the MIT-BIH Arrhythmia Database and MIT-BIH Compression Test Database and its performance is evaluated by using some evaluation metrics such as the percentage root-mean-square difference (PRD), modified PRD (MPRD), maximum error, and clinical evaluation. Our experimental results imply that our proposed algorithm achieves high compression ratios with low level reconstruction error while preserving the diagnostic information in the reconstructed ECG signal, which has been supported by the clinical tests that we have carried out.


Introduction
An electrocardiogram (ECG) signal, which is a graphical display of the electrical activity of the heart, is one of the essential biological signals for the monitoring and diagnosis of heart diseases.ECG signals recorded by the digital equipments are most widely used in the applications such as monitoring, cardiac diagnosis, real-time transmission over telephone networks, patient databases and long-term recording.Some key parameters such as the sampling rate, sampling precision, number of leads and recording time play an important role in the increase of the amount of data collected from an ECG signal.Evidently, when continuously generating the huge amount of ECG data, in order to be able to process these data, we need the proper equipments that have the high storage capacity.On the other hand, when the equipments are used in the remote monitoring activities, they must have the wide transmission band.Therefore, in order to achieve removing the redundant information from the ECG signal with retaining all clinically significant features including P-wave, QRS complex and T -wave [1,2], we need to employ an effective ECG compression algorithm.
In the recent years, the studies dealing with the modeling and compression of the ECG signals essentially utilize one of the following methods: (i) The direct time-domain methods, (ii) the transform-based methods, (iii) the parameter extraction methods [2,3].
Among the proposed methods in the literature, one of the most known and powerful algorithm is the set partitioning in hierarchical trees (SPIHT) compression algorithm [21].Another efficient ECG compression method uses the cosine modulated filter banks to reconstruct the original ECG signals [25].In [22], another ECG compression method is proposed, which is based on the adaptive wavelet coefficients quantization by using a modified two-role encoder.Most recently, the waveletbased ECG data compression system having a linear quality control scheme was proposed [20].
In some previously published articles [26,27], it has been shown that the predefined signature and envelope vector sets best describe the speech and ECG signals.It has also been demonstrated in [26,27] that, by introducing and employing a new systematic procedure called SYMPES, the predefined signature and envelope vector sets have been used to model the speech and ECG signals frame by frame.In this procedure, each frame of the reconstructed speech or ECG signal is represented by a combination of multiplication of three major quantities, which are the gain factor, the signature vector, and the envelope vector.
In [28], a novel EEG compression method was proposed, which is based on the construction of the classified signature and envelope vector sets (CSEVS).The signature and envelope vector sets obtained for the speech and ECG signals in [26,27] were then extended to the EEG signals in [28] to obtain the signature and envelope vector sets for the EEG signals.Then, these vector sets were classified by using k-means clustering algorithm to determine the centroid vectors of each classified vector sets, which were to be used in constructing of the CSEVS.The main advantage of the method proposed in [28] is that it reduces the size of vector sets and computational complexity of the searching and matching processes.The method introduced in [28] also proved to have advantages over the wavelet transform coding technique as far as the average RMSE, average PRD, average PRD1, and CR(%) are concerned.
In [29], a new block-based image compression scheme was presented based on generation of classified energy and pattern blocks (CEPBs).In the method, first the clasified enesrgy blocks (CEB) and clasified pattern blocks (CPB) sets were constructed and any image data can be reconstructed block by block using a block scaling coefficient and the index numbers of the CEPBs placed in the CEB and CPB.The CEB and CPB sets were constructed for different sizes of image blocks such as 8 × 8 or 16 × 16 with respect to different compression ratios (CRs) desired.At the end of a series of the experimental works, the evaluation results show that the proposed method provides high CRs such as 21.33:1, 85.33:1 while preserving the image quality at 27-30.5 dB level on the average.When the CR versus image quality (PSNR) results in the proposed method compared to the other works, it seems that the method is superior to the DCT and DWT particularly at low bit rates or high CRs.
In the current article, we propose a new and more efficient ECG compression algorithm which relies on the variable-length CSEVS (VL-CSEVS) and wavelet transform.In this proposed algorithm, we first use the energy based segmentation method to represent an ECG frame with high energy by short segments and an ECG frame with low energy by long segments.Then, the unique patterns VL-CSEVS are generated from these ECG segments of two different lengths.Thus, when compared with the previous results obtained in [26][27][28], our new method significantly improves the CR, and then the use of wavelet transform based residual error coding both enhances the quality of the reconstructed signal.In order to check the performance of our new method for a different classes of ECG signals, given that the original unique patterns VL-CSEVS remain unchanged, we have used the MIT-BIH compression test database called the worst-case database by the its developers [15].
The parameters PRD, MPRD, and maximum error (MAXERR) for compression the ECG of the unique pattern VL-CSEVS derived from the original ECG are measured by changing both the training set and the test set at each round of the 4-fold cross-validation method, whose average values are used to determine the performance of our new proposed method.We should point out here that the sampling frequency, resolution, mean value, and amplitude value of the ECG signals in the test database are different from those of the ECG signals used to construct the unique patterns VL-CSEVS.
The article is organized as follows.Section 2 describes the details of the newly proposed compression algorithm.In Section 3, we present the experimental results obtained by using the proposed compression algorithm, which are then compared with some known successful ECG compression methods reported in [21,22,25].In Section 4, we give the conclusion.

Proposed compression algorithm
In this article, an efficient ECG compression algorithm which is based on the modeling ECG signals via VL-CSEVS and employs the residual error coding by using the wavelet transform is proposed.One of the main advantages of our method is to ensure the quality in the reconstruction of an ECG signal.
We use the variable-length approach to generate the CSEVS.In this context, an ECG frame with high energy carrying useful information such as QRS complex is represented by the short segments.At the same time, an ECG frame with low energy with or without possessing clinical information is represented by the long segments.The length of the short segments is determined to be 16 and that of long segments is determined to be 64.
In determination of the length of the segments, we first check the relationship between the segment length and blocking effect for various segment lengths, and then choose the segment length which minimizes the blocking effect on the reconstructed ECG signal.
After the variable-length segmentation process, the signature and envelope vectors are extracted from many of thousands of ECG segments.Then, the signature and envelope vectors are classified by employing effective kmeans algorithm which helps us to eliminate the similar signature and envelope vectors.Thus, the VL-CSEVS are constructed by using non-similar signature and envelope patterns, implying that the VL-CSEVS will have unique patterns.
In conclusion, the ECG segments with low energy can be more compressed than the ECG segments that have high energy.Thus, our new method allows us to significantly increase the total CR of ECG signals.On the other hand, some ECG frames containing p-wave or t-wave carries valuable clinical information may have low energy.In the reconstruction of these types of ECG frames, the reconstruction error is substantially decreased by employing the wavelet based residual error coding technique.The proposed algorithm is superior to the powerful wavelet based ECG compression methods, especially at low bit rates.
The newly proposed algorithm basically consists of three processing stages: the pre-processing stage, the stage of construction of the VL-CSEVS, and reconstruction process of an ECG signal.In the following subsections, each stage is explained in details.

Preprocessing stage
The preprocessing is one of the most important stages of an ECG compression method because it plays a crucial role in enhancing the compression performance of the algorithm.The preprocessing stage is carried out in three steps.
The first step of this stage normalizes the frequency of each signal to 500 Hz using cubic spline interpolation technique.The amplitude normalization is the second step of this stage, which normalize amplitude of each ECG signal is between 0 and 1 using the following formula The final step of this stage is the segmentation process.There are two traditional ECG segmentation methods in the literature.The first method is based on the QRS detection algorithm.In this method, each QRS peak of heartbeat or each R-R interval is identified as a segment.Due to the heart rate variability, this segmentation method increases the computational cost of the compression process.The other method is the fixed-length segmentation which is one of the mostly used method in the past literature.In our previous work [27], we employed the fixedlength segmentation method to split ECG signals into short and quasi-periodic segments.In this research work, energy based segmentation method that splits ECG signal into two different lengths according to the energy variation of the signal is utilized to improve the compression performance of the proposed algorithm.This segmentation method divides the ECG frames with high energy into the short segments whose length is 16 samples while the ECG frames with low energy are divided into the long segments whose each contains 64 samples.
When the preprocessing stage is completed, the normalized ECG segments of two different lengths are obtained to construct the VL-CSVES which are explained in detailed in the next subsection.

Construction of the VL-CSEVS
A normalized ECG segment X i obtained in the preprocessing stage can be spanned to a vector space in the following form.
where the V i represents orthonormal vectors in the matrix notation and C i are uncorrelated coefficients such that in which L F is the number of the samples in any ECG segment which is equal to either 16 or 64.Now, any normalized ECG segment X i can be represented as a weighted sum of the orthonormal vectors v ik as follows: (6) This equation may be truncated by taking the first p term.In this case, the approximation X ip and approximation error ε i are given in the following form.
The orthonormal vectors v ik are determined by minimizing the expected vector of the error vector i with respect to v ik in the LMS sense.Eventually, these vectors which are represented by v ik are the eigenvectors of the autocorrelation matrix R i of the X i segment.The autocorrelation matrix R i can be calculated as follows The entries of the matrix R i are computed by x j+1 x j+1+d (10) The above mentioned LMS process results in the eigenvalue problem.Hence, the eigenvectors v ik of the autocorrelation matrix R i and the corresponding eigenvalues l ik are found by solving Since the autocorrelation matrix R i is a positive semidefinite, real-symmetrical and toeplitz matrix, the eigenvalues l ik are real and non-negative and the eigenvectors v ik are all orthonormal.
The eigenvectors v ik can be arranged according to the descending order of the magnitude of their corresponding eigenvalues l ik .
In this case, the eigenvectors v i1 that have the highest energy associated with the highest magnitude of the eigenvalue represents the direction of the greatest variation of the signal and they are also called signature vectors.The signature vector may approximate each segment that belongs to the original ECG.Therefore, each segment X i is represented as follows Once the approximation ( 13) is obtained, it can be converted into the equality by means of an envelope diagonal matrix A i for each segment.Thus, X i is calculated by (14) In ( 14), the diagonal components a ir of the matrix A i are computed in terms of the components v i1r of the signature vector v i1 and the component x ir of the segment vector X i by following simple division.
x ir c i1 v i1r (15) In this research work, many ECG signals were examined and thousands of segments which contain either 16 or 64 samples were analyzed.After the generation of all of the signature and the envelope vectors employing the procedure given above, these vectors were plotted.It has been observed that there were a lot of signature vectors similar to each other.This type of repetitive similarity properties have also observed among the envelope vectors.The vectors in the signature and envelope side were clustered by using an effective k-means clustering algorithm [1] and the centroid vectors of each cluster were determined for these two vector types.These centroid vectors are called as classified signature vectors and classified envelope vectors.The block diagram that explains this procedure is given in Figure 1.
After determination of the centroid vectors for each cluster of the signature and envelope vectors, two types of sets were constructed by using these centroid vectors.The centroid vectors obtained from the signature vectors and the envelope vectors are renamed as classified signature vectors (CSV) and classified envelope vectors (CEV), respectively.The CSVs are collected under either the classified signature set-16 (CSS 16 ) or the Classified Signature Set-64 (CSS 64 ) according to their segment length.The CSVs are represented by Ψ NS (n); NS = 1, 2, ..., R, ..., N S .The integer n represents total number of samples in the each CSV while the integer N S designates the total number of the CSVs in the CCS 16 and CCS 64 , individually.In the same way, the CEVs are collected under either the CES 16 or the CES 64 according to their segment length.The CEVs are represented by F NE (n); NE = 1, 2, ..., K, ..., N E .The integer n represents total number of samples in the each CEV while the integer N E denotes the number of the CEVs in the CES 16 and CES 64 , individually.Afterwards, CSS 16 , CES 16 , CSS 64 , and CES 64 are collected in the VL-CSEVS.Details of the reconstruction process of measured ECG signals by means of VL-CSEVS are given step by step in the following subsection.

Reconstruction process of ECG signals by using VL-CSEVS
The reconstruction process of the proposed method consists of two operations: encoding and decoding.The block diagrams of the encoders and decoders are given in Figures 2 and 3, respectively, which are explained step by step in next subsections.

Encoder
Step 1: The original ECG signal is first normalized, and then it is segmented in the pre-processing stage.If the segment length is 16 the switch-codebook bit b SWCB is assigned as 1.Otherwise, b SWCB is equal to 0.
Step 2a: An appropriate CSV from either CSS 16 or CSS 64 according to the value of b SWCB is pulled out such as the error which is given below is minimized for all R = 1, 2, . . ., R, . . ., N s .
Step 2b: The index number R that refers to CSV is stored.
Step 3a: An appropriate CEV from either CES 16 or CES 64 according to the value of b SWCB is pulled out  such as the error shown below is minimized for all K = 1, 2, . . ., K, . . ., N E .
Step 3b: The index number K that refers to CEV is stored.
Step 4: A new gain coefficient factor C i is replaced by C R by computing as follows, so that the global error given in ( 19) is minimized.
Step 5: At this step, the segment X Ai is approximated by Step 6: The above steps is repeated to determine the model parameters R, K, and C i for each segment of ECG signal and X rec is reconstructed.
Step 7: Residual error is figured out by subtracting Step 8: The residual error is down-sampled by two using cubic spline interpolation technique and three-level discrete wavelet transform using Biorthogonal wavelet (Bior 4.4) is applied to the down-sampled residual signal.
Step 9: The modified two-role encoder [22] is employed for coding the obtained wavelet coefficient, and thus, the encoded residual bit stream is obtained.
Step 10: Encoded bit stream of the index number of R is obtained by using Huffman coding.
Step 11: Encoded bit stream of the index number of K is obtained by using Huffman coding.
Step12: The new gain coefficients C i are coded by using 6 bits.

Decoder
Step 1: The encoded bit stream of the index number of R and K are decoded by using Huffman decoder.Step 2: For each segment, the index number of R and K are used to pull out the appropriate CSV and CEV from the VL-CSEVS according to the switch-codebook bit b SWCB .
Step 3: The each segment X Ai is approximated by the following mathematical formula Step 4: The reconstructed ECG signal X rec is produced by Step 5: The encoded bit stream of the residual signal is decoded by using the modified two-role decoder [22].
Step 6: The reconstructed residual signal err rec is produced by applying the inverse WT and up-sampling process by a factor of two, respectively.
Step 7: In the final step, the reconstruction process of the ECG signal is accomplished by adding the reconstructed residual signal to the reconstructed ECG signal as follows.
In the following section, the simulation results for the proposed compression algorithm are presented.

Evaluation metrics to measure the performance of the proposed compression algorithm
The performance of the proposed ECG compression algorithm and those given in [21,22,25] are evaluated by using two criteria which are the CR and distortion error.The CR is defined as the ratio between the number of the bits required to represent the original and reconstructed signals [30].This ratio is given by where b org and b rec represent the number of the bits required for the original and recon-structed signals, respectively.
However, the exact compression performance of the proposed method can only be analyzed when the CR is combined with the distortion error [30].The distortion error is usually considered to be the percentage rootmean-square differences (PRD) defined by where x org (n) refers to the original signal, x rec (n) denotes the reconstructed signal and N represents the length of the frame.
Since the distortion error basically depends on the mean value of the original signal, it can be masked the real performance of a compression algorithm.Therefore, the MPRD, which is totally independent of the mean value of the original signal, is suggested to be used to test the real performance of a compression algorithm.The MPRD is defined by where x denotes the mean value of the original signal [30].
It is well known in the literature that the PRD error measures the global quality of the reconstructed signal.In order to assess the real performance of the compression algorithm, not only the global error but also the local distortion must be examined.The local distortion indicates the distribution of the error along with the reconstructed signal and can be determined by using the MAXERR definition which is defined by All of the evaluation criteria explained above are employed in our experiments.We will compare the results of our algorithm with the results of the algorithms given [21,22,25] as far as the above mentioned evaluation criteria are concerned.

Mean opinion score test
In order to evaluate the performance of the proposed algorithm from clinical point of view, we use the test method of Mean Opinion Score (MOS) whose test parameters are given in Table 1, which is similar to test presented in [31].In Table 1, in section A, the cardiologist is asked to give a score value ranging from 1 to 5 in order to determine the similarity between the original and reconstructed signals.In section B, the cardiologist is asked to determine whether one can make a different diagnosis using the reconstructed version of the original signal without seeing the original signal.The process of section A is repeated for the important segment QRS and two critical waves P and T of the original and reconstructed version of the signals in section C.
The results of the MOS test are analyzed by using the two different distortion measures: MOS ERROR and Segmentation based MOS (SMOS).The MOS ERROR which is defined for a single reconstructed signal in [31] is expressed as follows: where a, an integer ranging from 1 to 5, is the measure of the similarity between the original and reconstructed signals.b is the answer to section B related to the diagnosis.If the answer is YES, b is equal to 0, otherwise, b is equal to 1 [31].
The SMOS defined as the second distortion measure shows the similarity between the important segment and waves of the original and reconstructed ECG signals specifically QRS segment, P and T waves.In this test, SMOS is determined for QRS segment, P and T waves, separately.The results obtained for each segment of the signal are represented by SMOS QRS , SMOS P , and SMOS T , respectively.We should point out here that the lower values of the MOS ERROR represent the better signal quality while the higher values of SMOS indicate the better signal quality.

Experimental results and comparisons
The compression algorithm explained in the previous section was first run in Matlab 7.0.1 platform, and then it was tested with ECG recordings on an Intel Core2 Quad 2.66 GHz processor.In order to evaluate the performance of the proposed compression algorithm, MIT-BIH Arrhythmia Database [32] and MIT-BIH Compression Test Database [15] were used in this research work.The MIT-BIH Arrhythmia Database consists of 48 ECG recordings which are sampled at 360 Hz and quantized at 11-bit resolution [32].On the other hand, the MIT-BIH Compression Test Database consists of 168 ECG recordings.Each data in this database is sampled at 250 Hz and quantized at 12-bit resolution [15].Each record in both database was first resampled at 500 Hz by using a cubic spline interpolation technique, and then the amplitudes of these records were normalized between 0 and 1.
The selection of the appropriate database is very important in order to construct the VL-CSEVS.The MIT-BIH arrhythmia database was selected as the training set because it contains a large set of ECG beats and many different examples of cardiac pathologies.Then, VL-CSEVS having the unique patterns were generated by analyzing a huge number of the ECG segments obtained from this database.
In the construction of the VL-CSEVS, 4-fold crossvalidation method was employed in order to remove the biasing effect.After the preprocessing stage, four different segments with a length of 6.4 s were extracted from each ECG recording in the MIT-BIH Arrhythmia Database.The group of the first segments were collected in the Subset-1.Similarly, Subsets-2, 3, and 4 were formed by the group of the second segments, the group of the third segments, and the group of the fourth segments, respectively.Thus, the four subsets S1, S2, S3, and S4 of the equal sizes were constituted.In other words, one subset was used as the test set and the remaining subsets were employed as the training sets for each round.Thus, each subset was used exactly once as the test set.In the first round, while Subset-1 was used as the test set, Subsets-2, 3, and 4 were employed as the training sets; in the second round, Subset-2 was the test set while Subsets-1, 3, and 4 were the training sets; and so on.After all these training, VL-CSEVS given in Table 2 were constructed for each round.In this table, b SWCB refers to the switch-codebook bit that controls the length of an incoming segment.b Ci , b R , b K are the minimum numbers of the bits required to represent the gain coefficient C i , and the integers N S and N E , respectively.
The performance of the proposed compression algorithm with respect to PRD, MAXERR, and CR was evaluated for each round and shown in Figure 4.The variation of PRD and MAXERR with CR at each round for the proposed compression algorithm was illustrated in Figures 4a, b, respectively.Besides, the mean performance of the results given in Figure 4 was presented in Table 3.
The proposed compression algorithm achieves the average CRs from 4:1 to 20:1 with average PRD a varies between 1.2 and 5.6%.Since the acceptable values of PRD were reported to be less than 9% in the literature [31], it can be emphasized that the results obtained in the proposed compression algorithm provide high CR with very low PRD levels.Furthermore, the average encoding and decoding times of the proposed compression algorithm are 0.687 and 0.318 s, respectively.
In this experimental research work, the proposed algorithm was compared with three well-known successful ECG compression methods SPIHT [21], Blanco-Valesco et al. [25], and Benzid et al. [22] in terms of average PRD, average MPRD, and average CR.In order to carry out a precise comparison among the proposed algorithm and other ECG compression methods given in [21,22,25], the same test dataset has been used for all these methods.This dataset contains 11 recorded ECG signals received from the MIT-BIH arrhythmia database (records: 100, 101, 102, 103, 107, 109, 111, 115, 117, 118, and 119).The comparison between our proposed method and the SPIHT [21] in terms of the average PRD and CR is illustrated in Figure 5.The comparison between our proposed algorithm and the Blanco-Valesco et al. [25] is given in Figures 6 and 7. Figure 6 depicts the variation of the average PRD with respect to the average CR and Figure 7 shows the variation of the average MPRD with respect to the average CR.Finally, a comparison between our results and those obtained by Benzid et al. [22] is given in Figure 8  In order to evaluate the worst case performance of the unique VL-CSEVS formed by using the MIT-BIH Arrhythmia Database, the proposed algorithm was also tested on the ECG signals received from the MIT-BIH Compression Test Database which is called the worst case test database by its developers [15].It should be noted that the sampling frequency, resolution, mean value, and amplitude value of the ECG signals in this database are completely different from those of the ECG signals in the MIT-BIH Arrhythmia Database which is used to construct the unique VL-CSEVS.The mean values of the results obtained at each round in the worst case analysis are presented in Table 4.The comparative results between the proposed algorithm, our previous method [27] and Hilton [15] are depicted in Figure 9.
As it can be seen from Table 4, the proposed algorithm achieves the average CRs from 4:1 to 20:1 with an average MPRD in the range of 1.627-8.631%.Moreover, Table 2 The number of CSV, CEV, and the required total bit in the VL-CSEVS the MAXERR, representing the local distortion, varies between 1.015 and 4.209%.Furthermore, the average encoding and decoding times of the proposed algorithm are 0.619 and 0.279 s, respectively.Figure 9 shows that the compression performance of our previous method mentioned in [27] is significantly improved by employing the VL-CSEVS in this research work.Also, it is clearly seen from Figure 9 that the compression performance of the proposed algorithm is significantly better than the results given in Hilton [15] in the light of the MPRD.
It is important to note that in Hilton [15], the PRD was used as the distortion measure.Although the PRD results are always smaller than the MPRD results due to the mean value of the signal, MPRD results obtained in the proposed algorithm are smaller than the PRD results obtained in Hilton [15].
In addition to the results of the objective evaluation methods given in Tables 3 and 4, several original ECG signals randomly chosen from test database and their reconstructed versions are displayed in Figures 10,11,12, 13 and 14 to reveal the visual quality of the ECG signals which are reconstructed by using the proposed compression algorithm.In Figures 10 and 11, the ECG records 118 and 117 which are randomly selected from the MIT-BIH Arrhythmia Database and their reconstructed versions along with the information of the CR, PRD, and MAXERRR are presented, respectively.Similarly, two different original ECG signals which are randomly selected from the MIT-BIH Compression Test Database and their reconstructed versions along with the information of the CR, MPRD, and MAXERRR are presented in Figures 12 and 13, respectively.As it can be clearly seen from these figures, both the morphological features of ECG signals are well preserved.

Clinical evaluation and discussion
In the clinical evaluation of our results, we have used 11 original ECG signals from the MIT-BIH Arrhythmia Dataset and 11 original ECG signals from the MIT-BIH  Compression Test Database.These 22 original ECG signals were reconstructed at 4:1, 6:1, 8:1, 10:1, 12:1, 14:1, 16:1, 18:1, and 20:1 CRs by using our proposed method.As a result, these 22 original and 198 reconstructed ECG signals were evaluated by the cardiologists in order to validate the performance of the proposed algorithm from clinical point of view.
In the first step of the clinical evaluation, the cardiologist b expressed his opinions by examining these original and reconstructed ECG signals without applying any test.He explained that, the onset, off set and duration of the segments (or intervals) of the ECG signals such as PR, QRS, ST are correctly determined in the reconstructed or compressed ECG signals obtained by the proposed algorithm also at 20:1 CR.He pointed out that the proposed algorithm provides the nearly perfect reconstruction of the QRS segments at 20:1 CR.Although the p-wave and t-wave of the reconstructed ECG signals have more reconstruction error than the QRS segments of the reconstructed ECG signals, these distortions are not critically important in terms of diagnosis.He also explained that the quality of the reconstructed ECG signals is also acceptable at low bit rates.
On the other hand, he also emphasized that, it is very difficult to obtain high CRs with low reconstruction errors in the compression of the Holter ECG's or Stress ECG's which are recorded during movement or exercise, since these types of ECG records contain more variation or artifacts compared with ECG signals recorded in the resting mode.Therefore, the CR has to be selected by the cardiologists to ensure the clinical information depending on the ECG signal being compressed.In this context, it is an important advantage that the CR of the proposed algorithm can be adjusted easily according to the desired CR starting at 1 to 20 or higher.
Furthermore, an average opinion score is requested from the cardiologist in order to determine the clinical quality of the reconstructed ECG signals and he rated the clinical quality of the proposed compression algorithm at 20:1 CR as 4 over 5.As a result, the clinical operational range of the proposed compression algorithm is up to 20:1 CR.
In the second step of the clinical evaluation of the results obtained by our proposed method, the MOS test given in Table 1 has been applied to the original and reconstructed ECG signals by the cardiologist.c Then, the results of the MOS test were analyzed by means of MOS, SMOS QRS , SMOS T , SMOS P and MOS ERROR which are shown in Table 5.The variations of the MOS, SMOS QRS , SMOS T , and SMOS P with respect to the CR are also given in Figure 14.
When analyzing the values of MOS given in Table 5, it is clearly seen that the quality of all reconstructed ECG signals is acceptable also at the CR of 20:1.Furthermore, the results of SMOS QRS show that the proposed compression algorithm provides nearly perfect reconstruction of the QRS segments of the reconstructed ECG signals also at the CR of 20:1.In the light of the results of the MOS and SMOS QRS , the cardiologist pointed out that the proposed compression algorithm provides the useful CRs ranging from 4:1 to 20:1.On the other hand, the results of the SMOS T and SMOS P are lower in comparison with the results of SMOS QRS as shown in Figure 14.This is an expected result since the proposed compression algorithm further compresses the ECG segments with low energy in comparison with the ECG segments with high energy.
In order to analyze the values of both MOS and SMOS given in Table 5 in terms of diagnostic accuracy, we have employed the MOS ERROR .It was reported in [31] that the reconstructed signal quality can be classified into four different quality groups by using the   CR without losing any diagnostic information.The other three are compressed at 18:1, 14:1, and 12:1, respectively, without losing any diagnostic information.
In conclusion, the ranges of the utility of the proposed compression algorithm are from 4:1 to 20:1 CRs depending on the ECG signal to be compressed.

Conclusion
We have introduced an efficient compression algorithm for ECG signals.other ECG compression methods given in [21,22,25].In this work, the VL-CSEVS which have unique patterns are specifically designed for ECG signals by using the relationship between energy variation and clinical information.
In this research work, ECG signals are segmented by using energy based segmentation so that ECG frames which have the high energy are represented by the short segments while the other frames with low energy are represented by the long segments.Therefore, both the size of VL-CSEVS and the computational complexity of the searching and matching process are reduced significantly in comparison with the predefined signature and envelope vector sets proposed in our previous works [26,27].
In conclusion, the CR of the proposed algorithm is significantly improved in comparison with the results of our previous method [27].Besides the good performance in the average CR, the low reconstruction error is ensured by applying the residual error coding.
The performance of the proposed algorithm is evaluated and compared with the three well-known ECG compression methods given in [21,22,25].The results of the performance evaluations show that the proposed algorithm provides the better results than the other methods in terms of the average CR, the average PRD,  the average MPRD, and the MAXERR which are wellknown objective evaluation criteria.Moreover, the computational complexity of the proposed algorithm is also very low so that the average encoding and decoding times are almost 0.7 and 0.3 s, respectively.
In the experiments, the 4-fold cross-validation is employed to expose the relationship between the CR and PRD at different levels.The results obtained at each round show that there is almost no change in the PRD levels which correspond the same CR values.Furthermore, the performance of the VL-CSEVS is also tested on the ECG signals from a different database which is called as MIT-BIH compression test database.During the experiments, we observed some small differences in the PRD levels at the same CR values in the worst-case condition employing the MIT-BIH compression test database.These experimental results show that the proposed algorithm does not need any adaption process to reconstruct any ECG signals which have different characteristics.That is to say, the proposed VL-CSEVS do not require to re-created specifically for an ECG database so that the VL-CSEVS are constructed from the unique patterns extracted by examining many of thousands ECG segments and they are fixed.
We finally point out that the generation of the VL-CSEVS is carried out off-line and the unique VL-CSEVS are fixed and located at the receiver side of the system.In other words, the unique VL-CSEVS do not required to be redesigned in order to compress and reconstruct any ECG signal.On the other hand, the encoding and decoding parts of the proposed method are on-line procedures.When the average encoding and decoding times are analyzed it can be said that the proposed method is appropriate for real-time applications.

Endnotes
a Each signal in the MIT-BIH Arrhythmia Database included a baseline of 1024 added for storage purposes.Consequently, the PRD which is given in (27) is worked out by subtracting 1024 from each data sample.b The

Figure 1
Figure 1 The block diagram of the construction of the VL-CSEVS.

Figure 2
Figure 2 The block diagram of the encoder part of the proposed algorithm.

Figure 3
Figure 3 The block diagram of the decoder part of the proposed algorithm.
which compare the average PRD and average CR obtained by both methods.When analyzing the results illustrated in Figures 5, 6, 7 and 8, it can be clearly seen from these figures that the proposed compression algorithm outperforms the compared methods especially at low bit rates.

Figure 4
Figure 4 The performance of the proposed algorithm by means of CR, PRD, and MAXERR: (a) The variation of the average PRD with respect to the CR; (b) The variation of the average MAXERR with respect to the CR.

Figure 5
Figure 5 Comparison of the proposed algorithm with SPIHT in terms of average PRD and CR.

Figure 6 Figure 7
Figure 6 Comparison of the proposed algorithm with Blanco-Valesco in terms of average PRD and CR.

Figure 8
Figure 8 Comparison of the proposed algorithm with Benzid in terms of average PRD and CR.

Figure 9 Figure 10
Figure9Comparison of the proposed algorithm with our previous method and Hilton in terms of average MPRD and CR.

Figure 14
Figure 14  The variation of the average MOS, SMOS QRS , SMOS T , and SMOS P with respect to the CR.

Figure 15
Figure 15 The clinical evaluation of the proposed compression algorithm by means of MOS ERROR , CR, and PRD: (a) The variation of the average MOS ERROR with respect to the CR; (b) The variation of the average MOS ERROR with respect to the PRD.

Table 1
The MOS test ECG Signal Name:#### A. The measure of similarity between the original ECG signal and reconstructed ECG signal.

Table 3
The performance of the proposed algorithm tested on the MIT-BIH Arrhythmia Database with respect to average CR, PRD, MAXERR, encoding end decoding time

Table 4
The performance of the proposed algorithm tested on the MIT-BIH Compression Test Database with respect to average CR, MPRD, MAXERR, encoding and decoding times MOS ERROR .The reconstructed signal quality is classified to be very good for the values of MOS ERROR between 0 and 15%.If the value of MOS ERROR is between 15 and 35%, the reconstructed signal quality is determined to be good.The reconstructed signal quality is assigned not good if the value of MOS ERROR is between 35 and 50%.When the value of MOS ERROR is greater than 50%, the reconstructed signal quality is assumed to be bad.The variation of average MOS ERROR given inTable 5 with respect to the CR and PRD was illustrated in Figures 15a, b, respectively.When analyzing the results of the MOS ERROR , we have observed that 71.85% of the all reconstructed ECG signals is in the very good quality group while 21.05% of the all reconstructed ECG signals is in the good quality group.On the other hand, the rest of the reconstructed ECG signals has the values of MOS ERROR which are greater than 35%.As seen from Table6, the clinical test proved that the proposed compression algorithm achieves to compress 16 of 22 original ECG signals, used in the clinical evaluation, at 20:1 CR by preserving the diagnostic information.The three of these signals are compressed at 16:1

Table 5
The average results of the clinical test of the proposed compression algorithm with respect to the CR, MOS, SMOS QRS , SMOS T , SMOS P , and MOS ERROR

Table 6
The diagnostic performance of the proposed compression algorithm for the original ECG signals used in the clinical test clinical evaluation was carried out by Prof. Osman Akdemir who is a cardiologist in the Department of Cardiology at the T.C. Maltepe University, Istanbul Turkey.c The clinical test was carried out by Dr. Ruken Bengi Bakal who is a cardiologist in the Department of Cardiology at the Kartal Kosuyolu Yuksek Ihtisas Education and Research Hospital, Istanbul, Turkey.