4,222
Views
23
CrossRef citations to date
0
Altmetric
Research Article

A new modified wavelet-based ECG denoising

, , &

Abstract

Purpose: Wavelet denoising is one of the denoising methods commonly used for ECG signals. However, due to the frequency overlap between the EMG and ECG, the feeble characteristics of ECG signals exists the risk of being weakened in the process of filtering noise. This paper presents a method of modified wavelet design and applies it to the denoising of ECG signals.

Materials and methods: The optimized filter coefficients are obtained by approximating the amplitude-frequency response of the ideal filter, and the wavelet is constructed with the optimized filter coefficients. The algorithm is tested by clinical ECG data.

Results: The results show that the proposed denoising method can remove the high-frequency noise effectively and enhance the characteristic information of P waves and T waves, and retain the characteristic information of the atrial fibrillation signals simultaneously. Compared with db4 and sym4 wavelets, the proposed wavelet can improve the signal to noise ratio and reduce the mean square error effectively at the same time.

Conclusion: The modified wavelet design method proposed in this paper can effectively remove high-frequency noise while retaining and enhancing weak features. It provides a theoretical guidance for the de-noising of ECG signals in mobile medicine and also provides a way for other types of weak feature signal denoising.

1. Introduction

ECG signals, which are the most important bio-electricity signals of the human body, reflect the cardiac electrical activity and other reliable features in various aspects. Therefore, these signals can serve as vital clinical references for the diagnosis and treatment of cardiological diseases. However, noises are inevitable when ECG signals are being collected. The subsequent results would be tampered if those noises are left untreated. The noises in ECG signals generally come from three sources: interference of power frequency, electromyography (EMG) interference, and baseline drift. Among them, EMG denoising is a troublesome problem, because its frequency range is overlapped with ECG’s [Citation1].

EMG is often eliminated as high-frequency noise. Empirical mode decomposition (EMD) [Citation2,Citation3] decomposes the signal into a sum of intrinsic mode functions (IMFs) arranged in order of frequency and then eliminates EMG adaptively. However, the drawback of this method is that the end effects must be restrained effectively to achieve better performance. Digital filtering [Citation4] and adaptive filtering [Citation5,Citation6] have the strong performance of removing noise. But when they are used to remove EMG, these two methods ignore the fact that the frequency between noise and ECG features is overlapped. The principal component analysis (PCA) [Citation7] is based on the idea that the useful parts are uncorrelated with noise, and the denoising is accomplished by eliminating the less correlated components in the signal. However, it can only process aligned signals or multi-channel signals, otherwise, the denoising effect will be weakened. The wavelet transform (WT) [Citation8] has good time-frequency localization properties and can provide signal analysis in time and scale. At the same time, its multi-resolution property can depict the non-stationary characteristics of signals. Therefore, it has become one of the denoising methods commonly used for ECG signals [Citation9–11].

When the wavelet is used for ECG denoising, the selection of mother wavelet could be a crucial procedure. The Daubechies wavelet has a largest vanishing moment, but it sacrificed its symmetry at the same time. The Symlet wavelet obtains the symmetry by reducing the vanishing moment [Citation12]. In recent years, some scholars have proposed some optimized methods to construct wavelets for specific applications [Citation13–17]. In [Citation13], a class of 4-band symmetric biorthogonal wavelet bases is constructed. They proposed that the high-pass filters can be determined by exchanging position and changing the sign of the two low-pass filters in any wavelet system. D Wang and X Zhang [Citation14] have designed simultaneously two scaling low-pass filters with the flat group delay arbitrarily specified to obtain orthogonal and almost symmetric complex wavelets.

These wavelets are designed to satisfy orthogonality and symmetry. However, P waves and T waves which are important signals used in the clinic, expressing the characteristics of the heart function, are not obvious in some leads. The wavelets with orthogonality and symmetry still exist the risk that the characteristics of the P and T waves will be blurred and weaken after denoising. Particularly, when the subject is the atrial fibrillation (AF) signal, the F wave will be weakened (for example, in [Citation18], the F wave is treated as the interference in the ECG signal, and the discrete packet wavelet transform (DPWT) method is used to extract the F wave).

Therefore, a method of modified wavelet design is proposed in this paper. By optimizing the filter coefficients to approximate the ideal filter, a nearly symmetric orthogonal wavelet is obtained and applied to ECG signal denoising. The main contents of the paper are as follows: in the second section, the method of wavelet denoising and the design of modified wavelet are proposed. The third section presents the results of experiments and tests the performance of the proposed method. In the fourth section, we discuss the experiment and summarize the advantages of the modified wavelet design. The fifth section gives the conclusion. Finally, the sixth section gives the acknowledgment.

2. Materials and methods

2.1. Wavelet denoising for ECG

As shown in , the algorithm of wavelet denoising mainly contains three steps: wavelet decomposition, coefficient processing, wavelet reconstruction (the figure is based on [Citation16]).

Figure 1. Schematic diagram of wavelet denoising algorithm.

Figure 1. Schematic diagram of wavelet denoising algorithm.

In the process of wavelet decomposition, two-scale equations are used to realize the dilation and translation of time, and then the scale coefficients and wavelet coefficients at any scale are obtained. The Fourier transform of the scaling function and the wavelet function have the properties of low pass and high pass filtering respectively. Therefore, the wavelet transform and wavelet denoising can be realized by the Mallat algorithm [Citation19] as shown in . Where ‘S’ is the input signal, and ‘H(n)’ and ‘G(n)’ are low-pass and high-pass filters respectively. H(n) and G(n) form a dual-channel filter bank as a pair of mirror filters. The filter coefficients h(n) and g(n) are determined by the scaling function and the wavelet function respectively. In the process of coefficient processing, the threshold is estimated according to the characteristics of EMG noise and is used to deal with the decomposed wavelet coefficients. For the wavelet reconstruction, the processed wavelet coefficients are reconstructed by the mirror filter, and the denoised ECG signal is obtained.

2.2. Modified wavelet design

2.2.1. The principle of design

As for the denoising of clinical ECG signals, in order to achieve reconstruction of signals accurately, the requirements for the performance of filters are very high. The ideal filter can reduce the frequency components in the stopband to zero and filter the noise effectively. However, it is not available. Filters often exist aliasing-distortion with energy loss in practical applications.

Therefore, when the dual-channel filter decomposes the noisy signal into multiple frequency bands, the characteristic information is easily weakened and lost in the frequency crossing bands. The amplitude-frequency response (AFR) of different aliasing types in the decomposition of signals are shown in . If the frequency components of characteristic signals are exactly in the red regions as shown in

Figure 2. AFR of different frequency aliasing types.

Figure 2. AFR of different frequency aliasing types.

, the characteristic signal will be divided into details and contour parts when the nonideal filter as the wavelet coefficient decomposes the signal. Moreover, if the characteristic signal itself is weak, the coefficient will become smaller in the different parts. When the wavelet decomposition coefficients of the characteristic signal are processed by the threshold method, they are more likely to be estimated to be noise parts and be removed, thus increasing the risk of denoising. Therefore, in order to reduce the risk of eliminating the feeble features of ECG signals in denoising, this paper proposes to construct an optimized filter by approximating the ideal filter, thus the modified wavelet can be designed.

An ideal filter with AFR is shown in . Considering that the scale function also has the similar AFR, each detail or approximation level contains only certain frequency components supposed to exist in the exact level. In addition, using the ideal filter can build orthogonal wavelets, so it would be a good idea to use symmetric coefficients to approximate the ideal filter.

Figure 3. AFR of the ideal filter.

Figure 3. AFR of the ideal filter.

The disparity between the filter and ideal filter determines the filtering performance directly. In order to minimize the gap, we define an error function as in EquationEquation (1). (1) min(Eamp)=min(w=0π/2(1|H(w)|2)+w=π/2π|H(w)|2)(1)

Eamp presents the error between the filter and the ideal filter and H(ω) is the AFR of the filter. Minimum Eamp in EquationEquation (1) is tantamount to optimize the AFR of the filter and make the wavelet nearly orthogonal. However, it is intractable to minimize Eamp. Therefore, using filter coefficients to express the problem turns out to be a good choice. Given an L-length filter, the AFR can be expressed as: (2) |H(w)|2=12[|n=0L1h(n)cosnw|2+|n=0L1h(n)sinnw|2](2)

Where h(n) are symmetric filter coefficients in a form of [a,b,c,,c,b,a]. In order to satisfy the needs of wavelet filters, h(n) is set up to be: (3) nh(n)=2(3)

Now the design goal becomes to a minimum Eamp in EquationEquation (1) under the constraint of EquationEquation (3). It makes the objective function a multivariate polynomial equation and quadratic for all filter coefficients by inserting EquationEquation (2) to EquationEquation (1). To solve this problem, the trust-region-reflective quadprog algorithm which is a simple yet powerful tool for optimization is chosen. Subsequently, we can get the filter coefficients of different lengths.

2.2.2. Realization of modified wavelet

Considering that the coefficient is symmetric, the filter length must be even. By setting the length of the filter H(n) to 8, the wavelet filter coefficients as shown in can be obtained by solving the EquationEquation (1).

Table 1. Fibr wavelet coefficients.

The scaling function is obtained by iterative numerical convolution of optimized filter coefficients and is also called the wavelet father function. The wavelet function called mother wavelet can be obtained by scaling function according to the two-scale equation, then the wavelet is defined by these two functions. Afterward, the approximate orthogonal wavelet which is constructed by the coefficients is named fibr wavelet and the diagrams of a scaling function and wavelet function are shown in .

Figure 4. The result of wavelet design (fibr wavelet). From the left to right: (a) The scaling function diagram (b) The wavelet function diagram.

Figure 4. The result of wavelet design (fibr wavelet). From the left to right: (a) The scaling function diagram (b) The wavelet function diagram.

shows the scaling function diagram and wavelet function diagram of fibr wavelet. We can observe that a wavelet with the symmetry scaling function and anti-symmetry wavelet function is obtained by setting h(n) in form of [a,b,c,,c,b,a].

2.3. Denoising evaluation

In order to test the denoising effect of the modified wavelet, the signal to noise ratio (SNR) and the mean square error (MSE) are used [Citation1]. The SNR and MSE are defined as follows: (4) SNR=10lg(n=1Nx2(n)n=1N[x(n)y(n)]2),MSE=n=1N[x(n)y(n)]2N(4)

In the EquationEquation (4), x(n) is the original signal, y(n) is the reconstructed signal after wavelet denoising, and N is the length of the signal. The bigger the SNR value is, the better the effect is, while the MSE value needs to be smaller to get the better effect.

3. Results

3.1. Data sources

In this paper, we test our methods by using the normal clinical ECG data as well as simulated AF signals.

The clinical data used in this paper comes from the standardized database which is collected and processed by SID Medical Technology Co. Ltd. This corporation specializes in ECG medical science and technology. Moreover, its huge clinical database is the diagnosis data which comes from consecutive patients in the Department of Cardiology in several authoritative hospitals in Shanghai. After the doctor's accurate diagnosis and desensitization processing, all the data are stable and standard, which can be used for signal processing and disease automatic diagnosis.

In the experimental 3.2.1 and 3.2.2, the data used is normal ECG data which contains 87 consecutive normal ECG records from the database mentioned. Each record lasted 10 s with 12 leads, and acquisition equipment parameters of ECG signals are shown in (the parameters are provided by the technology company). All these records represent the consecutive patients in the Department of Cardiology of hospitals respectively. According to the statistics of these patients, the age range is from 30 to70 years old, and the proportion of women is greater than that of men.

Table 2. Parameters of the acquisition equipment.

In the experimental 3.2.3, the data is derived from the simulated AF signals synthesized by the simulated F waves and clinical normal ECG signals mentioned. The F waves are generated by the method that is shown in [Citation20]. The parameters [Citation20] used in this paper are shown in .

Table 3. Parameters using for generating F waves.

3.2. Denoising results

In order to test the denoising effect of fibr wavelet, the following denoising experiments for different ECG signals are carried out.

3.2.1. Denoising results on normal ECG

Based on the normal ECG signals of 87 records mentioned in the data sources, the random white Gaussian noise (WGN) with an expected amplitude of 0.3 V is added. The average SNRs are shown in row SNR0 in data sheets of . Sym4 and db4 wavelets are used for comparison with fibr wavelet.

Figure 5. The average denoising effects on normal ECG.

Figure 5. The average denoising effects on normal ECG.

According to the frequency characteristics of EMG, the number of decomposition level is set to 8. The threshold is the sure threshold obtained by the unbiased risk estimate of Stein. For a given threshold T, the likelihood estimation is obtained and minimize the likelihood function, then the selected threshold can be obtained. Subsequently, the high-frequency coefficients are processed by soft threshold quantization [Citation1] under each decomposition scale. The wavelet can be reconstructed based on the lowest low-frequency coefficients of wavelet decomposition and the high-frequency coefficient of each layer. And this processing methods are also used in the experiments of section 3.2.2 and section 3.2.3.

The result for a normal record with II, V1 and V5 leads are shown in . And the average denoising effects evaluated by SNR and MSE, are shown in .

Figure 6. The denoising result on normal ECG. From top to bottom: (a) lead II (b) leadV1 (c) lead V5.

The Original ECG in represents the normal ECG signal mentioned in section 3.1. The Noisy ECG is the signal synthesized by adding the random white Gaussian noise (WGN) with an expected amplitude of 0.3 V on the Original ECG. The denoising results by db4, sym4, fibr wavelets are shown in following three Figures entitled Db4 denoising method, Sym4 denoising method, Fibr denoising method. In the data sheet of , the row SNR(i) and row MSE(i) (i = 0,1,2,3) represent the SNR and MSE of noisy signal, db4 wavelet, sym4 wavelet and fibr wavelet denoising respectively.

shows that, for II, V1 and V5 leads, the proposed method can retain the P wave and T wave information as shown in the red tagging parts. It demonstrates that fibr wavelet outperforms db and sym wavelets for ECG denoising. gives the bar charts of mean values of SNR and MSE and data sheets. It shows that the SNR of the fibr wavelet denoising is the largest and the MSE is the smallest in the three leads, indicating that the fibr wavelet is more capable than the db4 and sym4 wavelets to suppress the noise.

3.2.2. Denoising results on ECG signals under different noise levels

The random WGN with expected amplitudes of 0.015 V, 0.03 V, and 0.065 V are added to 87 records respectively. The result for a normal record with II lead is shown in . And the average denoising effects evaluated by SNR and MSE, are shown in .

Figure 7. The denoising result under the noise with expected amplitude of 0.065 V.

Figure 7. The denoising result under the noise with expected amplitude of 0.065 V.

Figure 8. The average denoising effects at different noise levels.

Figure 8. The average denoising effects at different noise levels.

The specific meanings of Original ECG, Noisy ECG, Db4 denoising method, Sym4 denoising method, and Fibr denoising method in are the same as those in the experiment of Section 3.2.1. Moreover, the specific meanings of the values of SNR(i) and MSE(i)(i = 0,1,2,3) in are the same as those in the experiment of Section 3.2.1.

shows that when the noise expected amplitude reaches 0.065 V, the proposed method can still retain the P wave and T wave information as shown in the red tagging parts. It demonstrates that fibr wavelet outperforms db and sym wavelets in ECG denoising once again. Meanwhile, gives the average denoising results of at different noise levels. It shows that when the noise expected amplitude reaches 0.065 V, the SNRs for the db4 wavelet, the sym4 wavelet, and the fibr wavelet denoising methods are calculated to be 76.18, 75.68, and 81.65 dB, respectively. It can be seen that the SNR of the fibr wavelet denoising is the largest and the MSE is the smallest generally, indicating that the fibr wavelet denoising method is superior to the db4 and sym4 wavelets.

3.2.3. Denoising results on the simulated AF signals

Based on the normal ECG signals, firstly add the F waves generated according to the parameters in and then the random WGN with an expected amplitude of 0.1 mv is added. The average SNRs are shown in row SNR0 in the data sheets of in . Sym4 and db4 wavelets are used for comparison. The result for a simulated AF signal with V5 lead is shown in . Also, the average denoising effects evaluated by SNR and MSE are presented in .

Figure 9. The average denoising effects on simulated AF signals.

Figure 9. The average denoising effects on simulated AF signals.

Figure 10. The denoising result on the simulated AF signal.

Figure 10. The denoising result on the simulated AF signal.

The specific meanings of Original ECG, Noisy ECG, Db4 denoising method, Sym4 denoising method, and Fibr denoising method in are the same as those in the experiment of Section 3.2.1. The specific meanings of the values of SNR(i) and MSE(i)(i = 0,1,2,3) in the data sheets of are the same as those in Section 3.2.1.

shows that when the subject is the atrial fibrillation ECG signal, the proposed method can retain the F wave information as shown in the red tagging parts. It demonstrates that fibr outperforms db and sym wavelets for denoising on simulated AF signals. gives the average denoising results on simulated AF signals. It shows that the SNR of the fibr wavelet denoising is the largest and the MSE is the smallest, which confirms the superior performance of the proposed method when applied to the noise of AF signals. These results further demonstrate that the proposed method is not only applicable to ECG denoising but also suitable for denoising on AF signals.

3.3. Discussion of results

The 12-lead ECG signals are usually used in clinical. Sometimes, P waves and T waves are not obvious in some leads. When it happens, the start and end of P wave and T wave are usually determined by observing good leads. However mobile ECG monitoring devices usually have only three leads: II, V1, and V5 leads.

While denoising for these three-lead ECG signals, the fibr wavelet preserves the P wave and T wave characteristic information as shown in the and , showing that the proposed denoising method is potentially useful for the three-lead ECG equipment. In , the proposed wavelet retains recurrent F wave information during denoising, demonstrating the advantages of fibr wavelet denoising for AF signals.

show that, with the increase of the noise amplitude, the values of MSE becomes larger up to 10 times and the effects of denoising obviously becomes worse. This demonstrates that the larger the noise is, the greater the risk of eliminating useful information is. However, shows that compared to db and sym wavelets, fibr wavelet can still retain the waveform characteristics of P waves and T waves.

4. Conclusion

In order to reduce the weakening of the feeble features in the ECG signals by wavelet denoising, an optimized design method of the mother wavelet is proposed. The optimized filter coefficients are obtained by approximating the amplitude-frequency response of the ideal filter, and the wavelet is constructed with the optimized filter coefficients and applied to the denoising of ECG signals.

The proposed method is tested by clinical ECG data and compared with db4 and sym4 wavelet, the modified wavelet can retain the feeble features such as P waves, T waves and recurrent F waves in the process of denoising. Meanwhile, it can improve the signal to noise ratio and reduce the mean square error for the denoising effectively.

The method proposed in this paper provides theoretical guidance for the ECG signal denoising in mobile medical treatments and also provides a way to denoise other types of signals with feeble features.

Disclosure statement

The authors report no potential conflict of interest.

Additional information

Funding

This work was supported by Natural Science Foundation of Zhejiang province [Grant No. LQ18F010006] and National Natural Science Foundation of China [Grant No. 61801454].

References

  • Almohad M, Riley HB. Performance study of different denoising methods for ECG signals. Comput Sci. 2014;37:325–332.
  • Blanco-Velasco M, Weng B, Barner KE. ECG signal denoising and baseline wander correction based on the empirical mode decomposition. Comput Biol Med. 2008;38:1–13.
  • Suchetha M, Kumaravel N. Empirical mode decomposition-based filtering techniques for power line interference reduction in electrocardiogram using various adaptive structures and subtraction methods. Biomed Signal Process Control. 2013;8:575–585.
  • Singh N, Ayub S, J P. Design of S. Digital IIR Filter for Noise Reduction in ECG Signal. Conf Proc IEEE Comput Intell Commun Netw. 2013;2013:171–176.
  • Yan J, Lu Y, Liu J, et al. Self-adaptive model-based ECG denoising using features extracted by mean shift algorithm. Biomed Signal Process Control. 2010;5:103–113.
  • Wang Z, Chi MW, Cruz JND, et al. Muscle and electrode motion artifacts reduction in ECG using adaptive Fourier decomposition. Conf Proc IEEE Syst Man Cybern. 2014;2014:1456–1461.
  • Chawla MPS. A comparative analysis of principal component and independent component techniques for electrocardiograms. Neural Comput Applic. 2009;18:539–556.
  • Guido RC. Effectively interpreting discrete wavelet transformed signals. IEEE Signal Process Mag. 2017;34:89–100.
  • Ho YF, Ling WK, Wong PL, et al. Fuzzy multiwavelet denoising on ECG signal. Electron Lett. 2003;39:1163–1164.
  • Kumar A, Singh M. Optimal selection of wavelet function and decomposition level for removal of ECG signal artifacts. J Med Imaging Hlth Inform. 2015;5:138–146.
  • Kayhan S, Erçelebi E. ECG denoising on bivariate shrinkage function exploiting interscale dependency of wavelet coefficients. Turkish J Electr Eng Comput Sci. 2014;19:495–511.
  • Daubechies I. Ten Lectures on Wavelets. Philadelphia: Society for Industrial and Applied Mathematics; 1992.
  • Zou Q, Wang G. Optimal model for 4-band biorthogonal wavelets bases for fast calculation. J Inequal Appl. 2017;2017:222.
  • Wang D, Zhang X. A new class of Hilbert pairs of almost symmetric orthogonal wavelet bases. IEICE Trans Fundamentals. 2016;99:884–891.
  • Li B. Wavelet bi‐frames with uniform symmetry. Math Meth Appl Sci. 2016;39:3701–3721.
  • Narang SK, Ortega A. Perfect reconstruction two-channel wavelet filter banks for graph structured data. IEEE Trans Signal Process. 2012;60:2786–2799.
  • Zhu J, Zhang Y. Construction of orthogonal wavelet for ECG signal processing. Chinese J Biomed Eng. 2017;36:109–113.
  • Sanchez C, Millet J, Rieta JJ, et al. Packet wavelet decomposition: an approach for atrial activity extraction. IEEE Comput Cardio. 2002;29:33–36.
  • Wang BQ, Wang G, Fu YX, et al. The Mallat algorithm for a class of orthogonal wavelet on compact lie groups. Conf Proc IEEE Wavelet Anal Pattern Recognit. 2009;2009:413–416.
  • Stridh M, Sörnmo L. Spatiotemporal QRST cancellation techniques for analysis of atrial fibrillation. IEEE Trans Biomed Eng. 2001;48:105–111.