ECG Denoising
ECG Denoising
trocardiography
300
I. I NTRODUCTION 200
100
3 1
2.5
Amplitude (1)
0.8
0.6
1.5
1
0.4
0.5
0.2
0
-0.5 0
-1
-0.2
-1.5
0 2 4 6 8 10 12 14 16 18 20
-0.4
Time (s) -5 -4 -3 -2 -1 0 1 2 3 4 5
Time (1)
Fig. 2. ECG signal contaminated with PLI and BLW noises. (a)
Amplitude (1)
1
0.2
-0.2
-0.4
-0.8
The discrete wavelet transform (DWT) uses filter banks Levels Level 0 Level 1 Level 2 Level 3 Level 3
for the construction of the multiresolution analysis, which x[n] d1[n] d2[n] d3[n] a3[n]
Rates Ts Ts/2 Ts/4 Ts/8 Ts/8
improves computation efficiency. As shown in Fig 4, the
wavelet transform computation requires a pair of filters. One of
the pairs calculates the wavelet coefficients, and the other ap- The discrete wavelet reconstruction or inverse wavelet trans-
plies the scaling function. This scaling function, implemented form (IDWT) has the same structure, but the down-sampling
with filter coefficients LPF (the scaling function behaves as is replaced by up-sampling.
a low-pass filter), provides the approximation of the signal,
while the wavelet function (HPF - behaves as a high-pass C. Wavelet thresholding
filter) gives the detail coefficients. The cut-off frequency of If orthogonal wavelets with periodic boundary were used
the filters is the half bandwidth of the input signal I. The in the DWT, then the white noise would be unaltered after
1
0.8
Output (1)
0.6
0.4
0.2
-0.2
-0.4
original signal
-0.6 hard threshold
-0.8 soft threshold
Fig. 4. Wavelet tree (Mallat’s algorithm) of DWT for a three-level decom- -1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
position.
Input (1)
Fig. 6. Hard and soft threshold representation on a linear input signal.
Amplitude (1)
1.5
1
Haar wavelet
0.5 (
x[k], if |x[k]| > λ
θλ0 (x[k]) =
0
(4)
-0.5
0, otherwise
-1
λ
θλ1 (x[k]) = max 0, 1 −
-1.5
0 0.2 0.4 0.6 0.8 1 1.2
(5)
Time (1) |x[k]|
(a) Most of the algorithms try to estimate the optimal value
of λ (Minimax algorithm [9]), with the help of the noise
level. Another method for determining the threshold level
Amplitude (1)
1.5
1
Daubechies' wavelet was proposed in [10], the scheme was based on the explicit
0.5
form of Stein’s unbiased risk estimate (SURE) - (6), where
0
Crd denotes cardinality. The threshold λ should be chosen by
-0.5
minimizing SURE (7).
-1
0 1 2 3 4 5 6 7
n
Time (1) SU RE(λ, x) = n +
X
[min(|x[i]|, λ)]2
(b) i=1
− 2 ∗ Crd(i : |x[i]| < λ) (6)
Amplitude (1)
1.5
1 Coiflet wavelet
0.5
λ∗ = argmin0≤λ≤√2log(n) SU RE(λ, x) (7)
0
2.5
2
noisy ECG data
1.5
0.5
-0.5
-1
-1.5
0 2 4 6 8 10 12 14 16 18 20
Time (s)
Fig. 7. ECG signal with BLW, PLI, and HF noises added. Fig. 8. Complete ECG signal filtering system with cascaded filter blocks.
1.6
TABLE II
1.4 original ECG SNR OF THE ECG SIGNAL WITH THE DIFFERENT FILTERING METHODS .
1.2
1 filtered ECG
0.8 Filter Algorithm SNR MSE
0.6
0.4
algorithm complexity (dB) (mV)
0.2 Raw signal - 6.8134 -
O(N ) = N lg(N )
0
-0.2
All FIR 24.1539 0.0847
-0.4
filters 2000, 1114, 245 taps
0 1 2 3 4 5 6 7 8 9 10
All IIR O(N ) = N lg(N ) 20.4868 0.0249
Time (s) filters 3, 24, 31 order
Wavelet O(N ) = N lg(N ) 30.5355 9.42 ∗ 10−4
Fig. 9. ECG signal filtered with FIR high-pass, band-stop, and low-pass filter thresholding 10,10
stages.
Amplitude (mV)
3
2.5
2 2
0
0.5
-0.5
0 -1
-1.5
-0.5 0 1 2 3 4 5 6 7 8 9 10
-1
0 1 2 3 4 5 6 7 8 9 10 Time (s)
Time (s) (a)
Amplitude (mV)
Fig. 10. ECG signal filtered with IIR high-pass, band-stop, and low-pass filter 0.6
stages.
0.4 Denoised ECG signal
0.2
Amplitude (mV)
0
2.5
2
Noisy ECG -0.2
1.5
1
a10 Wavelet approximation -0.4
-0.6
0.5 0 1 2 3 4 5 6 7 8 9 10
-0.5
Time (s)
-1
(b)
-1.5
0 10 20 30 40 50 60
Fig. 12. In figure (a) The raw ECG signal sampled with the SoC is shown,
Time (s) and the BLW residual signal from the first part of the filtering algorithm,while
(a) in figure (b) the filtered signal is shown.
Amplitude (mV)
-0.5
Logic section (PL) and a Processing System Section (PS)
-1
embedded together. An IP core was generated with HDL
0 1 2 3 4 5 6 7 8 9 10
The SNR, MSE can be further improved with further studying [7] V. J. Samar, H. Begleiter, J. O. Chapa, M. R. Raghuveer, M. Orlando,
different mother wavelet properties and thresholding methods. and D. Chorlian, “Matched meyer neural wavelets for clinical and
experimental analysis of auditory and visual evoked potentials,” in 1996
The implemented IP core manages to filter the signal under 8 8th European Signal Processing Conference (EUSIPCO 1996), Sept
ns, with 200 MHz PL clock source, but the processing time 1996, pp. 1–1.
can further be improved by pipelining the algorithm, unrolling [8] B. A. Rajoub, “An efficient coding algorithm for the compression of ecg
signals using the wavelet transform,” IEEE Transactions on Biomedical
loops, and using Stream interface with DMA (Direct Memory Engineering, vol. 49, no. 4, pp. 355–362, April 2002.
Access) instead of AXI Lite interface. [9] D. L. Donoho and I. M. Johnstone, “Ideal spatial adaptation by wavelet
shrinkage,” Biometrika, vol. 81, pp. 425–455, 1994.
VII. C ONCLUSION [10] ——, “Adapting to unknown smoothness via wavelet shrinkage,” JOUR-
NAL OF THE AMERICAN STATISTICAL ASSOCIATION, pp. 1200–
The proposed Wavelet thresholding method not only suc- 1224, 1995.
cessfully removed the BLW, PLI, and HF noises from the [11] A. L. Goldberger, L. A. N. Amaral, L. Glass, J. M. Hausdorff, P. C.
sampled ECG signals. A SoC hardware implementation was Ivanov, R. G. Mark, J. E. Mietus, G. B. Moody, C.-K. Peng, and H. E.
Stanley, “PhysioBank, PhysioToolkit, and PhysioNet: Components of a
proposed to verify the usability of the algorithm, based on new research resource for complex physiologic signals,” Circulation, vol.
which the favorable conclusion is drawn, the algorithm can be 101, no. 23, pp. e215–e220, 2000 (June 13), circulation Electronic Pages:
implemented in hardware and can be used in real time, requires http://circ.ahajournals.org/content/101/23/e215.full PMID:1085218; doi:
10.1161/01.CIR.101.23.e215.
less computation than conventional FIR and IIR filters and the
same attenuation can be achieved with less filtering stages.
R EFERENCES
[1] M. Meidani and B. Mashoufi, “Introducing new algorithms for realising
an fir filter with less hardware in order to eliminate power line inter-
ference from the ecg signal,” IET Signal Processing, vol. 10, no. 7, pp.
709–716, 2016.
[2] T. Singh, P. Agarwal, and V. K. Pandey, “Ecg baseline noise removal
techniques using window based fir filters,” in Medical Imaging, m-Health
and Emerging Communication Systems (MedCom), 2014 International
Conference on, Nov 2014, pp. 131–136.
[3] B. Taji, S. Shirmohammadi, V. Groza, and I. Batkin, “Impact of skin
electrode interface on electrocardiogram measurements using conductive
textile electrodes,” IEEE Transactions on Instrumentation and Measure-
ment, vol. 63, no. 6, pp. 1412–1422, June 2014.
[4] O. Rioul and M. Vetterli, “Wavelets and signal processing,” IEEE Signal
Processing Magazine, vol. 8, no. 4, pp. 14–38, Oct 1991.
[5] S. Mustafa, A. Abbosh, B. Henin, and D. Ireland, “Brain stroke detection
using continuous wavelets transform matching filters,” in 2012 Cairo
International Biomedical Engineering Conference (CIBEC), Dec 2012,
pp. 194–197.
[6] A. N. Saatlo and S. Ozoguz, “Cmos implementation of scalable morlet
wavelet for application in signal processing,” in 2015 38th International
Conference on Telecommunications and Signal Processing (TSP), July
2015, pp. 1–4.