0% found this document useful (0 votes)
42 views

A Real Time Approach For ECG Signal Denoising and Smoothing Using Adaptive Window Technique

This document presents a method for denoising ECG signals using an adaptive window technique. It aims to remove high frequency noise like power line interference using a varying window mean procedure based on the distance from adjacent R peaks. Low frequency noise like baseline wandering is removed using Fast Fourier Transform. The method detects R peaks to find the QRS complex duration and uses a pair of buffers to store past signals for noise removal processing with a 3 cycle delay. Results on manually corrupted and actual recorded ECG signals show the method can satisfactorily remove noise but could be improved.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

A Real Time Approach For ECG Signal Denoising and Smoothing Using Adaptive Window Technique

This document presents a method for denoising ECG signals using an adaptive window technique. It aims to remove high frequency noise like power line interference using a varying window mean procedure based on the distance from adjacent R peaks. Low frequency noise like baseline wandering is removed using Fast Fourier Transform. The method detects R peaks to find the QRS complex duration and uses a pair of buffers to store past signals for noise removal processing with a 3 cycle delay. Results on manually corrupted and actual recorded ECG signals show the method can satisfactorily remove noise but could be improved.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

A real time approach for ECG signal denoising and

smoothing using adaptive window technique

Chinmay Chandrakar Monisha Sharma


(of CSVTU ): Electronics & Telecommunication (of CSVTU ): Electronics & Telecommunication
Shri Shankaracharaya College of Engg. & Tech. Shri Shankaracharaya College of Engg. & Tech.
Bhilai, India Bhilai, India
[email protected] [email protected]

Abstract- The presence of parasite interference signals could and the test signal is 128 Hz. (According to the PTB diagnosis
cause serious problems in the registration of ECG signals and ECG database for Physionet [31]).
many works have been done to suppress these noise signals. By The high frequency noise is removed with the help of
conducting a mathematical method based on varying window the varying window mean procedure and the low frequency
length as according to the distance from the adjacent Rpeak which noise removal task is done with the help of Fast Fourier
are assumed to be high frequency noise (power line interference,
Transform to remove the low frequencies manually. The
electromyography noise) is removed with the help of the varying
window mean procedure and the low frequency noise (base-line process is evaluated for manually corrupted ECG signals and
wandering, motion artifact) removal task is done with the help of is validated for actual recorded ECG signals.
Fast Fourier Transform. The process is evaluated for manually The results which have been achieved are satisfactory and can
corrupted ECG signals and is validated for actual recorded ECG be improved to more precise denoising technique.
signals.

Keywords— ECG signals; denoising; varying window; fourier


II. METHODLOGY
transform
The process of analyzing ECG signals with no prior
I. INTRODUCTION information seems a lengthy process and needs advanced
The most common noises which corrupt the mathematical consideration. The prior information might
ECG signal are power line interference, myopotential signals, consist of some special ECG characteristic points, position of
motion artifacts and baseline (drift) interferences. Recently, Rpeak, ECG wave’s bandwidth etc. In this process sources of
new developed techniques based on global and local information used are -
transforms have become popular such as Wavelet transform 1) The QRS complex duration (DQRS)
method [3],[4],[23],[27] &[28], Wavelet shrinkage approaches 2) Locations of Rpeak waves in ECG signal
[7], [8], [12],[17] ,[19] & [20] , Time-frequency dependent
threshold [6], [14], [16], [18], [25] & [30] , Empirical mode In addition, it has been assumed that noises cannot be
decomposition [10] & [29], Artificial neural networks observed in QRS complexes due to the high energy of the
[15],Bayesian filtering framework [13] ,Energy thresholding QRS complex compared with the low energy of the corrupting
and Gaussian kernels [22]&[24]. While there are well- noises. Here the results are produced in real time and hence it
developed methods for Power line interference[1]&[2]and is a big problem to find these values prior to the incidence of
Drift suppression[7],[9]&[11],there are still problems in the wave. To cope up with this problem a pair of buffers
myopotential signal suppression due to the considerable which stores three cycles prior to the input of the signal to the
overlapping of the frequency spectra of both types of signals. process one by one for noise removal is used. This helps to
Recently some new techniques based on global and local have the future values for signal processing. But this produces
transforms have become popular in connection with signal a delay of three cycles to the process. The signal coming out
denoising [5], [21] & [26]. from the process has a delay of three cycles in addition with
At the first step, the signal is decomposed into a transform the delay due to the processing. This delay is not a big deal as
domain where filtering procedures are applied. The noise-free the ECG reports are taken for long period of time as compared
signal is then obtained by inverse transform. Choosing to this delay. The process not only requires the future values
appropriate basic functions for successful correlation of the but the past values too for the averaging process. Due to this
signal and designing transform domain filters accommodated some part of the signal at the beginning remains untouched
to the ECG signal morphology could turn these techniques due to scarcity of the past values and at the end due to scarcity
into powerful means for ECG signal denoising. It should be of future values. The process work together in series to give
noted that the sampling rate of the database signals is 1 kHz the denoised output.
A. Baseline wandering removal B. R peak detection (Rpeak )
A big problem in ECG signal denoising task is baseline The Rpeak detection from ECG signal is very important as it
wandering. In this regard, a simple method is used as has a vital role in the proposed process. Here threshold
compared to adaptive window technique which is used to detection technique is used to identify Rpeak. In an ECG signal
remove high frequency noise. The baseline wander is Rpeak have a distinguished feature that they have considerably
produced due to low frequency noise signals. Equation (1) is very large amplitude as compared to the rest of the signal.
one of the methods to remove low frequency noisy signal by Therefore it is easy to find the position of an Rpeak using a
using Fourier Transform, which transform the signal into threshold value. Here a threshold of 250mV (this value may
frequency domain from time domain and then again transform vary from signal to signal) is used to detect the Rpeak . As in
the signal to time domain for further iterations. general the amplitude of Rpeak varies from 250mV to higher
values.
Y k ∑N y j ωN (
(1)
C. Calculation of QRS complex duration (DQRS )
Where, N = length of the vector With reference to this Rpeak and by using Extract Portion of
/
And, Signal Express VI, the lowest valley point from left side i.e. Q
By this Equation (1) the input signal can be transformed into beat and from right side i.e. S beat of this Rpeak has detected.
frequency domain using Fast Fourier Transform (FFT).After These values will be QRSonset and QRSoffset respectively. Time
this transformation the low frequency components are values of QRSonset and QRSoffset has been obtained using
removed so as to remove the low frequency noise i.e. baseline Waveform Min Max VI. With the knowledge of this time
wander from the input ECG signal. Equation (2) is used to values of Q, R and S beats, the Q-R duration, R-S duration and
transform the above frequency domain signal to its time QRS complex duration (DQRS) has been calculated from
domain. Equation (3), Equation (4) and Equation (5) respectively.

y j ∑N Y k ωN (2) Q-R duration = Time of Rpeak -Time of QRSonset (3)


N
R-S duration = Time of QRSoffset -Time of Rpeak (4)
“Fig. 1,” shows after these iterations, the baseline wander is QRS duration (DQRS) = Time of QRSoffset -Time of QRSonset (5)
approximately removed from the signal .The main limitation
which is faced in this method is that the removal of low Extract Portion of Signal Express VI extracts portions of data
frequency terms (less than 10Hz) can remove some part of the from the input signal in the form of a single point or a range of
ECG signal also. But this loss of some elements is not a big data, data by time or index and time or index of the first
problem as these contain only a very small part of the ECG occurrence of a value. Waveform Min Max VI determines the
spectrum. minimum and maximum values and their associated time
Noisy ECG Signal values of a waveform.
0.5

D. Calculation of denoising window length


V o lta g e (v olt) --->

0
It is possible to eliminate undesired high frequency
components (noises) in the ECG signal using windowing
-0.5
technique by averaging the corresponding past and future
window components of varying length. By knowing the QRS
-1 complex duration and the position of Rpeak as mentioned
0 1 2 3 4 5 6 7 8 9 10
Time (sec) ---> before, a window is considered. Equation (6) determines the
Baseline Wander Removed ECG Signal
length of this window, defined as function of QRS complex
0.6 wave duration (DQRS), and location of every detected Rpeak .
0.4
. P
V o lta ge (v o lt) --->

DQRS
0.2
d x 1 α. DQRS 1 e (6)
0

-0.2
Where, α and β are constant parameters, Pi is the sample index
-0.4
0 1 2 3 4 5 6 7 8 9 10
of ith detected Rpeak, and x is the sample index, which varies
Time (sec) ---> through

P P P P
Fig.1. Time domain representation of input noisy ECG signal before and after x
baseline wanders removal. 2 2
E. Determination of parameter α and β
Parameter α determines maximum denoising window length
while β determines window’s growth rate around the detected
Rpeak shown in “Fig. 3&4,”.High values of α cause extensive
noise removal for high noisy signal and low α values cause
slight noise removal which is desirable for low noisy signals
as shown in “Fig. 5,”. Similarly low β values cause low rate
of noise removal at the vicinity of QRS complexes and high
values of β cause high rate of noise removal around QRS
complexes as shown in “Fig. 6,”.Therefore α and β value
should be set heuristically so that adequate denoising and ECG
morphology to its original signal can be preserved. By
considering normal range of QRS complex duration and
normal rate of noise interference “Fig. 5&6,” revels that the
Fig.2. Variation of denoising window length as according to the ECG signal. optimum values of α and β are around 1.7 and 0.018
respectively.
F. Averaging of variable size window components
To remove noises, denoising window slides through the noisy
signal and the value of the signal at the centre of the window
is set to the mean value throughout the window. Equation (7)
represents an ECG signal as a discrete function y(x), where x
denotes sample index, then the consequent denoised signal
y(x), at xth sample index is obtained as follows:

∑ (7)
Fig.3. Variation in the denoising window length with change in α, the
maximum denoising window length
In this approach, the lowest value of window length, di(x) = 1,
which occurs in the location of every detected Rpeak, produces
almost original signal in the vicinity of QRS complex. In other
words, a low length denoising window passes over QRS
complexes vicinity and therefore, a slight denoising process is
held on QRS complexes. The length of averaging window
reaches its maximum between two successive detected Rpeak.
This maximum is equal to α.airs which results in rough noise
removal in this region. “Fig. 2,” shows the variation of the
length of denoising window (averaging window) through a
sample signal that is to be denoised and the locations of
detected Rpeak are at sample indexes 268, 580, and 880
respectively. Performance of denoising process strictly
Fig.4. Variation of denoising window length with change in β, the denoising depends on window parameters α and β. “Fig. 3&4,” show
window growth rate
the variation of window length related to changes in α and β. It
can be observed that the gain at the Rpeak is the matter of
Parameter α determines maximum denoising window length
concern. At the Rpeak the amplitude has been approximately
while β determines window’s growth rate around the detected
doubled and hence the mean is exceeding the actual value.
Rpeak. The above formula defines window length through the
Equation (8) eradicates this problem, the amplitudes at the
ECG signal. The length of this window varies from 1.0 at the
Rpeak are divided by two and hence the gain levels at the Rpeak
location of every detected Rpeak and increases until it reaches
can be controlled.
its maximum value (α. DQRS), between two detected Rpeak as is
shown in “Fig. 2,” .(Pi –x) defines the distance from the
present Rpeak.When the distance between the sample from Rpeak y x ∑ y j (8)
.
is small, than the window length decreases exponentially as
according to the gain α.DQRS and exponential factor β/DQRS
and when the distance between the sample from the Rpeak is
large, than the window length increases according to This alteration helps to improve the overall performance of the
increasing distance. process and hence helps to produce more favorable results.
In “Fig. 5,” e.g. the variation in denoising window length is G. Database uesd
depicted when β is constant i.e. 0.0018, and α gets three From PTB Diagnosis ECG Database of Physionet ATM
different values, 0.1, 1.7, and 5.0. In “Fig. 6,” the variation in Library, a signal of 10 seconds of twenty ECG signals of
window length is depicted when α is constant i.e. 1.7, and β different people with different types of noise along with an
gets three different values, 0.0001, 0.0018, and 0.009. approximately noise free test signal are taken for analysis. The
information of the ECG signals provided by the library are in
2
Approximately Noise Free ECG signal ALPHA = 0.1 AND BETA = 0.0018 (constant) the form of ‘*.mat’ and ‘*.info’ file. These signals are used to
test the performance and efficiency of the process. The
V oltage (v olt)

1
sampling rate of the database signals is 1 kHz and the test
0
signal is 128 Hz.
-1
0 1 2 3 4 5 6 7 8 9 10
Time (sec)
Approximately Noise Free ECG signal ALPHA = 1.7 AND BETA = 0.0018 (constant)
III. RESULT AND CONCLUSION
1

A. Denoising process performance


V oltage (v olt)

0.5

0
In order to guarantee the performance of the proposed
denoising process, this method is implemented on a test ECG
-0.5
0 1 2 3 4 5 6 7 8 9 10 signal “Fig. 7,” that is corrupted manually with additive
Time (sec)
Approximately Noise Free ECG signal ALPHA = 5 AND BETA = 0.0018 (constant) noises. The test signal is corrupted using baseline wander of
1
10 Hz, power line interference of 50Hz, myopotential noise of
Voltage (volt)

0.5
70Hz bandwidth and is used for denoising process. Overall,
0 signal to noise ratio of input signal is improved. The process is
-0.5
tested in MATLAB software, Version: 7.10 R2010a.
0 1 2 3 4 5 6 7 8 9 10
Time (sec)
B. Discussion of the effects of parameters α and β on
denoising efficiency
Fig.5.Variation in ECG signal due to variation in α
“Fig. 8,” shows how the manually corrupted ECG signal is
denoised. The denoising process with unsuitable high and low
Approximately Noise Free ECG signal ALPHA = 1.7 (constant) AND BETA = 0.0001
2 values of parameter α, caused rough and inadequate noise
removal. Furthermore denoising process with unsuitable high
Voltage (volt)

0 and low values of parameter β distorts the shape of the signal.


-1 Therefore for the above manually corrupted ECG signal,
0 1 2 3 4 5 6 7 8 9 10
Time (sec) optimum values of these two parameters for adequate
denoising and ECG morphology preservation to its original
Approximately Noise Free ECG signal ALPHA = 1.7 (constant) AND BETA = 0.0018
1

signal can be achieved with α = 0.8 and β = 0.0036.


Voltage (volt)

0.5

0
Noisy ECG Signal Baseline Wander Removed ECG Signal
-0.5 1.5 1.5
0 1 2 3 4 5 6 7 8 9 10
Time (sec)
Approximately Noise Free ECG signal ALPHA = 1.7 (constant) AND BETA = 0.009
1 1 1
V o lta g e (v o lt) --->

V o lta g e (v o lt) --->


Voltage (volt)

0.5

0.5 0.5
0

-0.5
0 1 2 3 4 5 6 7 8 9 10 0 0
Time (sec)

-0.5 -0.5
0 2 4 6 8 10 0 2 4 6 8 10
L e n g th o f d e n o is in g w in d o w (in n u m b e r o f S a m p le s ) --->

Fig.6. Variation in ECG signal due to variation in β Time (sec) ---> Time (sec) --->

Denoising Window Length Approximately Noise Free ECG signal


1.2
True ECG Signal 8 2

1 1.5
6
0.8
1
V o lta g e (v o lt)

0.6
Voltage(involts)

4 0.5
0.4

0.2
0
2
0 -0.5
-0.2
0 -1
0 500 1000 1500 0 2 4 6 8 10
-0.4
0 1 2 3 4 5
Time (in sec ) -->
6 7 8 9 10
sample index ---> Time (sec)

Fig.7. Noise free test signal of Physionet ATM database


Fig.8. Output of the processes that has been defined in methodology
C. Conclusion [ 10] Binwei Weng, Manuel Blanco-Velasco, and Kenneth E. Barner,
“ECG Denoising Based on the Empirical Mode Decomposition,”
A simple process for suppression of noise from ECG signal is Proceedings of the 28th IEEE, EMBS Annual International
Conference, New York City, USA, 2006.
proposed in this paper. The advantages of this process can
[ 11] Zhi-Dong Zhao, Yu-Quan Chen,“A new method for removal of
describe as:
baseline wander and powerline interference in ECG signals,”
• Fast process for ECG denoising Proceedings of the Fifth International Conference on Machine
• Mathematically simple process Learning and Cybernetics, Dalian, 2006.
[ 12] Zhao Zhidong, Pan Min,“ECG Denoising by Sparse Wavelet
• Preserve QRS complex characteristic points,
Shrinkage,” School of Communication Engineering, Hangzhou
especially Q and S waves Dianzi University, Hangzhou, China, 2007.
• Real time processing is possible [ 13] Reza Sameni, Mohammad B. Shamsollahi, Christian Jutten, and
Gari D. Clifford,“A Nonlinear Bayesian Filtering Framework for
• Can work with variable complex wave durations
ECG Denoising,” IEEE Transactions on Biomedical Engineering,
• Commercial implementation will be easy and cheap 2007.
[ 14] Hamid Sad Abadia ,Masood Ghasemia, Ali Ghaffaria,“A
During the denoising process the smoothness and morphology mathematical algorithm for ECG signal Denoising,” Biomed Pap
preservation of denoised ECG signal depends on the selected Med Fac Univ Palacky Olomouc Czech Repub.,vol. 151, no. 1,
values of α and β parameters. Care should be taken while pp 73–78, 2007.
selecting α and β parameters so that the smoothness and [ 15] Rangaraj M. Rangayyan, Yunfeng Wu,“An Unbiased Linear
Artificial Neural Network with Normalized Adaptive Coefficients
morphology of ECG signal should be persevered to its original
for Filtering Noisy ECG Signals,” Department of Electrical and
signal. Overall, signal to noise ratio of input signal is
Computer Engineering, Schulich School of Engineering,
improved, and hence it can be concluded that it is a good and University of Calgary, 2007.
simple method for ECG denoising. [ 16] Omid Sayadi, Mohammad Bagher Shamsollahi,“ECG Denoising
and Compression Using a Modified Extended Kalman Filter
Structure,” IEEE Transactions on Biomedical Engineering, vol. 55,
REFERENCES no. 9, 2008.
[ 17] Tianjian Chen, Yong Zhao, Chunyu Yu, Ling Shen,“New
[ 1] Thomas A. Wrublewskit, Ying Sun, and Jeffrey A. Beyer, “Real- Technique for ECG Denoising Using Adaptive Wavelet
Time Early Detection of R Waves of ECG Signals,” Mansfield Shrinkage,” ISECS International Colloquium on Computing,
Scientific, Inc., Mansfield, Massachusetts, 1989. Communication, Control, and Management, 2008.
[ 2] Patrick S. Hamilton, “A Comparison of Adaptive and Nonadaptive [ 18] Alka Gautam, Young-Dong Lee and Wan-Young Chung, “ECG
Filters for Reduction of Power Line Interference in the ECG,”IEEE signal De-noising with Signal Averaging and Filtering algorithm,”
Transactions on Biomedical Engineering, vol. 43, no. 1, 1996. Third International Conference on Convergence and Hybrid
[ 3] Nikolay Nikolaev and Atanas Gotchev,“ECG signal denoising Information Technology, 2008.
using Wavelet Domain Weiner Filtering,” Institute of Information [ 19] Yang Ying, Wei Yusen, “New Threshold and Shrinkage Function
Technology, Bulgarian Academy of Sciences, 2000. for ECG Signal Denoising Based on Wavelet Transforms,”
[ 4] N. Nikolaev, Z. Nikolov, A. Gotchev, K. Egiazarian,“Wavelet Department of EE, Xi’An University of Technology, Xi An,
Domain Weiner Filtering for ECG Denoising using improved China, 2009.
signal estimate,” Institute of Information Technologies, Bulgarian [ 20] Suyi Li, YanjuJi and Guangda Liu, “Optimal wavelet basis
Academy of Sciences, 2002. selection of wavelet shrinkage for ECG de-noising,” College of
[ 5] A Alesanco, S Olmos, R Istepanian, J Garcia, “A Novel Real-Time Instrument Science and Electrical Engineering, Jilin University,
Multilead ECG Compression and De-Noising Method based on the Changchun, China, 2009.
Wavelet Transform,” Communications Technologies Group. [ 21] Jeong Yup Han, Su Kyung Lee, and Hong Bae Park,“Denosing
Aragon Institute of Eng. Research. Univ. of Zaragoza, Spain, 2003. ECG using Translation Invariant Multiwavelet,” International
[ 6] Li Su and Guoliang Zhao,“De-Noising of ECG Signal Using Journal of Electrical and Electronics Engineering 3:3 2009.
Translation- Invariant Wavelet De-Noising Method with Improved [ 22] Yan Lu, Jingyu Yan, Yeung Yam, “A Generalized ECG Dynamic
Thresholding,” Proceedings of the 2005 IEEE, Engineering in Model with Asymmetric Gaussians and its Application in Model-
Medicine and Biology 27th Annual Conference, Shanghai, China, based ECG Denoising,” Department of Mechanical and
2005. Automation Engineering, The Chinese University of Hong Kong,
[ 7] Donghui Zhang,“Wavelet Approach for ECG Baseline Wander China, 2009.
Correction and Noise Reduction,” Proceedings of the 2005 IEEE, [ 23] Mohamed Elgendi, Mirjam Jonkman, Friso De Boer,“R Wave
Engineering in Medicine and Biology 27th Annual Conference, Detection using Coiflets Wavelets,” School of Engineering and
Shanghai, China, 2005. Information Technology, Charles Darwin University, Australia,
[ 8] Paul S Addison,“Wavelet transforms and the ECG: a review,” 2009.
Cardio Digital Ltd, Elvingston Science Centre, East Lothian, EH33 [ 24] Lihuang She, Guohua Wang, Shi Zhang, and Jinshuan Zhao, “An
1EH, UK, 2005. Adaptive Threshold Algorithm Combining Shifting Window
[ 9] Binwei Weng, Manuel Blanco-Velasco, Kenneth E. Barner, Difference and Forward-Backward Difference in Real-time R-
“Baseline Wander Correction in ECG by the Empirical Mode wave Detection,” School of Information Science and Engineering,
Decomposition,” Dept. of Electrical and Computer Engineering, Northeastern University, Shenyang, People’s Republic of China,
University of Delaware, Newark, 2006. 2009.
[ 25] Shivaram P. Arunachalam, Lewis F. Brown,“Real-Time
Estimation of the ECG-Derived Respiration (EDR) Signal using a
New Algorithm for Baseline Wander Noise Removal,” 31st
Annual International Conference of the IEEE EMBS, Minneapolis,
Minnesota, USA, 2009.
[ 26] Changnian Zhang, Xia Li, Mengmeng Zhang,“A novel ECG
signal denoising method based on Hilbert-Huang Transform,”
International Conference on Computer and Communication
Technologies in Agriculture Engineering, 2010.
[ 27] Girisha Garg, Vijander Singh, J.R.P. Gupta, A.P.Mittal,“Optimal
Algorithm for ECG Denoising using Discrete Wavelet
Transforms,” Department of Instrumentation and Control
Engineering, NetajiSubhash Institute of Technology, New Delhi,
India, 2010.
[ 28] QiPHaibing, P LiuPXiongfei, Pan Chao, “A Method of Continuous
Wavelet Transform for QRS Wave Detection in ECG Signal,”
International Conference on Intelligent Computation Technology
and Automation, 2010.
[ 29] Zhao Zhidong, Liu Juan,“Baseline Wander Removal of ECG
Signals Using Empirical Mode Decomposition and Adaptive
Filter,” School of Electronics & Information, Hangzhou Dianzi
University, SEI, HDU, Hangzhou, China, 2010.
[ 30] Cui Xiaomeng,“A new Real-time ECG R-wave Detection
Algorithm,” The 6th International Forum on Strategic Technology,
2011.
[ 31] Hans Koch, Prof., Ph.D., Lothar Schmitz, M.D. The PTB
Diagnostic ECG Database, PhysioNet Library, MIT Room E25-
505A.

You might also like