Removal of Power Line Interference From
Removal of Power Line Interference From
fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
Date of publication xxxx 00, 0000, date of current version xxxx 00, 0000.
Digital Object Identifier 10.1109/ACCESS.2017.Doi Number
ABSTRACT The noise cancellation in electrocardiogram (ECG) signal is very influential to distinguish the
essential signal features masked by noises. The power line interference (PLI) is the main source of noise in
most of bio-electric signals. Digital notch filters can be used to suppress the PLI in ECG signals. However,
the problems of transient interferences and the ringing effect occur, especially when the digitization of PLI
does not meet the condition of full period sampling. In this paper, to obtain a better cancellation of the PLI,
a designing approach, generating adaptive notch filter (ANF) of sharp resolution, is proposed. The proposed
method is concise in algorithm and achieves a more comprehensive reduction of the PLI. It only requires on
one fast Fourier transform on the input signal. The spectrum correction method, based on the information
from the FFT spectrum of the corrupted signal, is utilized to estimate the harmonic parameters of the PLI.
The information of a few main lobe spectral bins in the FFT spectrum is merged such that a compensation
signal can be synthesized. By subtracting the compensational signal from the original measurement, the PLI
within the investigated signal can substantially reduced. A distinguished advantage of the proposed ANF
lies in the fact that no parameters are required to be specified, making the algorithm easier to be
implemented. The proposed ANF outperforms conventional notch filters because it not only alleviates the
undesirable effects but also better preserves the QRS-complex features in the filtered signal.
INDEX TERMS Electrocardiogram (ECG); Power line interference; Spectrum correction; Adaptive Notch
Filter;
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
filters [17-19]. There are studies reporting the usage of the Usually in the digitization of a physical process, a time
wavelet transform and the empirical mode decomposition series of even spaced samples is recorded. In this section,
for suppressing PLI. Liu investigated the time, second-order we focus on explaining how the energy leakage problem
difference, and wavelet domain as sparse domains for the occurs in spectrum based techniques. We will show that the
ECG signal and the frequency domain as the sparse domain condition of fully period sampling (FPS), which is
for PLI [20]. Suchetha conducted a comparative analysis of determined by sampling parameters, has a substantial
EMD based filtering methods for 50 Hz noise cancellation impact on the spectrum analysis of signals.
in ECG signal [21]. Yadav proposed a novel non-local
A. Fundamentals of spectrum analysis of digital
wavelet transform method for ECG signal denoising by signals
exploiting the local and non-local redundancy present in the
signal [22]. Sayed introduced an effective hybrid scheme Modern spectrum analysis relies heavily on the theory of
for the denoising of ECG signals corrupted by non- discrete time Fourier Transform (DTFT). Cooley and
stationary noises using genetic algorithm and wavelet Tukey developed the celebrated fast algorithm of fast
transform [23]. Fourier transform (FFT), which decomposes a signal into
Besides the above methodologies, other advanced the sum of a few sinusoidal waves. For a signal x (t )
methods, such as least mean square based adaptive filtering sampled at the frequency fs and the length N , the
[24], adaptive Fourier transform [25], Kalman Filter [26], associated FFT spectrum xˆ(k ) is a complex valued series
nonlinear Bayesian filtering [27], eigen-value spaced at a uniform spatial interval of fs / N in the
decomposition [28], have also been investigated for the frequency domain.
purpose of ECG denoising. Recently, artificial intelligence N -1 -j
2 pnk
based techniques are also introduced to enable intelligent xˆ(k ) = å x (n )e N
, (1)
analysis of biomedical signals with noises [29-31]. Wang n =0
proposed an adversarial m ethod for ECG signals de-noising where the constant j indicates the imaginary number and
and achieved up to about 62% improvement on the SNR of k = 0,1, , N - 1 . The relationship between the sampling of
de-noised signals on average compared with state-of-the-art x (n ) and that of xˆ(k ) is shown in Figure 1.
technologies [32]. Huang investigated the classification of
t 1 / f s
ECG signals using the combination of short time Fourier
transform and convolutional neural network [33]. Wang
Amplitude
the algorithm. Numerical results show that the proposed B. Condition of full period sampling for simple
ANF is more effective in suppressing undesirable harmonic wave
phenomenon of transient interference and the ringing effect,
which widely exist in notch filter based ECG de-noising A simple harmonic wave (SHW) is referred to as a dynamic
techniques. ECG measurements from the dataset released process in which a sinusoidal wave of a specific frequency
by MIT-BIH are used to test the proposed method in actual is included (Figure 2). The mathematical definition of a
ECG analysis. The results show that the ANF not only can SHW can be defined as
suppress the undesirable phenomena, but also produces less shw(t ) = A ⋅ cos(2p fct + f) , (2)
residual QRS-complex features, which outperforms the
performances of two comparison notch filters. where A denotes the amplitude; fc denotes the frequency
of the SHW; and f denotes the initial phase of the process.
II. ENERGY LEAKAGE OF SINUSOIDAL WAVE IN
DIGITAL SAMPLING
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
It can be inferred that an SHW, by nature, is a band limited C. Negative effect caused by non-FPS condition
signal of extremely narrow bandwidth (Figure 3(a)). In the case of non-FPS condition, the energy leakage occurs
An SHW, of finite evenly spaced samples, is described to across the entire frequency axis. A notch filter is designed
meet the demand of FPS if the following condition is in the frequency domain. As such, no matter what kind of
satisfied. notch filter is used, the FIR type or the FIR type, only a
fc portion of the leakage components of PLI can be reduced.
N⋅ Î + , (3)
fs Owing to the incomplete reduction, an undesirable
phenomenon of ringing effect is inevitable. The
where + denotes the set of positive integers. The Fourier
phenomenon is reflected as highly oscillated fluctuations of
spectrum of an SHW satisfying the FPS condition is a
waveforms in the time domain. Although the amplitudes of
discrete Dirac sequence in the frequency domain (Figure
the oscillations are not large, it still complicates subsequent
3(b), denoted as processes of ECG analysis.
ìï1, f = fc
shw( f ) = d( f - fc ) = ïí , (4)
ïï0, f ¹ fc III. RATIO BASED SPECTRUM CORRECTION METHODS
ïî
BASED ON RECTANGLE WINDOW AND HANNING
WINDOW
A window function is often used in spectrum analysis
Amplitude
1.2
1 Main lobe (a)
0.8
Side lobes
Frequency 0.6
0.4
( f fc ) (b) 0.2
0
Amplitude
−3 −2 −1 0 1 2 3
Index of spectral bin
1.2 Actual spectral bin
T (k) (b)
1 T (k 1)
0.8
Frequency 0.6
(c) 0.4 T (k)
k
Amplitude
0.2
Broad band spectrum 0
k 1
k
Spectral bin number
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
sin(pk ) L sin(pk ) ìï
T (k ) = » , (7) ïïA = pDk ⋅ T (k ) ⋅ 2[1 - (Dk )2 ]
sin(pk / L) pk ïï c
sin(pDk )
ïï
ïï fs
and the shape of T (k ) is plotted in Figure 4(a). In the main í fc = (k + Dk ) , (14)
ïï L
lobe of the function, two MLSBs are utilized (Figure 4(b)). ïï Im(k ¢)
They are denoted as T (k) and T (k + 1) . ïïfc = arctan - pDk
ïï Re(k ¢)
Let the normalized error Dk = k ¢ - k , where k ¢ is the ïî
index of the window vertex associated with the actual 1
spectral bin. This error can be computed as (a)
1 T (k + 1)
Dk = - =- , (8) 0.5
1+v T (k) + T (k + 1)
B. Spectrum correction using Hanning window FIGURE 5. (a) The frequency response of a Hanning window; and (b)
the MLSBs for spectrum correction.
The mathematical definition and the frequency response of
a Hanning window is shown in Equation (10,11). IV. DESIGN OF ADAPTIVE NOTCH FILTER OF SHARP
RESOLUTION BASED ON RBSC
1 1 æ 2pn ö÷
Wh (n ) = - cos ççç ÷ for n = 0,1,2 , L - 1 , (10) If the frequency of the PLI is exactly 50Hz, it is feasible to
2 2 çè L ø÷÷
avoid energy leakage by properly selecting the sampling
ìï 1 1é æ 2p ö æ 2p öù üï
parameters. However, the value of the actual frequency is
Wˆh (w ) = ïí Wˆr (w ) + êêWˆr çççw - ÷÷÷ +Wˆr çççw + ÷÷÷úú ïýe - jNw /2 , (11) just approximately 50. An error of the power frequency in
ïïîï 2 4 êë èç L ø÷ èç L ø÷úû ïïþï
the range of [-2, 2]Hz can be found according to power
The modulus function of the frequency response is quality control regulations, for example in China. RBSC
based techniques can be employed to design adaptive notch
sin(pk ) 1 filter of extremely sharp resolution. The procedure of the
T (k ) = ⋅ , (12)
2pk 1-k2 proposed methodology is stated as below.
Step 1). Let the analyzed signal be ecg(t ) of sampling
and the shape of T (k ) is plotted in Figure 5(a). When the frequency fs and length N . Perform the fast Fourier
FPS condition is not satisfied, there are four MLSBs existed transform on the signal ecg(t ) .
in the main lobe. However, only the two with larger (f )
ecg(t ) ¾¾¾
FFT
ecg
amplitudes are selected (Figure 5(b)). The error between k ¢ ,
the index of the actual spectral bin, and k , is calculated Step 2). Search two spectral bins of large amplitudes
used the following equation within the main lobe of the PLI in the frequency domain.
Estimate the harmonic information ( APLI , fPLI and fPLI ) of
v -2
Dk = , (13) the PLI by ratio based spectrum correction methods.
v +1
( f ) ¾¾¾¾
ecg RBSC
APLI , fPLI , fPLI
where the v = T (k) / T (k + 1) . Finally the harmonic
information of an SHW can be estimated as Step 3). Construct a compensation signal compPLI (t )
based on the extracted harmonic information.
compPLI (t ) = APLI ⋅ cos(2p fPLIt + fPLI )
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
Step 4) Subtract compPLI (t ) from the corrupted ECG The algorithm belongs to the type of parameter free. A
signal. flow chart of the proposed algorithm is displayed as in
Figure 6.
ecg(t ) = ecg(t ) - compPLI (t )
ECG signal corrupted by PLI
Compensation signal
compPLI (t ) = APLI ⋅ cos(2p fPLIt + fPLI )
0
k 1
k
Spectral bin number
Filtered signal
2
V. COMPARISON OF PERFORMANCES OF TWO errrec = yrec (t ) - x (t ) , (18)
2
SPECTRUM CORRECTION METHOS
Either of the two windows can be employed to estimate the Where || ⋅ ||2 means to compute the 2-norm of input series.
harmonic frequency of PLI in ECG signals. In this section,
we test the estimation performance of the RBSCs with the Let the frequency error be ranged in the interval of [0,
two types of windows. 0.5]Hz, the reconstruction errors of the two RBSC methods
are shown in Figure 7. It can be seen that when
A. Comparison of performance for noise-free SHW Df Î [0, 0.25]Hz , the rectangular window based RBSC has
In this subsection, a digital signal x (t ) containing one SHW better performance. While when Df Î [0.25, 0.5]Hz , the
is simulated. Hanning window based RBSC has better performance. No
matter what kind of window is used, the reconstruction
x c (t ) = Ac cos(2p fct + fc ) , (15)
error is small and acceptable for high precision estimation.
where the amplitude Ac is chosen as 1 without loss of
generality. The sampling length of celebrated datasets of
ECG measurement are mainly 200~400Hz. Therefore, we
set the sampling frequency of x (t ) as 1, and 250 digital
samples are utilized in the following comparison.
Mean value of the error
errrec = yrec (t ) - x (t ) ,
2
(17) f [Hz]
2
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
Amplitude
Gaussian noises
In this subsection, we create a noisy version of the signal
x c (t ) as
Amplitude
curves of the reconstruction errors based on Hanning
window RBSC is stable. While for the case of rectangle
window, large errors are produced when Df Î [0.01, 0.13] . Ringing effect
This phenomenon is caused by one MLSB small in
amplitude. Time [s]
f [Hz]
Amplitude
C. Result analysis
The actual ECG measurement is not free of noise. As
shown in the comparisons, the Hanning windows based
RBSC is more robust in correction harmonic information of
SHW not satisfying FPS condition. Therefore, we choose
the type of window, which is utilized in the algorithm of Frequency [Hz]
Section IV, as the Hanning window.
FIGURE 11. The Fourier spectra of the simulated signal and the filtered
VI. COMPARISON OF THE PROPOSED METHOD WITH signal by the IIR notch filter.
CONVENTIONAL NOTCH FITLER IN REDUCTION OF Figure 12 shows the filtering result using the proposed
SHW
method. The maximal absolute value of the signal is
Following the definition in Equation (15), an SHW with
smaller than 4 ´ 10-3 . Although the ringing effect still exists,
frequency is 50.1Hz is simulated and the waveform is
it can be neglected due to extremely small amplitudes. The
shown in Figure 9.
An IIR notch filter is constructed to remove the SHW. root-mean-square values of the ringing parts of the two
The central frequency and the bandwidth of the notch filter filtered signals in Figure 10 and Figure 12 are 0.024 and
are set as 50Hz and 0.4Hz. The filter result is shown in 0.016 respectively, which demonstrates the enhancement of
Figure 10. Undesirable phenomena of the transient the proposed method in the suppression of the ringing effect.
interference at the beginning samples and the ringing effect
can be easily recognized in Figure 11.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
(a)
Amplitude
Amplitude
Time [s]
Time [s]
FIGURE 12. The waveform of the filtered signal using the proposed (b)
Amplitude
method.
1000
(c)
Amplitude
500
-500
Amplitude
Frequency [Hz]
Amplitude
FIGURE 13. The Fourier spectra of the simulated signal and the filtered
signal by the proposed method.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
(a) (a)
Amplitude
Amplitude
(b) (b)
Amplitude
Amplitude
The comparison between the Fourier spectrum of the The other comparison method is an improved IIR with
original ECG signal and that of the filtered signal is shown transient interference suppression ability [35]. The filtered
in Figure 17. It can be seen, the two signals are very result and the construction error are shown in Figure 19. In
similar except for a few spectral bins round the Figure 19(b), the transient interferences at the beginning
neighborhood of the actual frequency of the PLI. samples and the residual QRS-complex features are much
smaller than those in Figure 18(b).
(a)
Amplitude
Amplitude
Time [s]
(b)
Amplitude
Frequency [Hz]
FIGURE 17. Comparison between the original ECG signal and filtered Time [s]
signal.
FIGURE 19. (a) The filtered signal using the improved IIR filter; and (b)
We utilized two types of IIR notch filter to process the the construction errors between the filtered signal and the original ECG
signal. One is the conventional IIR filter employed in signal.
Section VI. The filtered signal and its Fourier spectrum are Comparisons between the waveform of the original ECG
shown in Figure 18. Although the waveform of the filtered signal and those of the filtered signal generated by the two
signal is very similar to the original ECG signal. The curve comparison IIR notch filters are shown in Figure 20. In
of errors between the two signals reveals that phase shift is Figure 20(a), relatively large errors are found in the high
produced in the IIR filtering process and causes very large frequency range of the proposed method. To make a more
errors in the neighboring areas of the impulsive QRS- quantitative analysis, the maximal value and the RMS value
complex features. The maximal error can be as high as 300. of the construction errors are computed. The related
On the other hand, transient interferences are also detected information is shown in Table 1. The construction error by
at some beginning samples of the filtered signal. the proposed method is the smallest in the indicators of
maximal error and RMS of errors. These comparisons have
validated that the proposed ANF outperforms traditional
IIR notch filter based techniques.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
101
method. An additive 50Hz PLI is added to the original ECG
signal to simulate ECG signals corrupted by PLI. The
100 proposed method is compared with two IIR notch filters. It
is found that the maximal value and the RMS value of
construction errors, produced by the proposed ANF, are
10-1
smallest among the results of three methods, indicating an
improved SNR in the filtered signal.
10-2
0 20 40 60 80 100 120
REFERENCES
Frequency [Hz] [1] E. N. Bruce, Biomedical Signal Processing and Signal Modeling,
Wiley, New York, 2001.
[2] P. E. McSharry, G. D. Clifford, L. Tarassenko, L. A. Smith, A
(b) dynamical model for generating synthetic electrocardiogram signals,
IEEE Trans. Biomed. Eng., 2003, 50(3): 289–294.
[3] K. Friganovic, D. Kukolja, A. Jovic, M. Cifrek, G. Krstacic,
Amplitude
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2019.2944027, IEEE
Access
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.