A Real Time Approach For ECG Signal Denoising and Smoothing Using Adaptive Window Technique
A Real Time Approach For ECG Signal Denoising and Smoothing Using Adaptive Window Technique
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.
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
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.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) --->
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) --->
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)