XV International PhD Workshop OWD 03, 9 October 03 The Use of Wavelet Analysis to Denoising of Electrocardiography Signal. Dawid Gradolewski, Grzegorz Redlarski, Gdansk University of Technology Abstract The electrocardiography examination, due to its accessibility and simplicity, has an important role in diagnostics of the heart ailments. It enables quick detection of various heart defects, undetectable by other kinds of diagnostic tools, so it is very popular. Nevertheless, the measured signal is exposed to a different disturbances. Among them, the electromagnetic interferences, drift of reference electrode and high frequency noises occurring during the measure, should be included. The frequencies spectrum of the noise overlap the spectrum of the electrocardiography signal, which makes impossible to use a classical filters. In the human s diagnosis, a high quality of the signal is of a great importance. Therefore, in this paper, an optimal wavelet denoising algorithm for electrocardiography signal is presented. The simulation shows that the use of wavelet analysis during the filtration process allows to remove effectively the noise from the electrocardiography signal, without losing an important information and also improves the quality of the signal. To obtain an unambiguous evaluation of wavelet denoising algorithms the signal-to-noiseratio (SNR), mean square error (MSE), and correlation coefficient were used simultaneously. What is more, a fit coefficient, determining the relation between original and denoised signal, were developed. The best results were achieved with coif5 wavelet basis with 7 decomposition level, heursure thresholding algorithm and sln rescaling function.. Introduction Failures of cardiovascular system are still the main cause of people death all over the world []. This causes the increase in scientist s interest in developing an efficient auto-diagnosis method for heart pathologies detection. One of the first method used in medical diagnosis is electrocardiography (EKG). However, this method is vulnerable to various disturbances. The frequency spectrum of this disturbances overlap the spectrum of EKG signal which makes the problem even more complex. The first step to build a productive auto-diagnosis system is to develop an effective denoising algorithm.. A Survey of related work There were several attempts to develop an effective denoising system of electrocardiography signal. In order to determine a suitable filtering algorithm the following options were applied: the notch filter [], an adaptive filtering [3], mean shift algorithm [4], empirical mode decomposition [5 7] and Hilbert-Huang transform [8]. However, a wavelet based approach gives the most encouraging results and is the most popular one [ 7]. In 990 s, Donoho, Picard and Kerkyachaian found the way to remove the white noise from the signal with the use of wavelet transform [9, 0]. Since that time, with various results, wavelet denoising algorithm have been applied to various signals. Among them a phonocardiography [0, ] and an electrocardiography [ 7] signals should be considered as the most complex, due to their nonstationary and dynamic character. The results of searching the best wavelet denoising algorithm of electrocardiography signal are varied. One of the first study was carried out by Ercelebi, who developed a lifting-based discrete wavelet transform and level-dependent threshold estimator on the signal corrupted by muscle artifacts, electrode motion and Gaussian noise []. In this study, Haar, Daubechies 4 (DB 4), and DB 6 wavelets basis, with 4th decomposition level gave the best results []. The study about an optimal selection of wavelet basis function was carried out by Singh and Tiwari [3]. The best results were obtained with the use of Daubechies mother family wavelet of the order 8 [3]. A chose of an optimum wavelet basis to denoise of an ECG signal were studied by the BestWaveID system developed by Tan et al [4]. Authors exanimated 5 wavelet basis function by three different levels of Gaussian noise (SNR of 6, 0 and db). In results, they determined wavelet coif 5 as the best removing noise [4]. The Symlet 4 with 5 decomposition level and hard shrinkage function with empirical Bayesian threshold were the most appropriate in the study carried out by Suyi and Lin [5]. A chose of the best wavelet tresholding algorithm on the real and synthetic signal,
decomposed by stationary wavelet transform was made by Isa, Noviyanto and Arymurthy [6]. The results shown that with the use of coif wavelet basis, the universal hard tresholding algorithm for synthetic and real signals is the most efficient [6]. Discrete Wavelet Transform (DWT) in denoising of ECG signal, were applied by Karthikeyan, Murugappan, and Yaacob [7]. Authors examined three wavelet functions and four tresholding rules. The study shows that the wavelet coif 5 and rigrsure threshold rule give the best denoising results [7]. 3. Problem statement One of the main obstacles in a development of effective auto-diagnosis system for electrocardiography signal is the noise which interfere with the measured signal. The most common method used in the filtration process is wavelet denoising algorithm. However, conducted researches were ambiguous [ 7] and so far no clear answer to the question about the best parameters of wavelet denoising algorithm has been found. The main contribution of this paper is unambiguous evaluation of wavelet denoising algorithms. In this purpose, the signal-to-noise-ratio (SNR), mean square error (MSE), and correlation coefficient, were used. What is more, a fit coefficient, determining the relation between original and denoised signal, were developed. Through the comparative study the best parameters of wavelet denoising algorithm were determined (the wavelet basis, decomposition level, threshold selection algorithm and rescaling function). 4. Wavelet denoising theory The wavelet denoising algorithm bases on the fact that some of the decomposed coefficient are associated with the clear signal, while others are connected with the mean value of the noise. Therefore, if unimportant coefficient associated with the noise will be removed, the signal can be reconstructed without loss of any data. The issue is to determine correctly the threshold defining the coefficients to remove [0, ]. To obtain the thresholds properly, each of the parameters (the wavelet basis, the threshold selection algorithm, rescaling function and decomposition level) should be determined thoughtfully [0, ]. There are several wavelet families available. To avoid the unnecessary loss of important information during the reconstruction process only the orthogonal wavelet was considered. The wavelet is orthogonal only if each of the wavelet basis is shifted by 90 in relation to each other [0, ]. The study was limited to the wavelet basis, pointed as the best chose in the previous study [ 7], which are: the Haar, DB 4, DB 6, DB 8, coif, coif 5 and Symlet 4. On the figure the comparison of wavelet basis with the synthetic ECG signal is presented. The best results of filtration process were observed to wavelet basis similar to the original signal [0, ]. Further task of the great importance is the determination of the thresholds selection algorithm. In the Matlab wavelet toolbox are available four different algorithms, presented in the table. Name Rigrsure Sqtwolog Heursure Minima Threshold selection rules [0, ] Description: Tab.. Adaptive threshold selection using principle of Stein's Unbiased Risk Estimate (SURE) Threshold is equal to the square root of the two decimal logarithms of the signal length (X). Heuristic variant of above options Minimax thresholding principle Fig.. The comparison of different wavelet basis function determined in the previous studies [-7] with the synthetic electrocardiography signal
The Rigsure method bases on the principle of Stein s unbiased risk estimate (SURE). For certain x 0 the risk estimate of its threshold is calculated, and future it s minimalized by changing x. The second method Sqtwolog, uses constant value of the threshold, which is equal to the square root of the two decimal logarithms of the signal length (X) T = log( length ( X )) () The third method Heursure is the combination of the two previous. While SNR is low and the SURE estimate is noised, then the Sqtwolog threshold algorithm is used. Otherwise, the Rigsure method is applied. The last method Minima, uses the constant value of the threshold, determined according minima principle the minimum value from the mamum mean square error [0]. The filtration process, bases on the noise model described by following equation S ( n) = f ( n) + σe( n) () where, S is the recorded signal, f the signal without the nosie and e is the noise. Strength of the noise is defined as σ and n is value randomly distributed [0, ]. The issue of the filtration process is removal of the signal disturbance e. Due to remove the noise properly, three different threshold rescaling functions of the wavelet denoising algorithm defining in Matlab toolbox, are considered: one bases on the white noise model, described in equation ; sln bases on the basic noise model and uses unscaled white noise algorithm with a single estimation of the noise level (based on the first decomposition level); mln bases on the noise model with a non-white noise algorithm. 5. Simulations In order to determine the best denoising algorithm, into clear, synthetic electrocardiography signal a various doses of a uncorrelated Gaussian white noise, were added (which for the signal-tonoise ratio of 5dB is presented on the figure ). Fig.. The Clean and Noised (with added SNR of 5 db uncorrelated white noise) electrocardiography signal In order to evaluate unambiguously the denoising process the signal-to-noise ratio (equation 3), correlation coefficient (equation 4) and mean square error (equation 5), were used. Signal-to-noise ratio is calculated as a relation between the denoised signal and removed noise ds noise σ SNR = 0 log 0 (3) σ where, σ ds is the variation of the denoised signal and σ noise is the variation of the removed noise. The correlation coefficient and mean square error, are defined as a relation between noise free signal f and denoised signal f, n is the length of the signal C ( f, f ) R ( i, j) = (4) C ( f, f ) C ( f, f f ) n MSE = ( f (5) n i= In addition, in equation 6 is developed a fit coefficient which provides an important information about morphological changes between clear f and denoised f signals. n [ f( ) f( )] i= fit = 00 (6) n n f( ) f( ) i= n i= ) Tab.. The results of wavelet denoising algorithm for different wavelet basis function four decomposition level, heursure threshold selection algorithm and one rescaling function Name of Correlation SNR [db] MSE Fit Coefficient [%] wavelet basis Coefficient Power of added Noise [db]: 5 0 5 0 5 0 5 0 Haar 0.05 0.5.3 0.99 0.98 0.96 0.000 0.0008 0.008 99.5 97.8 9.4 DB 4 0.054 0.5.4 0.99 0.99 0.97 0 0.0003 0.000 99.9 99. 94.6 DB 6 0.05 0.5.4 0.99 0.99 0.97 0 0.0003 0.009 99.9 99. 94.9 DB 8 0.055 0.5.4 0.99 0.99 0.97 0 0.0003 0.000 99.9 99. 94.6 Coif 0.05 0.5.5 0.99 0.98 0.96 0.000 0.0008 0.008 99.8 98.9 94.3 Coif 5 0.055 0.53.7 0.99 0.99 0.97 0 0.000 0.006 99.9 99.3 95 Sym 4 0.054 0.5.4 0.99 0.99 0.98 0 0.0003 0.00 99.9 99. 94.4 3
Results for different levels of the decomposition, with the use of wavelet basis coif 5, heursure threshold selection algorithm and one rescaling function Level of the Correlation SNR [db] MSE Fit Norm [%] decomposition Coefficient Power of added Noise [db] 5 0 5 5 0 5 5 0 5 5 0 5 0,4038,583 3,343 0,9835 0,949 0,806 0,00 0,006 0,099 96,64 83,3 46,464 3 0,479,8895 3,887 0,996 0,967 0,8894 0,0006 0,0030 0,0099 98,304 9,845 73,376 4 0,5070,0344 4,3879 0,9957 0,9795 0,9375 0,0003 0,005 0,005 99,40 95,769 86,09 5 0,58,733 4,769 0,9958 0,9858 0,965 0,0003 0,000 0,009 99,66 97,5 9,6 6 0,56,74 4,7370 0,996 0,9865 0,9655 0,000 0,000 0,006 99, 97,50 9,844 7 0,569,543 4,7643 0,996 0,9865 0,9677 0,000 0,0009 0,004 99, 97,339 93,380 8 0,545,500 4,6675 0,9959 0,986 0,9665 0,0003 0,000 0,006 99,86 97,9 9,98 9 0,57,68 4,6348 0,996 0,9860 0,964 0,000 0,000 0,008 99, 97,88 9,45 0 0,593,665 4,794 0,9959 0,9865 0,9677 0,0003 0,0009 0,004 99,84 97,340 93, The defined coefficient (named fit coefficient), fluctuates from 0% (while the signals are totally mismatch) to 00% (for a perfect fit). In the table are presented the results of wavelet denoising algorithms for different wavelet basis functions. The decomposition was made at the four levels and a threshold was selected with the use of heursure algorithm and rescaled with one function. A noise with SNR of, 5 and 0 db s was added to a clear signal. It can be easily observed, that coif 5 wavelet basis removes the noise most effectively, it have the lowest MSE and the highest fit coefficient and SNR for the each dose of noise. What is more, slightly better correlation coefficient to noise of 0 db s gives symlet 4 wavelet basis. However, for lower doses of noise wavelet coif 5 is better. Haar wavelet basis is the worst of all removing noise wavelet. Tab.3. In the table 3 are presented the results for different decomposition levels. The decomposition was made with coif 5 wavelet basis and threshold was selected with the use of heursure algorithm and with one rescaling function. To a clear signal was added a noise with SNR of 5, 0 and 5 db s. The best results were obtained to the 7 decomposition level. It can be observed, that all of indicators for the signal with the noise of 5 db s give the best results to 7 decomposition level. What is more, the correlation coefficient and MSE in all doses of noise, give the best results to the 7 decomposition level. The worst results are obtained to 5 levels of the decomposition. The figure 3 presents the results of denoising process for various thresholding algorithm. Decomposition was made with the use of coif 5 on 7 Fig.3. The results of denoising process for different thresholding algorithm. The decomposition was made on the 7 level with coif 5 wavelet basis and one rescaling function 4
Fig.4. The results of denosising process for different rescaling functions. The decomposition was made on the 7th level with coif 5 wavelet basis and heursure tresholding function decomposition level. It can be noticed, that the worst removing noise threshold selection algorithm is rigsure, while the best results were obtained with the heursure method. Only signal to noise ratio gives better results to the sqtwlog method, but here the heursure is the second choice. On the figure 4 is showed the comparison of the rescaling functions. The worst results were obtained with the one rescaling function. The results from mln and sln rescaling functions are very similar and only the fit coefficient indicate the advantage of sln rescaling functions. On the figure 5 are presented the final results of the denoising process based of wavelet transform. The efficiency of wavelet denoising process can be easily charted. The denoised and clean electrocardiography signals are very similar and both waveforms are overlapping (part b of the figure 5). In fact, only the small amount of a high frequency noise still remains in the denoised signal, but it can be easily removed by the low pas filter. Fig.5. Final results of the wavelet based denoising process. The results were obtained with the use of coif 5 wavelet basis on the 7th decomposition level and with the use of heursure thresholding function and sln rescaling function (a clear and noised EKG signals, b denoised and clean EKG signals, c noise removed during filtration) 6. Conclusions The best results of wavelet denoising algorithm were found. That is the coif 5 wavelet basis, 7 decomposition level, heursure thresholding function and sln rescaling function. By the comparative analysis of correlation coefficient, signal to noise ratio, mean square error and fit coefficient, a unambiguous evaluation of various algorithms, could be conducted. One of the most important advantages of the wavelet based denoising process is the possibility to process a recorded signal. So, no additional devices are needed. In the future it may enable a realization of a medical examination, for example by the smartphones. That should increase the patient s comfort, for example during Holter study. 5
[3] Singh, Brij N., and Arvind K. Tiwari. "Optimal selection of wavelet basis function applied to ECG signal denoising." Digital Signal Processing 6.3 (006): 75-87. [4] Tan, H.G.R.; Tan, A. C.; Khong, P. Y.; Mok, V. H., "Best Wavelet Function Identification System for ECG signal denoise applications," Intelligent and Advanced Systems, 007. ICIAS 007. International Conference on, vol., no., pp.63,634, 5-8 Nov. 007 [5] Li, Suyi, and Jun Lin. "The optimal de-noising algorithm for ECG using stationary wavelet transform." Computer Science and Information Engineering, 009 WRI World Congress on. Vol. 6. IEEE, 009. [6] Isa, Sani M., Ary Noviyanto, and Aniati Murni Arymurthy. "Optimal selection of wavelet thresholding algorithm for ECG signal denoising." Advanced Computer Science and Information System (ICACSIS), 0 International Conference on. IEEE, 0 [7] Karthikeyan, P., M. Murugappan, and S. Yaacob. "ECG signal denoising using wavelet thresholding technique in human stress assessment." International Journal on Electrical Engineering and Informatics 4. (0). Bibliography [] European Commission Eurostat, Causes of death statistics (available: http://epp.eurostat.ec.europa.eu/statistics_expl ained/index.php/causes_of_death_statistics) [] Ying-Wen Bai; Wen-Yang Chu; Chien-Yu Chen; Yi-Ting Lee; Yi-Ching Tsai; ChengHung Tsai, "Adjustable 60Hz noise reduction by a notch filter for ECG signals," Instrumentation and Measurement Technology Conference, 004. IMTC 04. Proceedings of the st IEEE, vol.3, no., pp.706,7 Vol.3, 8-0 May 004 [3] Lu, Guohua, et al. "Removing ECG noise from surface EMG signals using adaptive filtering." Neuroscience letters 46. (009): 4-9. [4] Yan, Jingyu, et al. "Self-adaptive model-based ECG denoising using features extracted by mean shift algorithm." Biomedical Signal Processing and Control 5. (00): 03-3. [5] Chacko, A.; Ari, S., "Denoising of ECG signals using Empirical Mode Decomposition based technique," Advances in Engineering, Science and Management (ICAESM), 0 International Conference on, vol., no., pp.6,9, 30-3 March 0 [6] Guodong Tang; Aina Qin, "ECG De-noising Based on Empirical Mode Decomposition," Young Computer Scientists, 008. ICYCS 008. The 9th International Conference for, vol., no., pp.903,906, 8- Nov. 008 [7] Weng, B.; Blanco-Velasco, M.; Barner, K.E., "Baseline Wander Correction in ECG by the Empirical Mode Decomposition," Bioengineering Conference, 006. Proceedings of the IEEE 3nd Annual Northeast, vol., no., pp.35,36, 006 [8] Changnian Zhang; Xia Li; Mengmeng Zhang, "A novel ECG signal denoising method based on Hilbert-Huang Transform," Computer and Communication Technologies in Agriculture Engineering (CCTAE), 00 International Conference On, vol., no., pp.84,87, -3 June 00 [9] B.B Hubbard, The world According to Wavelets, A K peters Ltd, 89 Linden street, Wellesley, MA 08, 996 [0] Messer, Sheila R., John Agzarian, and Derek Abbott. "Optimal wavelet denoising for phonocardiograms." Microelectronics Journal 3. (00): 93-94. [] Redlarski G., Gardolewski D.: Wavelet Based Denoising Method for Real Phonocardiography Signal. Elektronika Ir Elektrotechnika (in press) [] Ercelebi, Ergun. "Electrocardiogram signals denoising using lifting-based discrete wavelet transform." Computers in Biology and Medicine 34.6 (004): 479-493. Authors: MSc. Dawid Gradolewski Gdansk University of Technology, Faculty of Electrical and Control Engineering ul. Narutowicza / 80-33 Gdansk tel. (58) 347 4-30 email: gradolewski@ely.pg.gda.pl D.Sc. Ph.D. Grzegorz Redlarski, Prof PG Gdansk University of Technology, Faculty of Electrical and Control Engineering ul. Narutowicza / 80-33 Gdansk tel. (58) 347 3-7 email: g.redlarski@ely.pg.gda.pl 6