Skip to main content

Denoising of weak ECG signals by using wavelet analysis and fuzzy thresholding

Abstract

The electrocardiogram (ECG) is a biological signal that contains important information about the cardiac activities of heart. ECG signal plays a very important role in the diagnosis and analysis of heart diseases. ECG signal is corrupted by various types of noise such as electrode movement, strong electromagnetic effect and muscle noise. Noisy ECG signal has been extracted using signal processing. This paper presents a weak ECG signal denoising method based on fuzzy thresholding and wavelet packet analysis. Firstly, the weak ECG signal is decomposed into various levels by wavelet packet transform. Then, the threshold value is determined using the fuzzy s-function. The reconstruction of the ECG signal from the retained coefficients is achieved by using inverse wavelet packet transform. We carried out several experiments to show the effectiveness of the proposed method and compared the results with the traditional wavelet packet soft and hard thresholding methods for weak signal denoising. The results are satisfactory according to calculated the correlation coefficient.

Introduction

The electrocardiogram signal, which is a standard tool in identifying rhythms of the heart, is one of the most important biomedical signals (Von Borries et al. 2009). This signal is usually corrupted by white noise and various types of noise. These corruptions can be eliminated by using various noise reduction techniques (Li and Yang 2004). If the signal-to-noise ratio (SNR) is under −10 dB, the signal is deduced as weak signal (Li and Yang 2004). Thus, the weak signal denoising is an emerging application which found various practical applications in the field of radar, physic, communication, earthquake and biomedical signals (Li and Yang 2004).

Various ECG denoising methods can be found in literature. Wiener filtering and Kalman filtering methods are the pioneering works that aim to remove the additive noises (Sayadi and Shamsollahi 2008; Lu et al. 2009). However, due to the non-stationary nature of the ECG signal, frequency domain filters could cause distortion in a transient interval of the signal and important clinical information may be lost (Sayadi and Shamsollahi 2008; Lu et al. 2009). Karel et al. (2005) suggested a performance criterion to measure the quality of a wavelet, based on the principle of maximization of the variance. Mahamoodabadi et al. (2005) developed an ECG feature extraction system based on the wavelet transform. Shantha Selva Kumari et al. presented a method which uses a wavelet-based orthogonal filter bank for cardiac signals (Strang and Nguyen 1997; Shantha Selva Kumari et al. 2007). Nikolaev et al. (2000) suggested a two-step algorithm for ECG. This is a Wiener filtering in the translation-invariant wavelet domain. Song et al. (2007) developed a fuzzy threshold in wavelet packet domain. Ling et al. (2008) suggested a fuzzy rule based multiwavelet ECG signal denoising. Alfaouri and Daqrouq (2008) presented a method which uses an ECG signal denoising by wavelet transform thresholding. Fazlul Haque et al. (2009) suggested a detection of small variations of ECG features using wavelet. Sharma et al. (2010) developed an ECG signal denoising using higher order statistics in wavelet subbands.

In literature, it can be seen that wavelet-based soft and hard thresholding schemas use a constant threshold and variance value for denoising the input noisy signals. When constant threshold and variance values are used in wavelet-based soft and hard thresholding methods, some of the wavelet coefficients that are belong to actual signal, can be discarded due to the constant threshold value or vice versa. Thus, instead of using a constant threshold and variance values, an optimal threshold and variance values have to be determined to obtain a successful signal denoising. In this study, a new thresholding method that is based on the fuzzy s-function is proposed and the determination of the proper threshold and variance values are carried out with a basic search algorithm. This basic search algorithm is based on a trial and error method which will be explained in detail in Sect. 4. We also realized a comparative study to show the superiority of the proposed method.

The outline of this paper is as follows. Section 2 will give a short introduction to wavelet transform, wavelet packet transform and denoising using wavelet thresholding. Section 3 describes proposed method. Section 4 shows simulation results for the proposed method and performance comparison between the proposed method and the conventional thresholding methods. Section 5 is a conclusion.

Wavelet transform

Wavelet analysis is a multiresolution analysis as developed by Malat (1989). The wavelet transform analyzes signals in both time and frequency domains, whereas other classical methods like Fourier transform are analyzed in frequency, only. ECG signal is time-varying non-stationary and thus it is an important tool for analysis of ECG signals. Wavelet transform presents best time resolution for low and high-frequency components, and so it is overcomes the fixed time-frequency like the short time Fourier transform (STFT). Figure 1 shows the tiling of the time–frequency plane.

Fig. 1
figure1

a Windowed time–amplitude plane, b windowed Fourier transform frequency–amplitude spectrum, c frequency–time plane with STFT, d windowed technique with wavelet transform

The width of the window is changed in the wavelet transform, which is the most important characteristic of the wavelet transform. There are two functions that have to be taken into account in such a wavelet analysis: the scaling function and mother wavelet. A mother wavelet \( \psi (t) \) is a function of zero average and as follows:

$$ \int\limits_{ - \infty }^{\infty } {\psi (t){\text{d}}t} = 0. $$
(1)

The continuous wavelet transform (CVT) is defined as follows:

$$ {\text{CWT}}(a,b) = \frac{1}{\sqrt a }\int\limits_{ - \infty }^{\infty } {f(t)\overline{\psi } (\frac{t - b}{a}){\text{d}}t} . $$
(2)

The transformed signal is a function of two variables, a and b, the scale and position parameters.

Wavelet packet transform

Wavelet packet transform (WPT) is an efficient tool for signal processing. WPT has special capabilities to achieve higher separation by analyzing the higher frequency domains of a signal. So the WPT is more suitable than wavelet in signal processing (Mohamed et al. 2008). WPT uses a pair of low pass and high pass filters to split a low-frequency and a high-frequency component. So the WPT allows better frequency localization of signals (Mohamed et al. 2008).

The WPT can be viewed in Fig. 2 as a tree. The base of the tree is the original signal. The subsequent level of the tree is the result of the wavelet transforms (Mohamed et al. 2008).

Fig. 2
figure2

Tree of wavelet packet decomposition

Denoising using wavelet thresholding

Denoising can apply to the any general problem of detecting an unknown signal from noisy signal. x will denote an unknown signal to be detected, and d is the additive noise defined as follows:

$$ y\left[ n \right] = x\left[ n \right] + d\left[ n \right] $$
(3)

where y is the noisy signal. The aim of denoising is to detect a prediction of x from the noisy signal. In the earlier works, the most common idea for detecting is low frequency of the true signal. The x can also have specific high-frequency features. Wavelet transform can preserve important high-frequency features of the true signal. So, wavelet thresholding is a method for denoising the noisy signals (Fletcher 2002). The standard wavelet thresholding techniques of coefficients are controlled by hard and soft thresholding function (Senthilkumar et al 2008; Van Hulse et al. 2012). Soft thresholding is defined as following:

$$ \hat{X} = \left\{ {\begin{array}{*{20}l} {y - \text{sgn} (y)T} & {{\text{if}}\,|y| \ge T} \\ 0 & {{\text{if}}\,|y| < T} \\ \end{array} } \right. $$
(4)

Moreover, hard threshold is defined as following:

$$ \hat{X} = \left\{ {\begin{array}{*{20}l} y & {{\text{if}}\,\left| y \right| \ge T} \\ 0 & {{\text{if}}\,\left| y \right| < T} \\ \end{array} } \right. $$
(5)

A schematic illustration of the hard and soft thresholding is given in Fig. 3.

Fig. 3
figure3

Block diagram of the hard and soft denoising methods

The soft and hard thresholding estimators are described by the following algorithm:

  • 1. Compute the wavelet transform coefficients of the noisy signal.

  • 2. Estimate the noise variance σ 2at each wavelet scale.

    $$ \hat{\sigma } = \frac{{{\text{med}}\left( {\left| {W_{j,k} } \right|} \right)}}{0.6745} $$
    (6)
    $$ T = \sigma \sqrt {2.\log (n)} $$
    (7)

    where med(.) denotes the median and T is the threshold value.

  • 3. Soft or hard thresholding is performed with above positive real threshold. Soft and hard threshold are depicted in Fig. 4.

  • 4 Reconstruct the signal from the retained coefficients using the inverse wavelet transform.

Fig. 4
figure4

Hard and soft threshold

Proposed method

As we mentioned in the introduction section, in wavelet-based soft and hard thresholding methods, the thresholding parameters such as T and σ are constant where T and σ symbolizes the threshold and variance value wavelet coefficients, respectively. Thus, due to the constant T and σ some of the wavelet coefficients that are actually belong to the original signal, may be discarded or the noise component may be deduced as original signal. Obtaining an optimal T and σ is in the aim of this paper. Moreover, we used a fuzzy s-function to construct a thresholding mechanism that is given in Eq. 8.

$$ f(x;a,b) = \left\{ {\begin{array}{*{20}l} 0 & {x \le a} \\ {2\left( {\frac{x - a}{b - a}} \right)^{2} ,} & {a \le x \le \frac{a + b}{2}} \\ {1 - 2\left( {\frac{x - b}{b - a}} \right)^{2} ,} & {\frac{a + b}{2} \le x \le b} \\ 1 & {x \ge b} \\ \end{array} } \right. $$
(8)

This spline-based curve is a mapping on the vector x, and is named because of its S-shape. The parameters a and b locate the extremes of the sloped portion of the curve (Fuzzy logic toolbox, http://www.mathworks.com/help/toolbox/fuzzy/smf.html). Fuzzy s-function threshold are depicted in Fig. 5.

Fig. 5
figure5

Fuzzy s-function threshold

We employed a loop-based algorithm to search the optimal parameters of the fuzzy s-function to get a better denoising. In other words, we adjust the gradient of the fuzzy s-function to yield a better performance. The block diagram of the proposed method can be seen in Fig. 6.

Fig. 6
figure6

The block diagram of the proposed method

The algorithm of the proposed denoising method is given as following;

  • Step1 Decomposing of the noisy signal using the wavelet packet transform.

  • Step 2 Noise variance σ 2 is estimated using Eq. 6.

  • Step 3 The T is calculated using Eq. 7.

  • Step 4 Assign σ and T + σ to the fuzzy s-function parameters a and b, respectively.

  • Step 5 Change the σ in a pre-defined interval to adjust the gradient of the fuzzy s-function to obtain the highest correlation coefficient. Select the T and σ according to the highest correlation coefficient.

  • Step 6 Reconstruct the signal from the retained coefficients using the inverse wavelet packet transform.

Experimental studies

In this paper, we assumed that the ECG signals are corrupted by the white Gaussian noise and thus, the signals are deduced as weak signals. In our experiments, we used the ECG signals that were taken from Harvard-MIT Division of Health Sciences and Technology (Harvard-MIT Division of Health Sciences and Technology, http://ecg.mit.edu/). The signals were recorded on 8-channel instrumentation tape and then digitized. The raw sampling rate of 1,440 samples per second per signal was reduced by a factor of two to yield an effective rate of 360 samples per second per signal relative to real time. An ECG signal can be seen in Fig. 7.

Fig. 7
figure7

An ECG signal

A random additive white Gaussian noise (AWGN) is generated and added to the ECG signals. A noisy ECG signal is shown in Fig. 8. The SNR value is −10 dB for this noisy ECG signal.

Fig. 8
figure8

The noisy ECG signal (SNR = −10 dB)

We continued by applying the proposed method to a noisy ECG signal and compared the results to popular soft and hard thresholding methods. A brief review of the soft and hard thresholding methods are available in Sect. 2. The noisy ECG signals were then denoised using the proposed method and other traditional thresholding methods. In all cases ‘db3’ wavelet was used due to its general resemblance to the ECG signals and the noisy signals were decomposed up to 8 levels. Figure 9 shows the denoised ECG signal using the proposed method.

Fig. 9
figure9

The denoised ECG signal using s function (SNR = −10 dB)

Table 1 presents a complete comparison among methods for the weak ECG signals. To evaluate the performance of the proposed method, we used the correlation coefficient (http://www.jerrydallal.com/LHSP/corr.htm).

Table 1 Correlation coefficient values for various SNR using thresholding methods

The correlation coefficient is a statistical concept that can measure of how well the predicted signal follows the actual signal. It is a measure of how well the predicted signal from a forecast model fit with the original signal (http://www.jerrydallal.com/LHSP/corr.htm).

$$ r = \frac{{\sum\nolimits_{i = 1}^{n} {(x_{i} - \bar{x})\,(y_{i} - \bar{y})} }}{{\sqrt {\sum\nolimits_{i = 1}^{n} {(x_{i} - \bar{x})^{2} \,\sum\nolimits_{i = 1}^{n} {(y_{i} - \bar{y})^{2} } } } }} $$
(9)

The calculated correlation coefficients are given in the related table. Table 1 gives the calculated evaluation values for the proposed method with different SNR rates ranging from −5 to −20.6 dB. It is obvious that the obtained results are notable for all SNR rates. When the SNR rate is −5 dB, the calculated correlation coefficient value is 0.9761. Moreover, notable evaluation values such as 0.5634 correlation coefficient is also recorded when the SNR rate is −20.6 dB (Figs. 10, 11).

Fig. 10
figure10

The noisy ECG signal (SNR = −15 dB)

Fig. 11
figure11

The denoised ECG signal using s function (SNR = −15 dB)

We also constructed Table 1 for hard and soft thresholding methods in order to evaluate these methods denoising ability with different SNR rates. The SNR rates are also ranging from −5 to −20.6 dB for these methods. Moreover, hard thresholding method achieved more good results than soft thresholding when we consider the related correlation coefficients.

It is evident that the proposed method is performing notably well in comparison with soft and hard thresholding methods. In all SNR rates, the proposed method shows superior performance compared to the existing methods with notable correlation coefficient values.

Conclusion

In this paper, fuzzy thresholding and wavelet packet analysis method is proposed to filter weak ECG signals. Threshold value is determined using the fuzzy s-function to remove the additive noise. It was shown that the approach could achieve notable denoising when the SNR rate is about −20 dB. Moreover, we realized a comparative study where soft and hard thresholding methods are considered. All computer simulations were carried out in MATLAB environment. We employed performance evaluation test such as correlation coefficient to calculate the quality of the compared methods. According to the calculated evaluation test the proposed method is performing notably well in comparison with soft and hard thresholding methods. In all SNR rates, the proposed method shows superior performance compared to the existing methods.

References

  1. Alfaouri M, Daqrouq K (2008) ECG signal denoising by wavelet transform thresholding. Am J Appl Sci 5(3):276–281

    Article  Google Scholar 

  2. Correlation coefficients. http://www.jerrydallal.com/LHSP/corr.htm

  3. Fazlul Haque AKM, Hanif Ali Md, Adnan Kiber M, Tanvir Hasan Md (2009) Detection of small variations of ECG features using wavelet. ARPN J Eng Appl Sci 4(6)

  4. Fletcher AK (2002) Denoising via recursive wavelet thresholding. Master of Science in Electrical Engineering in the Graduate Division of the University of California, Berkeley

  5. Fuzzy logic toolbox. http://www.mathworks.com/help/toolbox/fuzzy/smf.html. Accessed 24 Mar 2012

  6. Harvard-MIT Division of Health Sciences and Technology. http://ecg.mit.edu/

  7. Karel JMH, Peeters RLM, Westra RL, Moermans KMS, Haddad SAP, Serdijn WA (2005) Optimal discrete wavelet design for cardiac signal processing. In: Proceedings of the IEEE, engineering in medicine and biology 27th annual conference, 2005

  8. Li Y, Yang B (2004) Introduction of chaotic oscillator detection. Publish House of Electronics Industry, Beijing

  9. Ling BW-K, Ho CY-F, Lam H-K, Wong TP-L, Chan AY-P, Tam PKS (2008) Fuzzy rule based multiwavelet ECG signal denoising. In: IEEE international conference on fuzzy systems (FUZZ 2008)

  10. Lu G, Brittain JS, Holland P, Yianni J, Green AL, Stein JF, Aziz TZ, Wang S (2009) Removing ECG noise from surface EMG signals using adaptive filtering. Neurosci Lett 462(1):14–19

    Article  Google Scholar 

  11. Mahamoodabadi SZ, Ahmedian A, Abolhasani MD (2005) ECG feature extraction using Daubechies wavelet. In: Proceedings of the fifth IASTED international conference visualization, imaging and image processing, September 7–9, 2005

  12. Malat SG (1989) A theory for multiresolution signal decomposition. IEEE Trans Pattern Anal Mach Intell 11(7):674–693

    Article  Google Scholar 

  13. Mohamed IM, Moawad IMD, Salah D, Fatma HE (2008) Signal denoising by wavelet packet transform on FPGA technology. http://www.ubicc.org

  14. Nikolaev N, Nikolov Z, Gotchev A, Egiazarian K (2000) Wavelet domain Wiener filtering for ECG denoising using improved signal estimate. IEEE

  15. Sayadi O, Shamsollahi MB (2008) ECG denoising and compression using a modified extended Kalman filter structure. IEEE Trans Biomed Eng 55(9):2240–2248

    Article  Google Scholar 

  16. Senthilkumar P et al (2008) Removal of ocular artifacts in the EEG through wavelet transform without using an EOG reference channel. Int J Open Problems Compt Math 1(3):188–200

    Google Scholar 

  17. Shantha Selva Kumari R, Bharathi S, Sadasivam V (2007) Design of optimal discrete wavelet for ECG signal using orthogonal filter bank. In: International conference on computational intelligence and multimedia applications, IEEE, 2007

  18. Sharma LN, Dandapat S, Mahanta A (2010) ECG signal denoising using higher order statistics in wavelet subbands. Biomed Signal Process Control 5:214–222

    Article  Google Scholar 

  19. Song S, Qi Y-Y, Qiao J-F (2007) Research on de-noising of pulse signal based on fuzzy threshold in wavelet packet domain. In: Proceedings of the 2007 international conference on wavelet analysis and pattern recognition, Beijing, China, 2–4 November

  20. Strang G, Nguyen T (1997) Wavelets and filter banks. Cambridge Press, Wellesley

    Google Scholar 

  21. Van Hulse J, Khoshgoftaar TM, Napolitano Al, Wald R (2012) Threshold-based feature selection techniques for high-dimensional bioinformatics data. Netw Model Anal Health Inf Bioinform 1(1–2):47–61

    Article  Google Scholar 

  22. Von Borries R, Pierluissi JH, Nazeran H (2009) Redundant discrete wavelet transform for ECG signal processing. Biomed Soft Comput Hum Sci 14(2):69–80

    Google Scholar 

Download references

Author information

Affiliations

Authors

Corresponding author

Correspondence to Mehmet Üstündağ.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Üstündağ, M., Gökbulut, M., Şengür, A. et al. Denoising of weak ECG signals by using wavelet analysis and fuzzy thresholding. Netw Model Anal Health Inform Bioinforma 1, 135–140 (2012). https://doi.org/10.1007/s13721-012-0015-5

Download citation

Keywords

  • ECG signal
  • Wavelet denoising
  • Fuzzy s-function
  • Soft and hard thresholding