ECG Noise Cancellation Based on Grey Spectral Noise Estimation

In recent years, wearable devices have been popularly applied in the health care field. The electrocardiogram (ECG) is the most used signal. However, the ECG is measured under a body-motion condition, which is easily coupled with some noise, like as power line noise (PLn) and electromyogram (EMG). This paper presents a grey spectral noise cancellation (GSNC) scheme for electrocardiogram (ECG) signals where two-stage discrimination is employed with the empirical mode decomposition (EMD), the ensemble empirical mode decomposition (EEMD) and the grey spectral noise estimation (GSNE). In the first stage of the proposed GSNC scheme, the input ECG signal is decomposed by the EMD to obtain a set of intrinsic mode functions (IMFs). Then, the noise energies of IMFs are estimated by the GSNE. When an IMF is considered as noisy one, it is forwarded to the second stage for further check. In the second stage, the suspicious IMFs are reconstructed and decomposed by the EEMD. Then the IMFs are discriminated with a threshold. If the IMF is considered as noisy, it is discarded in the reconstruction process of the ECG signal. The proposed GSNC scheme is justified by forty-three ECG signal datasets from the MIT-BIH cardiac arrhythmia database where the PLn and EMG noise are under consideration. The results indicate that the proposed GSNC scheme outperforms the traditional EMD and EEMD based noise cancellation schemes in the given datasets.


Introduction
The wearable device has been widely studied in recent years. In the related researches, it is essential to monitor the cardiac and physical activities in users with congestive heart issues at home. The electrocardiogram (ECG) is an important signal in monitoring the cardiac activity. A Holter ECG device is frequently applied to record long-term ECG signals and helps to find arrhythmic heartbeats within twenty-four hours [1]. Another apparatus is called an Event Recorder that is able to record one-minute ECG signals when a user feels uncomfortable on the chest region [2]. Currently, the commercial Holter ECG apparatus or Event Recorder only record the ECG signals, and is lacking in the real time analysis of the ECG signals. Moreover, the user has been encouraged to neither do any severe exercises nor take a shower, because these two kinds of devices do not have a high ingress protection rating.
An ECG patch is a wearable device, which not only records ECG signal, but also shows some cardiac information on the smart phone in real time [3]. However, its function for the arrhythmic the EEMD and the grey spectral noise estimation (GSNE) are employed. In the first stage, the EMD decomposes the input ECG signal into IMFs. Then the GSNE is used to estimate noise in IMFs and calculate the related noise energies through its noise magnitude spectrum. By a user-defined threshold, noisy IMFs are identified and put into the second stage. In the second stage, the noisy IMFs are reconstructed and decomposed by the EEMD. Then the IMFs are rechecked in a similar manner to the first stage. If an IMF is considered as noisy, it is discarded. The procedure is repeated for each IMF. At last, the ECG signal is reconstructed with all retained IMF components. To evaluate the performance, a noise energy ratio in dB (NER dB ) is employed in this paper.
This paper is organized as follows. Section 2 describes the ECG signals with additive noise and the ECG signal decomposition algorithms, the EMD and the EEMD. Section 3 introduces the GSNE based on the first-order grey model of one variable, GM(1,1) model [22,23], and then describes how the GSNE is applied to ECG noise cancellation. Next, the proposed GSNC scheme is introduced in Section 4. In Section 5, the proposed GSNC scheme is justified by forty-three datasets from the MIT-BIH database [24]. Discussions about the EMD, the EEMD and the proposed GSNC are given in Section 6. Finally, the conclusion is given in Section 7.

The ECG Signal, EMD and EEMD
In this section, the ECG signals with additive noise, the EMD and the EEMD for the ECG signals used in the proposed GSNC scheme are described in the following.

ECG Signal
In this paper, the real ECG signals are from the cardiac arrhythmia database in the MIT-BIH database [24] from which datasets are selected. Each dataset has a continuous period of 30 minutes with the sampling frequency of 360 Hz. The ECG signals in the database were processed by the Butterworth filter with bandwidth from 0.3 Hz to 40 Hz. The processed ECG signal is considered as clean ECG signal, s(k). The PLn and EMG noise are added into s(k) where the PLn is generated from the sinusoidal wave with frequencies from 59.5 Hz to 60.5 Hz and the sampling frequency of 360 Hz. As for the EMG noise, its bandwidth is from 100 Hz to 500 Hz with the sampling frequency 1,000 Hz. The additive noise, the PLn or EMG noise, is denoted as n(k). And the noisy ECG signal is denoted as x(k) which is expressed as x(k) = s(k) + n(k). (1) In this paper, the signal-to-noise ratio (SNR) from −5 dB to 20 dB is under consideration whose definition is given as where N s is the length of s(k).

The EMD Algorithm
This subsection briefly reviews the EMD which will be applied to decompose an ECG signal in the proposed GSNC scheme. For details, one may consult [15]. The EMD algorithm consists of the following steps.
Step 1. Find the local maxima and minima in x(k).
Step 2. Obtain the upper envelope by the local maxima and the lower envelope by local minima, respectively.
Step 3. Calculate the average of the upper and lower envelops, m(k).
Step 5. Check if d(k) is a zero-average process. If yes, then stop and treat d(k) as the first-order IMF (IMF 1), denoted as c 1 (k); otherwise, replace x(k) with d(k) and go back to Step 1.
Step 7. Replace x(k) with r(k) and repeat Step 1 to Step 6 to find the second-order IMF (IMF 2), i.e., c 2 (k). Step 8. Repeat Step 1 to Step 7 till c M (k) is obtained where M is the total number of IMFs.
After the EMD, the original signal can be expressed as where r(k) is generally considered as c M+1 (k).

The EEMD Algorithm
Here, the EEMD algorithm is briefly reviewed. For details, one may consult [18]. The EEMD algorithm is given in the following.
Step 1. Add a white noise sequence w(k) into the target signal x(k), i.e., x 1 (k) = x(k) + w(k). In this study, noise with SNR = 5 dB is used which will be verified in Section 5.1.
Step 2. Apply the EMD algorithm to decompose x 1 (k), as described in Section 2.2.
Step 3. Repeat Steps 1 and 2 until the predefined number of trials, N T , is reached. Each trial uses the same noise power level. Then a set of IMF components c ij (k) is obtained where i is the iteration number and j is the order of IMFs.
Step 4. Calculate the ensemble average of c ij (k) as follows where N T is the total number of trials.

Application of GSNE to ECG Noise Cancellation
In this section, the noise estimation based on a grey model is introduced. Section 3.1 briefly reviews the first-order grey model with one variable, denoted as GM(1,1). Next, the grey spectral noise estimation (GSNE) based on GM(1,1) model is proposed in Section 3.2. Then the way to determine noisy IMFs by the GSNE is given in Section 3.3.

GM(1,1) Model
In this subsection, GM(1,1) model is briefly reviewed. For details, one may refer [22,23]. The GM(1,1) modeling is described in the following. Given a non-negative sequence {x(k), 1 ≤ k ≤ K}, then x(k) is put into the first-order accumulated generating operation (1-AGO) to convert into a new data sequence x (1) (k) as By x(k) and x (1) (k), a grey difference equation is formed as for 2 ≤ k ≤ K, where parameters a and b are called the developing coefficient and the grey input, respectively; and z (1) (k) is the background value and defined as Let and Then (6) can be written as where parameters a and b are found by It can be shown that the solution of x (1) (k) is given as By the first-order inverse accumulated generating operation (1-IAGO), the estimate of x(k),x(k), is obtained asx In the GM (1, 1) modeling, the minimum number of samples is 4, i.e., K = 4.

Grey Spectral Noise Estimation
In this subsection, the grey spectral noise estimation (GSNE) based on GM(1,1) is introduced where an additive signal model is assumed, that is, x(k) = s(k) + n(k) for 1 ≤ k ≤ L, where s(k), n(k), and L stand for the signal component, noise component and the length of x(k), respectively. The block diagram of GSNE is shown in Figure 1 whose implementation steps are given as follows.
Step 1. Level up x(k) by a constant C, i.e., x(k) ← x(k) + C such that the condition x(k) > 0 is met.
, where K is the number of data used in GM(1,1) model. Figure 2 indicates how x(k) is divided into N ss subsets with K = 4 where the square refers to the overlapped sample.
Step 3. For each subset i, obtain the estimate of x i (k),x i (k), by the GM(1,1) model described in Section 3.1. Then,x i (k) is considered as the estimate of s i (k),ŝ i (k), that is,ŝ i (k) =x i (k). Finally, calculate the estimation error of GM(1,1) model as e i (k) = x i (k) −x i (k).
Step 4. Since the additive noise n i (k) is not equal but related to the estimation error e i (k). Consequently, n i (k) is estimated as αe i (k) where α > 0 is the user-defined scaling factor and determined by experiences.   Note that the energy preserving property in Parseval's theorem [25] which proves the sum of the square of ( ), i.e., energy of ( ), is related to the sum of the square of ( ) as Since the standard deviation | ( )| is a statistics of ( ) related to noise energy, it thus can be used as an indicator of noise energy in the IMF under consideration.

Noisy IMF Determination by the GSNE
In this section, the determination of noisy IMFs and the ECG noise cancellation based on the GSNE are described. In the experiment, we randomly select 100 ECG signal segments with the continuous duration of 10 seconds from the mitdb/100 dataset. Then | ( )| is calculated for each of the ECG signals with and without noises. With = 5 dB, Figure 3 shows the differences of | ( )| in IMF 1, i.e., ( ), where ECG denotes the original ECG signal, ECG the ECG signal with the PLn and ECG the ECG signal with EMG noise, respectively. As shown in Figure 3, | ( )| with and without noise has apparently different levels. Besides, the fluctuation is very small both for cases with and without noise. Thus, it gives us a hope to discriminate noisy and non-noisy ( ) by a predefined threshold . According to our experiments, = 10 works well for most cases. If | ( )| > , the related ( ) is considered as noisy and is rechecked further in the proposed GSNC scheme. With the idea, ( ) is modified as ̅ ( ) which is given as for = 1, 2, ⋯ , . By ̅ ( ), the ECG signal after noise cancellation, denoted as ( ), is reconstructed, as follows,  Note that the energy preserving property in Parseval's theorem [25] which proves the sum of the square of ( ), i.e., energy of ( ), is related to the sum of the square of ( ) as Since the standard deviation | ( )| is a statistics of ( ) related to noise energy, it thus can be used as an indicator of noise energy in the IMF under consideration.

Noisy IMF Determination by the GSNE
In this section, the determination of noisy IMFs and the ECG noise cancellation based on the GSNE are described. In the experiment, we randomly select 100 ECG signal segments with the continuous duration of 10 seconds from the mitdb/100 dataset. Then | ( )| is calculated for each of the ECG signals with and without noises. With = 5 dB, Figure 3 shows the differences of | ( )| in IMF 1, i.e., ( ), where ECG denotes the original ECG signal, ECG the ECG signal with the PLn and ECG the ECG signal with EMG noise, respectively. As shown in Figure 3, | ( )| with and without noise has apparently different levels. Besides, the fluctuation is very small both for cases with and without noise. Thus, it gives us a hope to discriminate noisy and non-noisy ( ) by a predefined threshold . According to our experiments, = 10 works well for most cases. If | ( )| > , the related ( ) is considered as noisy and is rechecked further in the proposed GSNC scheme. With the idea, ( ) is modified as ̅ ( ) which is given as for = 1, 2, ⋯ , . By ̅ ( ), the ECG signal after noise cancellation, denoted as ( ), is reconstructed, as follows, Note that the energy preserving property in Parseval's theorem [25] which proves the sum of the square ofn i (k), i.e., energy ofn i (k), is related to the sum of the square of N ( f ) as Since the standard deviation σ |N( f )| is a statistics of N ( f ) related to noise energy, it thus can be used as an indicator of noise energy in the IMF under consideration.

Noisy IMF Determination by the GSNE
In this section, the determination of noisy IMFs and the ECG noise cancellation based on the GSNE are described. In the experiment, we randomly select 100 ECG signal segments with the continuous duration of 10 seconds from the mitdb/100 dataset. Then σ |N( f )| is calculated for each of the ECG signals with and without noises. With SNR = 5 dB, Figure 3 shows the differences of σ |N( f )| in IMF 1, i.e., c 1 (k), where ECG raw denotes the original ECG signal, ECG PLn the ECG signal with the PLn and ECG EMG the ECG signal with EMG noise, respectively. As shown in Figure 3, σ |N( f )| with and without noise has apparently different levels. Besides, the fluctuation is very small both for cases with and without noise. Thus, it gives us a hope to discriminate noisy and non-noisy c i (k) by a predefined threshold τ. According to our experiments, τ = 10 −4 works well for most cases. If σ |N( f )| > τ, the related c i (k) is considered as noisy and is rechecked further in the proposed GSNC scheme. With the idea, c i (k) is modified as c i (k) which is given as for i = 1, 2, · · · , M. By c i (k), the ECG signal after noise cancellation, denoted as y(k), is reconstructed, as follows, In order to justify the fixed threshold = 10 works well for most cases, further experiments are conducted with six MIT-BIH cardiac arrhythmia datasets which are mitdb/100, mitdb/105, mitdb/108, mitdb/203, mitdb/223 and mitdb/228. In the experiments, ECG signal segments with the continuous duration of 10 seconds are randomly selected in the six datasets where = 5 dB both for PLn and EMG noise. The results are shown in Table 1 for the PLn and Table 2 for the EMG noise, respectively. As shown in Table 1, the | ( )| of ( ) decreases as the order of IMF increases and most cases are determined correctly except for mistaken cases. The noisy IMFs considered as clean are shadowed according to the threshold = 10 . The mistaken cases found in IMF 1 are in datasets mitdb/100 and mitdb/223. For those cases, clean IMFs are considered as noisy ones. These mistakes will be rechecked in the second stage of the proposed GSNE scheme described later in Section 4. The mistaken cases found in IMF 4 and IMF 5 consider noisy IMFs as clean ones. The cases are not a major concern since they have little impact on ECG noise cancellation. Thus, they are neglected in this paper. As for the EMG noise, Table 2 shows most of the clean and noisy cases are determined correctly except some cases. Two clean cases are mistaken as noisy happened in IMF 1 in mitdb/100 and in mitdb/223. For those noisy IMFs, the proposed GSNC scheme introduced later in Section 4 will recheck them further. Similar to the PLn cases, most of the noisy cases are considered as clean found in IMF 4 and IMF 5. Since those cases have little effect on the performance for ECG noise cancellation, thus we do not deal with them further. By the results, shown in Tables 1 and 2, the fixed threshold = 10 is justified working well for most cases. In order to justify the fixed threshold τ = 10 −4 works well for most cases, further experiments are conducted with six MIT-BIH cardiac arrhythmia datasets which are mitdb/100, mitdb/105, mitdb/108, mitdb/203, mitdb/223 and mitdb/228. In the experiments, ECG signal segments with the continuous duration of 10 seconds are randomly selected in the six datasets where SNR = 5 dB both for PLn and EMG noise. The results are shown in Table 1 for the PLn and Table 2 for the EMG noise, respectively. As shown in Table 1, the σ |N( f )| of x(k) decreases as the order of IMF increases and most cases are determined correctly except for mistaken cases. The noisy IMFs considered as clean are shadowed according to the threshold τ = 10 −4 . The mistaken cases found in IMF 1 are in datasets mitdb/100 and mitdb/223. For those cases, clean IMFs are considered as noisy ones. These mistakes will be rechecked in the second stage of the proposed GSNE scheme described later in Section 4. The mistaken cases found in IMF 4 and IMF 5 consider noisy IMFs as clean ones. The cases are not a major concern since they have little impact on ECG noise cancellation. Thus, they are neglected in this paper. As for the EMG noise, Table 2 shows most of the clean and noisy cases are determined correctly except some cases. Two clean cases are mistaken as noisy happened in IMF 1 in mitdb/100 and in mitdb/223. For those noisy IMFs, the proposed GSNC scheme introduced later in Section 4 will recheck them further. Similar to the PLn cases, most of the noisy cases are considered as clean found in IMF 4 and IMF 5. Since those cases have little effect on the performance for ECG noise cancellation, thus we do not deal with them further. By the results, shown in Tables 1 and 2, the fixed threshold τ = 10 −4 is justified working well for most cases. x(k) 2.14 × 10 −5 3.13 × 10 −5 1.28 × 10 −5 2.14 × 10 −5 3.65 × 10 −5 1.52 × 10 −5 Figure 4 shows the flowchart of the proposed two-stage ECG noise cancellation scheme based on the GSNE. The proposed scheme is called grey spectral noise cancellation (GSNC). The working flow of the proposed GSNC scheme is described as follows. In the first stage, the input ECG signal is decomposed into a set of IMFs by the EMD. Then the noise spectral energy of IMFs are estimated by the GNSE and the magnitude standard deviation of each noise spectral energy, σ |N( f )| , is calculated. Next, σ |N( f )| is compared with a user-defined threshold τ. If σ |N( f )| > τ, the IMF is considered as noisy. Due to the IMFs may mix each other, the second stage is performed to avoid mistakes. In the second stage, the noisy IMFs considered in the first stage are reconstructed and decomposed by the EEMD. The decomposed IMFs are then checked by the GNSE as in the first stage. If σ |N( f )| > τ, the corresponding IMF is discriminated as noisy and discarded. Finally, the ECG is reconstructed with all retained IMFs. This finishes the procedure.

The Proposed GSNC Scheme
To evaluate the performance of the proposed GSNC scheme, a performance index to evaluate the improvement based on the noise energy ratio in dB (NER dB ) is employed which is defined as where s(k) is the true ECG signal; x(k) and y(k) are the input noisy ECG signal and the reconstructed ECG signal after noise cancellation; N s is the total number of samples in x(k).   Figure 4 shows the flowchart of the proposed two-stage ECG noise cancellation scheme based on the GSNE. The proposed scheme is called grey spectral noise cancellation (GSNC). The working flow of the proposed GSNC scheme is described as follows. In the first stage, the input ECG signal is decomposed into a set of IMFs by the EMD. Then the noise spectral energy of IMFs are estimated by the GNSE and the magnitude standard deviation of each noise spectral energy, | ( )| , is calculated. Next, | ( )| is compared with a user-defined threshold . If | ( )| > , the IMF is considered as noisy. Due to the IMFs may mix each other, the second stage is performed to avoid mistakes. In the second stage, the noisy IMFs considered in the first stage are reconstructed and decomposed by the EEMD. The decomposed IMFs are then checked by the GNSE as in the first stage. If | ( )| > , the corresponding IMF is discriminated as noisy and discarded. Finally, the ECG is reconstructed with all retained IMFs. This finishes the procedure.

The Proposed GSNC Scheme
To evaluate the performance of the proposed GSNC scheme, a performance index to evaluate the improvement based on the noise energy ratio in dB ( ) is employed which is defined as where ( ) is the true ECG signal; ( ) and ( ) are the input noisy ECG signal and the reconstructed ECG signal after noise cancellation; is the total number of samples in ( ).

Results
In this section, the proposed GSNC scheme is justified by forty-three datasets from the MIT-BIH cardiac arrhythmia database. In Section 5.1, the energy of white noise added in the EEMD is investigated. In Section 5.2, two types of noise, the PLn and EMG noise, are considered in the experiments.

Results
In this section, the proposed GSNC scheme is justified by forty-three datasets from the MIT-BIH cardiac arrhythmia database. In Section 5.1, the energy of white noise added in the EEMD is investigated. In Section 5.2, two types of noise, the PLn and EMG noise, are considered in the experiments.

Effect of White Noise in the EEMD
In this subsection, the effect of white noise energy on the EEMD employed in the proposed GSNC is investigated. It is observed that the energy of white noise added in the EEMD affects the performance of noise cancellation. Consequently, several levels of white noise energy are added into the EEMD to find an appropriate one. In the experiments, three SNR used in the EEMD are 2 dB, 5 dB and 10 dB where an ECG signal with EMG noise of SNR = 5 dB is under consideration. Besides, the number of trials N T = 100 is employed in the EEMD. Figure 5 shows parts of the original ECG signal and the ECG signals after noise cancellation by the proposed GSNC scheme. The corresponding NER dB are 7.84 dB, 7.92 dB and 5.26 dB for the cases with SNR =2 dB, 5 dB and 10 dB in the EEMD, respectively. By the NER dB , it suggests that the white noise with SNR = 5 dB results in the best performance of ECG noise cancellation. Consequently, it is employed in the EEMD which is applied in the second stage of the proposed GSNC for better performance. In this subsection, the effect of white noise energy on the EEMD employed in the proposed GSNC is investigated. It is observed that the energy of white noise added in the EEMD affects the performance of noise cancellation. Consequently, several levels of white noise energy are added into the EEMD to find an appropriate one. In the experiments, three used in the EEMD are 2 dB, 5 dB and 10 dB where an ECG signal with EMG noise of = 5 dB is under consideration. Besides, the number of trials = 100 is employed in the EEMD. Figure 5 shows parts of the original ECG signal and the ECG signals after noise cancellation by the proposed GSNC scheme. The corresponding are 7.84 dB, 7.92 dB and 5.26 dB for the cases with =2 dB, 5 dB and 10 dB in the EEMD, respectively. By the , it suggests that the white noise with = 5 dB results in the best performance of ECG noise cancellation. Consequently, it is employed in the EEMD which is applied in the second stage of the proposed GSNC for better performance.

Results for the PLn and EMG Noise
The PLn and EMG noise are generated artificially and added into the original ECG signals whose = 5 dB and all forty-three MIT-BIH datasets are involved. As for the GSNE, the parameters = 4 and = 1 are set. In the experiment, the proposed GSNC scheme is also compared with the traditional noise cancellation schemes based on the EMD and the EEMD. As with

Results for the PLn and EMG Noise
The PLn and EMG noise are generated artificially and added into the original ECG signals whose SNR = 5 dB and all forty-three MIT-BIH datasets are involved. As for the GSNE, the parameters K = 4 and α = 1 are set. In the experiment, the proposed GSNC scheme is also compared with the traditional noise cancellation schemes based on the EMD and the EEMD. As with the first experiment, the PLn with SNR = 5 dB is considered. Table 3 shows the NER dB for the proposed GSNC and compared schemes. In Table 3, the EMD scheme has the NER dB ranged from−12.83 dB to 7.96 dB with the largest standard deviation of 5.21 dB among the compared schemes. For the EEMD scheme, its NER dB ranges from −5.67 dB to 7.90 dB in the given datasets with a smallest standard deviation of 3.21 dB. As for the proposed GSNC scheme, its NER dB ranges from −5.33 dB to 9.97 dB. On the average of NER dB , the proposed GSNC scheme has the best result (3.34 ± 4.03 dB) which is followed by the EEMD (2.20 ± 3.21 dB) and EMD (0.10 ± 5.21 dB) schemes. In the second experiment, the EMG noise of SNR = 5 dB is under study. Table 4 gives the NER dB for the proposed GSNC, EMD and EEMD schemes. In this experiment, a similar result to the first experiment is found. In the EMD scheme, the NER dB ranges from −8.03 dB to 12.19 dB with the largest standard deviation of 4.52 dB. The EEMD scheme has the range of NER dB from −6.66 dB to 12.47 dB with the smallest standard deviation of 4.27 dB. And the NER dB for the proposed GSNC scheme is within −5.14 dB to 13.21 dB. On the average of NER dB , the proposed GSNC scheme has the highest value (6.14 ± 4.29 dB) followed by the EEMD scheme (3.85 ± 4.27 dB) and the EMD scheme (3.52 ± 4.52 dB). To investigate the proposed GSNC scheme further, the ECG signal with various noise energies in the PLn and EMG noise are under consideration. The SNR for the PLn and EMG noise used in the experiments are −5 dB, 0 dB, 5 dB, 10 dB, 15 dB and 20 dB. Six datasets from MIT-BIH database are selected, including mitdb/100, mitdb/105, mitdb/108, mitdb/203, mitdb/223 and mitdb/228. For the case of PLn, Figure 6 shows the overall average of NER dB for the proposed GSNC scheme and the compared EMD and EEMD schemes. On the average of NER dB for all cases with the corresponding standard deviation, the EMD scheme obtains 4.16 ± 1.79 dB, 5.24 ± 1.81 dB, 3.82 ± 4.32 dB, 4.53 ± 2.57 dB, 4.72 ± 2.88 dB and −0.22 ± 8.29 dB for SNR = −5 dB, 0 dB, 5 dB, 10 dB, 15 dB and 20 dB, respectively. The results for the EEMD scheme are 5.07 ± 2.13 dB, 6.41 ± 0.99 dB, 4.46 ± 1.98 dB, 3.39 ± 3.17 dB, 1.67 ± 4.68 dB and −3.09 ± 3.36 dB for SNR = −5 dB, 0 dB, 5 dB, 10 dB, 15 dB and 20 dB, respectively. And the proposed GSNC scheme has 4.5 ±1.69 dB, 7.28 ± 1.41 dB, 5.44 ± 1.14 dB, 5.88 ± 2.07 dB, 6.08± 0.91 dB and 5.07 ± 3.02 dB for SNR = −5 dB, 0 dB, 5 dB, 10 dB, 15 dB and 20 dB, respectively. As shown in Figure 6, the proposed GSNC scheme always has better NER dB than the compared schemes except the case SNR = −5 dB. In the case of EMG noise, Figure 7  proposed GSNC scheme is superior to the compared schemes by except slightly less than the EEMD scheme in the case of SNR = 0 dB. By Figures 6 and 7, it suggests that the proposed GSNC scheme generally shows better performance when compared with the EMD and EEMD schemes in terms of average , both for the PLn and EMG noise.

Discussion
The EMD acts like a filter-bank and has no strict bandwidth restriction with the IMFs. The frequency range of each IMF is adaptive, depending on the original signal content. Generally, the In the case of EMG noise, Figure 7 depicts the averages of NER dB for different SNR. The NER dB and standard deviations for the EMD scheme are 8.88 ± 2.59 dB, 7.29 ± 3.75 dB, 5.13 ± 4.20 dB, 4.94 ± 4.21 dB, 2.13 ± 1.97 dB and −3.81 ± 10.24 dB for SNR −5 dB, 0 dB, 5 dB, 10 dB, 15 dB and 20 dB, respectively. For the EEMD scheme, the average NER dB with corresponding standard deviations are 10.52 ± 7.50 dB, 7.50 ± 1.93 dB, 6.50 ± 2.48 dB, 2.46 ± 5.32 dB, −2.13 ± 4.66 dB and −3.98 ± 4.56 dB for SNR = −5 dB, 0 dB, 5 dB, 10 dB, 15 dB and 20 dB, respectively. The results for the proposed GSNC scheme are 10.89 ± 2.68 dB, 7.40 ± 2.56 dB, 7.32 ± 1.97 dB, 6.93 ± 2.70 dB, 2.41 ± 0.84 dB and −0.72 ± 9.0 dB for SNR = −5 dB, 0 dB, 5 dB, 10 dB, 15 dB and 20 dB, respectively. For all cases, the proposed GSNC scheme is superior to the compared schemes by NER dB except slightly less than the EEMD scheme in the case of SNR = 0 dB. By Figures 6 and 7, it suggests that the proposed GSNC scheme generally shows better performance when compared with the EMD and EEMD schemes in terms of average NER dB , both for the PLn and EMG noise. In the case of EMG noise, Figure 7  proposed GSNC scheme is superior to the compared schemes by except slightly less than the EEMD scheme in the case of SNR = 0 dB. By Figures 6 and 7, it suggests that the proposed GSNC scheme generally shows better performance when compared with the EMD and EEMD schemes in terms of average , both for the PLn and EMG noise.

Discussion
The EMD acts like a filter-bank and has no strict bandwidth restriction with the IMFs. The frequency range of each IMF is adaptive, depending on the original signal content. Generally, the

Discussion
The EMD acts like a filter-bank and has no strict bandwidth restriction with the IMFs. The frequency range of each IMF is adaptive, depending on the original signal content. Generally, the bandwidths of the PLn and EMG noise are assumed in the ranges 59.5-60.5 Hz and 100-500 Hz, respectively. Thus the PLn is considered as a lower frequency noise while the EMG noise is considered as a medium and higher frequency noise. Note that the noise energy is mainly distributed in the low order IMF components after the EMD. Because of different bandwidths, the performance for the EMG noise is better than that for the PLn in the EMD scheme for ECG noise cancellation. As shown in Tables 3 and 4, the average NER dB for the PLn is 0.10 dB and 3.52 dB for the EMG noise.
Compared with the EMD, the EEMD has more concentrated band-limit IMF components. With the iterative EMD computation, the average of IMF with the same order yielded a sharper band transition than a single EMD-derived IMF, that is, the transition band overlap between adjacent IMFs is narrower than the EMD result. In other words, with the same filter specification the EEMD acts like a higher-order filter while the EMD works like a lower-order filter. Consequently, the performance of the EEMD scheme is better than the EMD scheme, as shown in Tables 3 and 4 where the average NER dB for PLn and the EMG noise by the EEMD scheme are 2.20 dB and 3.85 dB, respectively. They are higher than the corresponding NER dB by the EMD scheme. However, the EEMD pays the price of computational complexity, that is, it takes more time to cancel the ECG noise. This hinders the realization in an ECG patch if only the EEMD is applied in the ECG noise cancellation. On contrarily, the proposed GSNC scheme decomposes the input ECG signal by the EMD in the first stage. When σ |N( f )|, i < τ, the proposed GSNC scheme stops further decomposition. This makes the proposed GSNC scheme possible to be embedded in an ECG patch. Moreover, the proposed GSNC scheme employs two-stage discrimination for noisy IMFs while the conventional EMD and EEMD schemes use one-stage discrimination. Thus, the proposed GSNC scheme is expected to have better performance since suspicious IMFs in the first stage can be rechecked in the second stage to avoid mistakes while the one-stage EMD and EEMD scheme fails to.
In [17], Liu et al. showed that the energy of a lower frequency in the EMG noise is found in the first-order IMF component. In other words, the EMD or the EEMD like a filter-bank is able to decompose different intrinsic components in an ECG signal. This is also true for the PLn case. The results. shown in Tables 1 and 2 have justified the idea where the IMFs for clean and noisy ECG signals can be discriminated in most cases. Another evidence is in Tables 3 and 4. The results indicate that the average NER dB are positive. That is, intrinsic noise and additive noise can be dealt and cancelled in the EMD, the EEMD and the proposed GSNC schemes. Among the three schemes, the proposed GSNC scheme has the best performance with the average NER dB 3.34 dB for the PLn and 6.14 dB for the EMG noise, as shown in Tables 3 and 4, respectively. It implies that the proposed GSNC scheme is able to estimate the noise appropriately and the two-stage discrimination can relieve the over-cancellation problem which generally happens in the one-stage discrimination.
In order to show the proposed GSNC scheme does not affect the morphology of arrhythmic beat, the arrhythmic ECG dataset mitdb/210 is given as an example where two premature ventricular contraction (PVC) beats are within the duration. The denoised results for the PLn and EMG noise (SNR = 5 dB) by the proposed GSNC scheme are given in Figure 8. As shown in Figure 8b,c, the proposed GSNC scheme is able to retain subtle signs in the denoised ECG signal, when compared with Figure 8a. Figure 8. The arrhythmic ECG signals, (a) the original ECG signal with two PVC beats, (b) the ECG with PLn, (c) the denoised ECG with PLn, (d) the ECG with EMG noise (e) the denoised ECG with EMG noise.

Conclusions
This paper has presented a grey spectral noise cancellation (GSNC) scheme for ECG signals. In the proposed GSNC scheme, two-stage discrimination for noisy IMFs was employed which included the EMD, the EEMD and grey spectral noise estimation (GSNE). In general condition, the lower order IMFs would be easily coupled with the noise. The GSNE was applied to estimate the noise energy through the standard deviation of noise magnitude spectrum | ( )| . By | ( )| , noisy IMFs were determined and discarded in the process of reconstruction. The proposed GSNC scheme has been verified by forty-three datasets from the MIT-BIH database where different SNR levels for the PLn and EMG noise were considered. The results indicated that the proposed GSNC scheme was generally superior to the compared EMD and EEMD schemes in terms of average in the given datasets. The proposed GNSC scheme provides a new approach, based on the noise magnitude spectrum, to estimate the noise energy in the IMFs. The proposed GNSC scheme could be implemented in an embedded system, like the ECG patch, to deal with noises in the ECG signals.

Conclusions
This paper has presented a grey spectral noise cancellation (GSNC) scheme for ECG signals. In the proposed GSNC scheme, two-stage discrimination for noisy IMFs was employed which included the EMD, the EEMD and grey spectral noise estimation (GSNE). In general condition, the lower order IMFs would be easily coupled with the noise. The GSNE was applied to estimate the noise energy through the standard deviation of noise magnitude spectrum σ |N( f )| . By σ |N( f )| , noisy IMFs were determined and discarded in the process of reconstruction. The proposed GSNC scheme has been verified by forty-three datasets from the MIT-BIH database where different SNR levels for the PLn and EMG noise were considered. The results indicated that the proposed GSNC scheme was generally superior to the compared EMD and EEMD schemes in terms of average NER dB in the given datasets. The proposed GNSC scheme provides a new approach, based on the noise magnitude spectrum, to estimate the noise energy in the IMFs. The proposed GNSC scheme could be implemented in an embedded system, like the ECG patch, to deal with noises in the ECG signals.