Introduction

Electrocardiogram (ECG) gives a lot of information on the physiology of heart [1, 2]. In reality, noise from various sources interfere with the ECG signal [3]. This noise includes powerline interference, electrode contact noise, motion artifacts, muscle artifacts, baseline wander, and high-frequency noises. For accurate extraction of useful information about the heart from ECG, noise cancellation of the ECG signal is very much important.

Various signal processing algorithms have been developed for denoising of the ECG signal. Different methods for noise cancellation of the ECG signal are bandpass filtering (BPF) [4], ensemble average (EA) [5], adaptive filtering technique (AF) [6, 7] wiener filter (WF) [8], wavelet denoising (WD) [9], empirical mode of decomposition (EMD) [10, 11], principal component analysis (PCA) [12], neural network [13], independent component analysis (ICA) [14], non-local mean of denoising (NLM) [15], extended Kalman filter (EKF) [16], unscented Kalman filter (UKF) [16] and extended Kalman smoother (EKS) framework [16]. EEMD-ICA has been successfully used for noise reduction for EMG and other sources [17].

Bandpass filter technique [4] is inadequate to suppress non-cardiac ECG noises contaminated with the ECG signal [16]. Ensemble average technique [5] is based on averaging the many beats. It has been used for estimation of small ECG components from the noisy ECG signal. However, it losses inter-beat variation in the ECG cycle due to the averaging process. Adaptive filtering technique [6, 7] has been used for denoising the ECG contaminated with noise from various sources like baseline wander, powerline interference, electromyography (EMG) noise and motion artifacts. The AF technique requires a reference signal for noise cancellation of the noise-contaminated ECG. The error in the reference signal will reduce the efficiency in the denoising technique. Wiener filter technique [8] is based on minimization of mean square error. Causal WF has been applied on in a time domain, or non-causal WF has been applied in a frequency domain [16]. This technique does not give the good result for noisy ECG, due to the non-stationary behaviour of the ECG signal. Wavelet denoising [9, 18] is a common approach used in the noise cancellation process of ECG signal. This technique is based on frequency content of the ECG and the threshold method. EMD technique is also used with wavelet technique for the denoising process. These techniques (WD, EMD) [10, 11] do not preserve the edges. ICA and PCA technique [14] do not give the good results if only single lead is available in the denoising process, because these techniques (ICA, PCA) use the basic principle of correlation and un-correlation using multi-leads for the denoising process. Neural network technique [13] uses black box technique (similar probabilistic property one to another) for the denoising process of the ECG signal. It cannot give good result in the abnormal heart situation. The non-local mean (NLM) denoising technique [15] uses for denoising as well as preserving the edges of the noisy ECG signal. It depends on the parameter bandwidth, which depends on standard deviation of the noise. In real time, the standard deviation of the noise cannot be predicted, in that situation, it may not give good result in the denoising process. It also does not give values for some initial and final samples (neighbourhood half width) of the ECG signal. The EKF framework, UKF framework and EKS framework used for noise cancellation of the ECG signal [16]. The UKF framework for denoising the ECG signal is based on unscented transform (UT). The estimated values of sensitive and covariance matrices by UT is semidefinite. So much effort is required to achieve a numerical stable system for denoising the ECG signal using UKF framework [16]. The EKS framework for denoising the ECG signal consists of forward EKF stage (framework) followed by backward recursive smoothing stage [16]. Due to this non-causal nature, the EKS framework gives better performance compared to EKF framework for noise cancellation of the ECG signal [16]. The lsqnonlin (non-linear least square) method is used for initializing parameters and state equation of the EKS. This method sometimes required operator interaction depend upon the ECG signal to get good result of the denoising technique. The proposed method is based on the modification of the EKS framework to get the good results in the denoising of noise-contaminated ECG signal.

The main aim of the work is to propose a methodology to denoise the single channel noise contaminated ECG signal with better SNR improvement, lesser minimum mean square error (MSE) and percent of distortion (PRD).

Methodology

The proposed methodology, cancel the noise from the single channel noisy ECG signal without requiring operator interaction. The block diagram of the proposed methodology is shown in Fig. 1. The proposed methodology consists of four stages namely phase assignment, template extraction, optimized parameters estimation and filtering framework. In the phase assignment stage, the phase of each sample according to the R-peaks in the ECG signal is assigned. The mean amplitude, standard deviation and mean phase of the ECG for one cycle is calculated in the template extraction stage. In the optimized parameters estimation stage, using differential evolution (DE) the phase, width and amplitude of the ECG components of the noisy ECG signal are estimated. Finally, the output of phase assignment stage, optimized parameter estimation using DE and noisy ECG signal is applied to extended Kalman smoother framework for extraction of the denoised ECG in the filtering framework. The detail description of each stage of the proposed methodology is presented in the following subsections.

Fig. 1
figure 1

Block diagram of proposed methodology for denoising of ECG signal

Stage 1: phase assignment

The phase is used as second observation in addition to the noisy ECG signal. The phase can be used for the estimation of mean amplitude, standard deviation and mean phase of the ECG. The mean amplitude and mean phase of the ECG will be useful for estimation of the phase, width and amplitude of P, Q, R, S and T wave by using the DE technique. These phase and width values of P, Q, R, S and T wave and it’s corresponding amplitude related to the mean amplitude and the mean phase of the ECG will be also useful for the state equation in the EKS. The standard deviation of the noisy ECG will be also useful for the measurement equation of the EKS. This phase information helps us to synchronize the EKS without manual synchronization according to the noisy ECG signal.

The main aim of the first stage is to calculate additional observation phase according to the detected R peak from the noisy ECG signal.

Here Shannon energy envelope with Hilbert transform technique (SEHT) [19] has been used for the R peak detection from the ECG signal. The SEHT method shows better accuracy of R peak detection from the noisy ECG recordings with varying QRS complex like the ECG recording with low amplitude, wide QRS complex, muscle artifact and noise. This method does not require any amplitude threshold and prior knowledge of the past detected R peak. The SEHT method shows better accuracy in the R peak detection than other methods using MIT-BIH arrhythmia database [19]. The extended Kalman smoother (EKS) requires very precise locations of the R peaks for accurate estimation.

The phase corresponds to each sample of the noisy ECG has been assigned by using the location of the detected R peaks in the noisy ECG signal. The phase of the ECG is in the range −π to π.

Here \({{\varphi }}_{k} =\) phase of ECG at sample instant k.

The phase assignment process is a linear warping of phase from −π to π between two detected R peaks. The detail description of the phase assignment process is described in the paper [20].

The assignment of phase to each sample of the abdominal ECG and the normalized noisy ECG signal is represented in Fig. 2.

Fig. 2
figure 2

Phase assignment approach of normalized ECG of first channel from 100 m MIT-BIH arrhythmia database

The explanation of the phase assignment with an example is demonstrated below.

Let us assume two consecutive R-peaks are at the 100th and 300th sample of the abdominal ECG signal. So phase at 100th sample and 300th samples are zero. \({{\varphi }}_{100} = 0,\;{{\varphi }}_{300} = 0\).

So number of samples between the two R peaks = 300 − 100 = 200.

∴  \({{\varphi }}_{101} =\) is \(\frac{2\pi }{200}\) more than \({{\varphi }}_{100}\). Similarly \({{\varphi }}_{102}\) is \(\frac{2\pi }{200}\) more than \({{\varphi }}_{101}\). This process continues up to \({{\varphi }}_{299}\). A similar procedure is also followed to calculate the phase of all samples of the noisy ECG signal.

Stage 2: template extraction

In this stage, the template of the ECG (mean amplitude, standard deviation and mean phase of the ECG) are extracted. The state equation of the EKS uses the synthetic dynamic model [21], for this dynamic model parameters (amplitude, width, and phase of P, Q, R, S and T wave of the ECG), process noise covariance matrix and measurement noise covariance matrices are required for the implementation of the EKS. These dynamic model parameters and noise covariance matrices are estimated from the standard deviation, mean amplitude and mean phase of the noisy ECG.

The mean phase of the ECG consists of fs (value of sampling frequency) number of samples. The MIT-BIH arrhythmia database has been used for evaluation of result, as the sampling frequency of this database is 360 HZ, so the number of samples for the mean phase of the ECG is 360. The assigned value for the first sample of the mean phase of ECG is −π. Then other samples of the mean phase of ECG is assigned a phase \(\frac{2\pi }{fs}\) more than the phase of the previous samples.

The mean amplitude of the ECG is calculated by using the mean phase, phase assignment and the noisy ECG. The mean amplitude of the ECG signal consists of fs number of samples. The first sample of the mean amplitude of the ECG is the mean of the samples of the noisy ECG where phase of the noisy ECG is −π.

The value of the mean amplitude of the ECG of other samples except the first sample is explained as follows. Initially, estimate all the sample numbers from the phase assignment to the ECG, where the assigned phase is more than the value of the mean phase of previous sample and less than or equal to the value of the corresponding sample. The mean amplitude value at the corresponding sample is the average value of the calculated samples from the noisy ECG signal. The explanation of the calculation of mean amplitude of ECG at sample instant with an example is demonstrated below.

The process for estimation of second sample of mean amplitude of ECG is described as follows:

The second sample value of mean phase of ECG is \(\frac{ - 358\pi }{360}\) (here sampling frequency = fs = 360), let us consider the phase value of samples 500, 501, 502, 680, 681, 682, 820, 821, 822, 1235, 1236, 1237 are more than −π [previous sample (first sample)] and less than or equal to \(\frac{ - 358\pi }{360}\) [corresponding sample (second sample)]. Finally, the second sample value of the mean amplitude ECG is average amplitude value of the calculated samples (500, 501, 502, 680, 681, 682, 820,821, 822, 1235, 1236 and 1237) from the noisy ECG signal.

The standard deviation of the ECG is calculated similarly as mean of the ECG, but in the standard deviation of the ECG, the standard deviation of the estimated samples according to the phase and the mean phase is calculated in the place of average [18].

The mean and standard deviation of the noisy ECG signal is shown in Fig. 3. The error bar in this figure represents the standard deviation with respect to the mean amplitude of ECG. The DE algorithm uses the mean amplitude of the ECG signal for the objective function. The standard deviation of the ECG is used for the creation of the process and noise covariance matrices.

Fig. 3
figure 3

Mean and standard deviation of first channel from 100 m MIT-BIH arrhythmia database

Stage 3: optimized parameters estimation

The main aim of the application of DE (optimized parameters estimation stage) is to minimize the objective function and find the optimize parameter (phase value, amplitude value and width value of the noisy ECG components such as P, Q, R, S and T wave), which will be useful for the state equation in the EKS. The objective function of the DE calculates the mean square error with the help of the mean ECG signal and the synthetic dynamic model [21].

Basic about DE

The differential evolution (DE) algorithm [22] is a population-based search technique. DE consists of four stages namely initialization, mutation, crossover and selection [23, 24]. The main aim of the DE algorithm is to evolve a population of NP, D dimensional parameter vectors (target vectors), which encodes the candidates solutions, i.e. \(X_{{i,G}}= \{ x_{i,G}^{1} ,x_{i,G}^{2} , \ldots ,x_{i,G}^{D} \}\quad {\text{for}}\,\,i = 1,2,3,\ldots,NP.\) In the initialization stage, the target vector is initialized by uniformly randomizing individuals within the search space between minimum and maximum parameter bounds. \(X_{\hbox{min} } = \{ {x_{\hbox{min} }^{1} ,x_{\hbox{min} }^{2} , \ldots , x_{\hbox{min} }^{D} } \}\;{\text{and}}\;X_{\hbox{max} } = \{ {x_{\hbox{max} }^{1} , x_{\hbox{max} }^{2} , \ldots , x_{\hbox{max} }^{D} } \}\). In the mutation stage, the mutation vector is produced with respect to each target vector by using positive control parameter of scaling [scaling factor (F)]. In this work DE/rand/1 is used as a basic mutation strategy for the creation of mutant vector. In the crossover stage trail vector is generated using the target vector and corresponding mutant vector with the help of user specified parameter [CR (within the range [0,1])]. Here the binomial (uniform) crossover has been used. In the selection stage, initially, some parameters which exceed upper and lower bound of the perspective field are reinitialized within the perspective field range. Finally comparing the target vector and corresponding trial vector the target vector for next generation will be replaced by the minimum value between these two. The above three steps (mutation, crossover, and selection) are repeated generation after generation until some specific termination criteria are satisfied. Finally, an optimum solution corresponds to the objective function in the search space is achieved using DE.

Application of DE in the proposed methodology

In the proposed methodology, synthetic dynamic ECG model [21] has been used for estimation of the ECG components from the given noisy ECG signal. The ECG signal is expressed as a sum of five Gaussian functions (P, Q, R, S, and T) expressed by their phase, amplitude and width (θ i , α i , b i ). The equation of the synthetic dynamic model is shown as follows:

$$\begin{aligned}& {\text{Amplitude}}\;{\text{of}}\,{\text{ECG}}\,{\text{signal}} \\&\quad= Z_{k} = - \sum\limits_{{i \in W = \{ P,Q,R,S,T\} }} {\frac{{\alpha_{i} w(\theta_{k} - \theta_{i} )}}{{b_{i}^{2} }}} \exp \left( {\frac{{ - (\theta_{k} - \theta_{i} )^{2} }}{{2b_{i}^{2} }}} \right) \\&\quad\quad\quad\quad+ Z_{k - 1}\end{aligned}$$
(1)

Here w = angular frequency = \(\frac{1}{T}\), where T = Time interval between two consecutive R peaks.

The main aim of this stage is to estimate the optimized phase components (θ P , θ Q , θ R , θ S , θ T ) and optimized width of the noisy ECG (b P , b Q , b R , b S , b T ), which will be useful for the estimation of covariance of the process noise and state vector estimation by minimizing the objective function (mean square error).

Equation (1) has been used for the calculation of objective function (mean square error).

Here, θ k is considered as the phase of mean ECG (\(\overline{ECG}\)). b i is the width of the five Gaussian functions P, Q, R, S, T of the noisy ECG. For the estimation of optimized width of five Gaussian function of the ECG (b P , b Q , b R , b S , b T ) will vary in the range 0.1–0.4, 0.01–0.25, 0.01–0.25, 0.01–0.25 and 0.1–0.5 [21] respectively. For the estimation of optimized phase θ P , θ Q , θ R , θ S , θ T will evolve in the range \(\frac{ - \pi }{3} \pm 0.2,\frac{ - \pi }{12} \pm 0.2,0 \pm 0.2,\frac{\pi }{12} \pm 0.2,\frac{\pi }{3} \pm 0.2\) [21] respectively. α P , α Q , α R , α S , α T are the amplitude of \(\overline{ECG}\) corresponding to θ P , θ Q , θ R , θ S , θ T respectively and Z 0 = 0. Finally the objective function (mean square error) is computed after estimation of Z k for k = 1 to N, where N = length of the mean ECG, \({\text{error}}_{k} = \overline{ECG}_{k} - Z_{k}\) and objective function = mean square error = \(\frac{1}{N}\sum\limits_{k = 1}^{N} {\left( {\mathop {error}\nolimits_{k} } \right)}^{2} .\)

For this process DE should evolve along NP 10 dimensional vectors with minimum parameters bound = \(X_{\hbox{min} } = \left[ {\frac{ - \pi }{3} - 0.2,\frac{ - \pi }{12} - 0.2, - 0.2,\frac{\pi }{3} - 0.2,\frac{\pi }{12} - 0.2,0.1,0.01,0.01,0.01,0.1} \right]\) and maximum parameters bound = \(X_{\hbox{max} } = \left[ {\frac{ - \pi }{3} + 0.2,\frac{ - \pi }{12} + 0.2,0.2,\frac{\pi }{3} + 0.2,\frac{\pi }{12} + 0.2,0.4,0.25,0.25,0.25,0.5} \right]\)

After initialization by using the objective function, computation of the DE is performed as explained above. Finally, the optimized phase components value θ P , θ Q , θ R , θ S , θ T , its amplitude corresponds to \(\overline{ECG}\) as α P , α Q , α R , α S , α T , and optimized width of the ECG as b P , b Q , b R , b S , b T have been obtained. Which will be used for application of the EKS technique.

The optimized ECG phase and width component to model the ECG for one cycle has been estimated, by using 50 runs number of population = NP = 110, positive control parameter for scaling = F = 0.3, user specified parameters = CR = 0.8 and finally using these values, the convergence achieved at 648 iterations by using the fitness function (fitness value) as shown in Fig. 4. Here, the fitness value is mean square error that is used to conclude how close the solution is minimizing the mean square error.

Fig. 4
figure 4

Estimation of iteration at which convergence occurs, using NP = 110, CR = 0.8 and F = 0.3 for 50 run

Stage 4: filtering framework

In this stage, the denoised ECG from the noisy ECG signal has been estimated by using the EKS technique. The reason behind the use of the EKS for the estimation of the denoised ECG is due to the nonlinear transformation of five Gaussian functions (P, Q, R, S and T wave) of the ECG signal.

Basic about EKS

The Kalman filter (KF) used to estimate the hidden state using measured data and appropriate dynamic model. The dynamic model is created with the help of system dynamics. The Kalman filter assumes linear relationship between measured data and system dynamics [25]. However, the natures of most of the systems are nonlinear. The extended Kalman filter (EKF) is used in nonlinear systems as it assumes the nonlinear relationship between the measured data and the system dynamics.

The extended Kalman smoother (EKS) consists of two stages. The first stage is EKF operation, the second stage is backward recursive smoothing algorithm. Here in the EKS fixed interval smoothing stage has been used [25].

The EKF consists of two vectors, one is state vector S k and another one is observation vector Y k at instant k. EKF consists of state equation and measurement equation. The equation model for EKF is shown as follows [16, 25]:

$${\text{State equation}} = S_{k + 1} = g\left( {S_{k} } \right) + A_{k}$$
(2)
$${\text{Measurement equation}} = Y_{k + 1} = h\left( {S_{k + 1 } } \right) + B _{k + 1}$$
(3)

where g(.) is the state evaluation function and h(.) shows the relationship between the observation vectors or measurement vectors and the state vectors. The process noise vector is A k . Measurement noise vector is B k . The process noise covariance matrix = \(\mathop Q\nolimits_{k} = E\left\{ {\mathop A\nolimits_{k} \mathop A\nolimits_{k}^{T} } \right\}\). The measurement noise covariance matrix = \(\mathop R\nolimits_{k} = E\left\{ {\mathop B\nolimits_{k} \mathop B\nolimits_{k}^{T} } \right\}\). In the EKF or EKS, the initial state vector is assumed, and it’s error covariance is \(P_{0} = E\{ (S_{0} - \hat{S}_{0} )(S_{0} - \hat{S}_{0} )^{T} \}\). The computation steps for solving the above equations are as described in the paper [25].

Here k varies from 0 to N where N = number of samples.

The predictable part of \(S_{k + 1} = \bar{S}_{k + 1} = g(\hat{S}_{k} )\). Where \(\hat{S}_{k}\) is an optimal estimate of S k .

Finally, \(\bar{S}_{k + 1}\) is estimated by using EKF. The backward recursive smoothing stage is applied on the output of EKF (\(\bar{S}_{k + 1}\)) is known as EKS, gives the better estimate of the current state.

Application of EKS in the proposed methodology

The first step of EKS is state equation. Here in the creation of state equation, simplified dynamic ECG model has been used. The description of use of simplified dynamic model in the state equation is as follows:

The simplified ECG dynamic model with small sampling period (δ) [16] is shown as follows:

$$\theta {}_{k + 1} = (\theta_{k} + w\delta )\bmod \left( {2\pi } \right)$$
(4)
$$Z_{k + 1} = - \sum\limits_{{i \in W = \{ P,Q,R,S,T\} }} {\frac{{\alpha_{i} (\Delta \theta_{i,k} )w\delta }}{{b_{i}^{2} }}\exp \left( {\frac{{ - (\Delta \theta_{i,k} )^{2} }}{{2b_{i}^{2} }}} \right)} + Z_{k} + \eta$$
(5)

Here \(\Delta \theta_{i,k} = (\theta_{k} - \theta_{i} )\bmod (2\pi )\) and w = angular frequency, η is additive random noise. The summation i is taken over the five Gaussian function (P, Q, R, S and T) for modelling the shape of desired ECG signal present in the noisy ECG signal.

Here, θ k and Z k are the state variables, and w, α i , θ i , b i and η are process noises. To map the notation of Eq. (2), the state vector and the process noise vectors are represented as follows:

$$\begin{aligned} \mathop S\nolimits_{k} &= \left[ {\mathop \theta \nolimits_{k} ,\mathop Z\nolimits_{k} } \right]^{T} ,\\ A_K&=\alpha_P, \alpha_Q, \alpha_R, \alpha_S, \alpha_T, b_P, b_Q, b_R, b_S, b_T, \theta_P, \theta_Q, \theta_R, \theta_S, \theta_T, \omega,\eta.\end{aligned}$$

The process noise covariance matrix is given as \(\mathop Q\nolimits_{k} = E\left\{ {\mathop A\nolimits_{k} \mathop A\nolimits_{k}^{T} } \right\}\). α i , θ i , b i are the values estimated by using DE are used in Eq. (5) and in the estimation of process noise covariance matrix (Q k ).

The second step of the EKS is measurement equation as shown in Eq. (3)

Measurement data \(Y_{k + 1} = \left[ {\begin{array}{*{20}c} {\varphi_{k + 1} } & {M_{k + 1} } \\ \end{array} } \right]^{T}\), here \(\varphi_{k + 1}\) = phase of the noisy ECG at sample instant k + 1 and M k+1 = amplitude of the noisy ECG at sample instant k + 1.

The measurement function h(S k+1) = S k+1. The first diagonal entry of covariance of measurement noise R k . It indicates the variance of the measurement process noise. The measurement noise covariance matrix is a diagonal matrix consists of standard deviation of the ECG signal.

In the initialization stage, the initial state \(\hat{S}_{o}\) and initial covariance P 0 is assumed as follows:

$$\begin{aligned} \hat{S}_{0} &= \left[ {\begin{array}{*{20}c} { - \pi } & 0 \\ \end{array} } \right]^{T} \\ P_{0} &= \left[ {\begin{array}{*{20}c} (2\pi )^{2} &\quad 0 \\ 0 &\quad {10\hbox{max} (|M|)^{2} } \end{array} } \right]\end{aligned}$$

The final stage of the EKS is computation. The EKS computation process is used as explained in the paper [25]. The result of EKS is the noise cancelled ECG signal.

Results

The performance of the proposed denoising technique is evaluated by using the first channel of data numbered as 100, 103, 104, 105, 106, 115 and 215 from the MIT-BIH arrhythmia database [26]. The MIT-BIH arrhythmia database consists of 48 recording. Each recording consists of two channels. The sampling frequency of the ECG signal is 360 Hz.

Here, three types of noisy ECG signals have been generated at desired SNR by generating three types of noises (white Gaussian noise, colored Gaussian noise and real muscle artifact from the MIT-BIH noise stress data base [26]) signals by using signal power of the actual ECG signal and desired SNR as explained in the paper [16]. Finally, the white Gaussian noise added noisy ECG signal, colored noise added noisy ECG signal and real muscle artifact added noisy ECG signal have been generated at desired SNR by adding generated white Gaussian noise, colored Gaussian noise and real muscle artifact signal at desired SNR to the actual ECG signal. In the performance evaluation of denoising technique, the noise has added to the actual ECG signal with the requirement of SNR of the noisy signal, varies from −5 to 20 dB (decibel).

To validate the performance of the proposed denoising technique (EKS + DE, EKF + DE), have been compared with six other existing techniques. The techniques are extended Kalman filter [16], extended Kalman Smoother (EKS) [16], wavelet soft threshold technique [9], non-local mean (NLM) [15], adaptive filtering [6, 7], and conventional filtering [4, 27].

The proposed method is implemented in MATLAB R 2012A.

Qualitative analysis

Figures 5 and 7 present the comparison of different denoising methods for removal of added white Gaussian noise and real muscle artifact respectively to the first channel of 215 dataset from MIT-BIH arrhythmia database at 5 dB SNR. Similarly, Fig. 6 presents the comparison of different denoising methods for removal of the added colored Gaussian noise to the first channel of 115 dataset from MIT-BIH arrhythmia database at 5 dB SNR. All the three figures (Figs. 5, 6, 7) show the proposed method (EKS + DE) shows very similar result to the original ECG signal, and it has very lesser distortion compared to the other techniques. The figures show that the proposed method (EKS + DE) properly denoised or removed the added different noises (white Gaussian noise, colored Gaussian noise and muscle artefact) to the original ECG signal.

Fig. 5
figure 5

Comparison of different denoising method for removal of added white Gaussian noise to 215 dataset from MIT-BIH arrhythmia database at 5 dB SNR, (a) original ECG, (b) noisy ECG signal, (c) EKS + DE, (d) EKF + DE, (e) EKS, (f) EKF, (g) wavelet soft threshold technique, (h) NLM, (i) adaptive filtering, (j) conventional filtering

Fig. 6
figure 6

Comparison of different denoising method for removal of added colored Gaussian noise to 115 dataset from MIT-BIH arrhythmia database at 5 dB SNR, (a) original ECG, (b) noisy ECG signal, (c) EKS + DE, (d) EKF + DE, (e) EKS, (f) EKF, (g) wavelet soft threshold technique, (h) NLM, (i) adaptive filtering, (j) conventional filtering

Fig. 7
figure 7

Comparison of different denoising method for removal of added real muscle artifact to 215 dataset from MIT-BIH arrhythmia database at 5 dB SNR, (a) original ECG, (b) noisy ECG signal, (c) EKS + DE, (d) EKF + DE, (e) EKS, (f) EKF, (g) wavelet soft threshold technique, (h) NLM, (i) adaptive filtering, (j) conventional filtering

Quantitative evaluation

To evaluate the performance of the denoising technique, the SNR improvement (SNR imp ) in dB, mean square error (MSE) and percent of distortion (PRD) are calculated. The formulations of these parameters are shown as follows.

$$\mathop {SNR}\nolimits_{imp} = 10\mathop {\log }\nolimits_{10} \left[ {\frac{{\sum\nolimits_{n = 1}^{N} {\mathop {\left( {y(n) - x(n)} \right)}\nolimits^{2} } }}{{\sum\nolimits_{n = 1}^{N} {\mathop {\left( {\hat{x}(n)s - x(n)} \right)}\nolimits^{2} } }}} \right]$$
$$MSE = \frac{1}{N}\sum\limits_{n = 1}^{N} {\mathop {\left( {\hat{x} (n) - x(n)} \right)}\nolimits^{2} }$$
$$PRD = 100\sqrt {\frac{{\sum\nolimits_{n = 1}^{N} {\mathop {\left( {\hat{x}(n) - x(n)} \right)}\nolimits^{2} } }}{{\sum\nolimits_{n = 1}^{N} {\mathop x\nolimits^{2} (n)} }}}$$

where x = clean ECG signal, y = noisy ECG signal, \(\hat{x}\) =  estimated clean ECG signal by the denoising technique, N = Number of samples presented in the clean ECG signal.

Here, each denoising technique has been run 50 times at each SNR value for performance evaluation.

Figure 8 shows that, the proposed method (EKS + DE) shows better SNR improvement for removal of added white Gaussian noise compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, adaptive filtering and conventional filtering at different input SNR (−5 to 15 dB). EKS + DE shows nearly similar SNR improvement as wavelet soft threshold technique at 20 dB input SNR.

Fig. 8
figure 8

Comparison of mean SNR improvement of different denoising methods for removal of added white Gaussian noise to different ECG signal at different input SNR

Figure 9 shows that, the proposed method (EKS + DE) shows similar SNR improvement for removal of added colored Gaussian noise as adaptive filtering technique at input SNR −5 dB. But it shows better SNR improvement at other input SNR (0–20 dB). EKS + DE shows better SNR improvement for removal of added colored Gaussian noise compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, and conventional filtering at different input SNR (−5 to 20 dB).

Fig. 9
figure 9

Comparison of mean SNR improvement of different denoising methods for removal of added colored Gaussian noise to different ECG signal at different input SNR

Table 1 shows that, the proposed method (EKS + DE) shows similar SNR improvement for removal of added muscle artifact as conventional filtering technique at input SNR −5 dB. But it shows better SNR improvement at other input SNR (0–20 dB). EKS + DE shows better SNR improvement for removal of added muscle artifact compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, and adaptive filtering at different input SNR(−5 to 20 dB).

Table 1 Comparison of mean SNR improvement of different denoising methods for removal of added real muscle artifact to different ECG signal at different input SNR

Figure 10 shows that the proposed method (EKS + DE) shows better SNR improvement for removal of added white Gaussian noise to different ECG signals at −5 dB input SNR compared to other existing denoising techniques by using different dataset from the MIT-BIH arrhythmia database.

Fig. 10
figure 10

Comparison of SNR improvement of different denoising methods for removal of added white Gaussian noise to different ECG signal at −5 dB SNR

Figure 11 shows that, the proposed method (EKS + DE) shows lesser MSE for removal of added white Gaussian noise compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, adaptive filtering and conventional filtering at different input SNR (−5 to 10 dB). EKS + DE shows nearly MSE for removal of added white Gaussian noise as wavelet soft threshold technique, NLM at 15 and 20 dB input SNR.

Fig. 11
figure 11

Comparison of mean MSE (mean square error) of different denoising methods for removal of added white Gaussian noise to different ECG signal at different input SNR

Figure 12 shows that, the proposed method (EKS + DE) shows similar MSE for removal of added colored Gaussian noise as adaptive filtering technique at input SNR −5 dB. But it shows lesser MSE at other input SNR (0–20 dB). EKS + DE shows lesser MSE for removal of added colored Gaussian noise compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, and conventional filtering at different input SNR (−5 to 20 dB).

Fig. 12
figure 12

Comparison of mean MSE (mean square error) of different denoising methods for removal of added colored Gaussian noise to different ECG signal at different input SNR

Table 2 shows that, the proposed method (EKS + DE) shows lesser MSE for removal of added muscle artifact compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, adaptive filtering and conventional filtering at different input SNR(−5 to 20 dB).

Table 2 Comparison of mean MSE (mean square error) of different denoising methods for removal of added real muscle artifact to different ECG signal at different input SNR

Table 3 show that the proposed method (EKS + DE) shows the lesser standard deviation of MSE for removal of added white Gaussian noise at different SNR compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, adaptive filtering and conventional filtering.

Table 3 Comparison of standard deviation of MSE (mean square error) of different denoising methods for removal of added white Gaussian noise to different ECG signal at different input SNR

Figure 13 shows that, the proposed method (EKS + DE) shows lesser PRD for removal of added white Gaussian noise compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, adaptive filtering and conventional filtering at different input SNR (−5 to 20 dB).

Fig. 13
figure 13

Comparison of mean PRD (percentage of distortion) of different denoising methods for removal of added white Gaussian noise to different ECG signal at different input SNR

Figure 14 shows that, the proposed method (EKS + DE) shows similar PRD for removal of added colored Gaussian noise as adaptive filtering technique at input SNR −5 dB. But it shows lesser PRD at other input SNR (0–20 dB). EKS + DE shows lesser MSE for removal of added colored Gaussian noise compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, and conventional filtering at different input SNR (−5 to 20 dB).

Fig. 14
figure 14

Comparison of mean PRD (percentage of distortion) of different denoising methods for removal of added colored Gaussian noise to different ECG signal at different input SNR

Table 4 shows that, the proposed method (EKS + DE) shows lesser PRD for removal of added muscle artifact compared to EKF + DE, EKS, EKF, wavelet soft threshold technique, NLM, adaptive filtering and conventional filtering at different input SNR (−5 to 20 dB).

Table 4 Comparison of mean PRD (percentage of distortion) of different denoising methods for removal of added muscle artifact to different ECG signal at different input SNR

Table 5 shows that the proposed method shows the lesser percentage of distortion (PRD) for removal of added white Gaussian noise to different ECG signals at 5 dB input SNR compared to the other existing denoising techniques.

Table 5 Comparison of PRD of different denoising methods for removal of added colored Gaussian noise to different ECG signal at 5 dB input SNR

From the above quantitative evaluation, the proposed method (EKS + DE) shows better SNR improvement, lesser MSE, and PRD compared to the other existing techniques at different SNR and different noises (adding white Gaussian noise, colored Gaussian noise and muscle artifact).

Discussion

The performance evaluation carried out in the result section shows the noise cancellation is important for obtaining clear and useful ECG signal. This is due to, as the ECG signals are non-stationary, and the statistical property of the added noise is complicated because of the complexity of the signal. Different techniques such as conventional filtering (bandpass filter), adaptive filtering, wavelet soft threshold denoising, NLM, EKF, and EKS have been proposed to denoise the noise contaminated ECG signal, but these techniques contain distortions in the result that do not similar to the original ECG signal. Besides, they do not achieve an accurate noise reduction and over filtering the ECG signals can remove the relevant medical information. The proposed method (EKS + DE) has improved all results obtained by the previous methods reducing the noise significantly and shows the similar result to the original ECG signal as shown in the qualitative analysis subsection.

The EKS + DE approach uses state equation [Eq. (2)], measurement equation [Eq. (3)], simplified dynamic model equation [Eqs. (4) and (5)] and process noise covariance matrix (Q k ) for denoising the ECG signal at particular noise level. The state equation, dynamic model and the process noise covariance matrix consist of parameters (phase, amplitude and width (θ i , α i , b i ) of five Gaussian components (P, Q, R, S and T wave)). The perfect initialization of these parameters (θ i , α i , b i ) in the state equation, simplified dynamic model and process noise covariance matrix is required for better estimation denoised ECG signal. However, in the EKS approach nonlinear least square (lsqnonlin) technique is used to initialize the parameters (θ i , α i , b i ), so it sometimes requires operator interaction for initialization of these parameter depend up on the ECG signal. Whereas the EKS + DE approach estimate (θ i , α i , b i ) from the noisy signal itself using DE, so it gives better estimate than EKS approach. The EKS + DE technique uses forward EKF by using DE and followed by backward recursive smoothing stage. So EKS + DE gives smoother denoised ECG signal compared to the EKF + DE technique.

SNR improvement evolution has been more constant and more linear with the EKS + DE because the proposed method has introduced the lowest distortion to the ECG signal. The EKS + DE has automated selection procedure to select the components from the noisy ECG signal using DE, so it has cancelled the different types of noise and achieved higher SNR improvement and lower MSE and PRD at low input SNR (−5 to 15 dB) as shown in the quantitative evaluation subsection. The proposed method EKS + DE shows similar SNR improvement, MSE and PRD at higher input SNR (20 dB).

The performance of EKS + DE shows better SNR improvement, lesser MSE and PRD at different input SNR due to the perfect initialization of measurement noise covariance matrix (R k ). Measurement noise covariance matrix (variance of the measurement noise) is a diagonal matrix consist of standard deviation of the ECG signal. Which is calculated from the ECG signal. The measurement noise covariance matrix is calculated without any adaptation strategy, this avoid the overestimation of the covariance matrix.

The EKS + DE approach is based on phase assignment as an additional observation to the ECG signal for automatic synchronization and good performance of the EKS. The phase assignment is based on the detection of the R peak. So indirectly, the performance and automatic synchronization of the EKS + DE depends on the detection of R peak. Here Shannon energy envelope with Hilbert transform technique (SEHT) has been used for the R peak detection from the ECG signal. The SEHT method shows better accuracy of the R peak detection for the noisy ECG recordings with varying QRS complex like the ECG recording with low amplitude, wide QRS complex, muscle artifact and noise. This method does not require any amplitude threshold and prior knowledge of the past detected R peak. The SEHT method shows better accuracy in the R peak detection than other methods. As the EKS + DE uses the SEHT for detection of the R peak, so it shows better SNR improvement at varying QRS complex and noisy ECG signal.

The proposed methodology has a time period of transient effect is equal to the time period (length) of fixed interval backward recursive smoother. The EKS part of the proposed methodology (EKS + DE) consists of forward EKF followed by backward recursive smoother. The forward EKF part has no transient effect due to proper initialization of the process noise covariance matrix (Q k ) and the measurement noise covariance matrix (R k ). These matrices are initialized with the help of the DE algorithm and calculation of the standard deviation of the ECG signal respectively. However, due to the fixed interval backward recursive smoother, EKS require time period (length) equal to the time period of the fixed interval backward recursive smoother to come to the steady state from the starting sample.

SNR improvement of the filter technique is inversely proportional to the mean square of the subtracted clean ECG signal from the output of the filter. As the proposed methodology has a time period of the transient effect is equal to the time period of the fixed interval backward recursive smoother. Due to this time period of the transient effect, there may be a small decrease in the SNR improvement, because we consider the time period of the fixed interval backward recursive smoother is small. Generally, the transient effect is ignored for calculation of SNR improvement. In the case of ignorance of the transient effect, SNR improvement of the proposed methodology (EKS + DE) is better.

The limitation of the proposed methodology (EKS + DE) is, it may give a lower performance for denoising the ECG signal at lower sampling frequency compared to the ECG signal at the higher sampling frequency.

The results have demonstrated that proposed technique (EKS + DE) can serve as new framework for achieving an efficiently denoise the ECG signal. Moreover, the results of this study have suggested that the clinical information can be maintained by the proposed denoising technique.

Conclusion

In this paper, DE technique is used with the synthetic dynamic model within an EKS framework for denoising the noisy ECG signal. The performance of the proposed method has been tested at different SNR by adding different noises (white Gaussian noise, colored Gaussian noise and real-time muscle artefact from the MIT-BIH noise stress database) to the first channel of the seven datasets (100, 103, 104, 105, 106 115, and 215) from the MIT-BIH arrhythmia database. According to the obtained results, as long as the R peaks are correctly detected, the proposed method claims its better SNR improvement. Here, the Shannon energy has been used with Hilbert transform method for R peak detection.

The proposed method (EKS + DE) shows better SNR improvement as compared to the other existing techniques like EKF, EKS, wavelet soft threshold technique, non-local mean (NLM), adaptive filtering and conventional filtering at different SNR. The proposed method (EKS + DE) also shows lesser mean square error (MSE) and percentage of distortion (PRD) compared to the other mentioned existing techniques at different SNR.