Signal Processing Techniques For Removing Noise From ECG Signals
Signal Processing Techniques For Removing Noise From ECG Signals
*Corresponding author: Dr. Rahul Kher, G H Patel College of Engineering & Technology, Vallabh Vidyanagar, Gujarat, India,
Email: [email protected]
Received Date: February 15, 2019; Accepted Date: March 10, 2019; Published Date: March 12, 2019
Citation: Rahul Kher (2019) Signal Processing Techniques for Removing Noise from ECG Signals. J Biomed Eng 1: 1-9.
Abstract
The electrocardiogram (ECG) signals contain many types of noises- baseline wander, powerline interference, electromyo-
graphic (EMG) noise, electrode motion artifact noise. Baseline wander is a low-frequency noise of around 0.5 to 0.6 Hz. To
remove it, a high-pass filter of cut-off frequency 0.5 to 0.6 Hz can be used. Powerline interference (50 or 60 Hz noise from
mains supply) can be removed by using a notch filter of 50 or 60 Hz cut-off frequency. EMG noise is a high frequency noise of
above 100 Hz and hence may be removed by a low-pass filter of an appropriate cut-off frequency. Electrode motion artifacts
can be suppressed by minimizing the movements made by the subject. The chapter introduces the types of common noise
sources in ECG signals and simple signal processing techniques for removing them, and also presents a section of Matlab
code for the techniques described.
Keywords: Baseline wander, powerline interference, electrode motion artifacts, EMG noise, low-pass filter, high-pass filter,
notch filter
Introduction
Electrocardiogram (ECG) is a signal that describes
the electrical activity of the heart. The ECG signal is
generated by contraction (depolarization) and relaxation
(repolarization) of atrial and ventricular muscles of the
heart. The ECG signal contains- a P wave (due to atrial
depolarization), a QRS complex (due to atrial repolarization
and ventricular depolarization) and a T wave (due to
ventricular repolarization). A typical ECG signal of a normal
subject is shown in (figure 1). In order to record an ECG signal,
electrodes (transducers) are placed at specific positions on the
human body. Artifacts (noise) are the unwanted signals that
are merged with ECG signal and sometimes create obstacles
for the physicians from making a true diagnosis. Hence, it is
necessary to remove them from ECG signals using proper
signal processing methods. There are mainly four types
Figure 1: An ECG signal with typical time intervals
of artifacts encountered in ECG signals: baseline wander,
powerline interference, EMG noise and electrode motion
artifacts. They are discussed briefly below.
©2019 The Authors. Published by the JScholar under the terms of the Creative
Commons Attribution License http://creativecommons.org/licenses/by/3.0/,
which [email protected]
[email protected]
ωc
1− , n = 0
π
=
− sin(ωc n) , n =±1, ±2...
πn
(3)
truncation can be done by multiplying h(n) by a rectangular
window function, defined by
1, n = 0,...., L;
h( n) =
(4) 0, otherwise
or by another window function if more appropriate. Such an
FIR filter should have an order 2L + 1 of approximately 1150 to
achieve a reasonable trade-off between stopband attenuation
Figure 5: ECG affected by electrode motion artifacts [2] (at least 20 dB) and the width of the transition band.
0, 0 < ω < ωc subplot (2,1,1), plot(x2), title ('ECG Signal with low-frequency
H (e jω ) = (1) (baseline wander) noise'), grid on
1, ωc < ω < π
y0=filter (Hd, x2);
f
Where, 2π f c= 2π f c and
f
= . Thus, if fs
fs
fs
subplot (2,1,2), plot(y0), title ('ECG signal with baseline
= 0.5 Hz and f s =250 Hz then corresponding wander REMOVED'), grid on
normalized cut-off frequency ( f c ) = 0.002. Since the
corresponding impulse response has an infinite length,
y= d9+d8+d7+d6+d5+d4+d3+d2+d1;
Matlab code to remove baseline wander using DWT z1,2 = e ± jω0 (5)
x=load ('100.txt');
x1=x (:,2); Such a second-order FIR filter has the transfer function
x2=x1. /1000;
x2=x2 (170000:215000);
(1 − z1 z −1 )(1 − z2 z −1 )
H ( z) =
subplot (2,1,1), plot(x2), title ('ECG Signal with baseline (6)
wander'), grid on 1 − 2cos(ω0 ) z −1 + z −2
=
[C, L] = wavedec (x2,9,'bior3.7'); % Decomposition
Since this filter has a notch with a relatively large bandwidth,
a9 = wrcoef ('a', C, L,'bior3.7',9); % Approximate Component
it will attenuate not only the powerline frequency but also the
d9 = wrcoef ('d', C, L,'bior3.7',9); % Detailed components
d8 = wrcoef ('d', C, L,'bior3.7',8); ECG waveforms with frequencies close to ω0 . It is, therefore,
necessary to modify the filter in (6) so that the notch becomes
d7 = wrcoef ('d', C, L,'bior3.7',7); more selective, for example, by introducing a pair of complex-
d6 = wrcoef ('d', C, L,'bior3.7',6);
d5 = wrcoef ('d', C, L,'bior3.7',5); conjugated poles positioned at the same angle as the zeros p1,2 = re ± jω0
but at a radius r,
d4 = wrcoef ('d', C, L,'bior3.7',4);
d3 = wrcoef ('d', C, L,'bior3.7',3); p1,2 = re ± jω0 (7)
JScholar Publishers
J Biomed Eng Res 2019 | Vol 3: 101
5
(1 − z1 z −1 )(1 − z2 z −1 )
H ( z) =
(1 − p1 z −1 )(1 − p2 z −1 )
(8)
1 − 2cos(ω0 ) z −1 + z −2
=
1 − 2r cos(ω0 ) z −1 + r 2 z −2
x=load ('100.txt');
x1=x (:, 2);
x2=x1. / max(x1);
Subplot (3, 1, 1), plot(x2), title ('ECG Signal with baswline
wander'), grid on (Figure 9): Original ECG signal containing both baseline
wander and powerline interference (top); ECG signal with
y0=filter (Hd, x2); baseline wander removed (middle); ECG signal with powerline
Subplot (3, 1, 2), plot(y0), title ('ECG signal with low-frequency interference removed (bottom)
noise (baswline wander) Removed'), grid on
2.3 Techniques for Removal of Electromyographic (EMG)
Noise
Fnotch = 60; % Notch Frequency
BW = 120; % Bandwidth
The EMG noise is a high-frequency noise; hence an n-point
Apass = 1; % Bandwidth Attenuation
moving average (MA) filter may be used to remove, or at least
suppress, the EMG noise from ECG signals. The general form
[b, a] = iirnotch (Fnotch/ (Fs/2), BW/ (Fs/2), Apass);
of an MA filter is
Hd1 = dfilt.df2 (b, a);
n
y1=filter (Hd1, y0);
Subplot (3, 1, 3), plot (y1), title ('ECG signal with power line
=y ( n) ∑
k =0
bk x(n − k ) (10)
noise Removed'), grid on
Where x and y are the input and output of the filter, respectively.
The bk values are the filter coefficients or tap weights, k = 0,
The above Matlab code implements two IIR notch filters: one 1, 2, . . . , N, where N is the order of the filter. The effect of
for removing the baseline wander with a notch concentrated at division by the number of samples used (N + 1) is included in
0.67 Hz and another for removing the powerline interference the values of the filter coefficients. The signal-flow diagram of
a generic MA filter is shown in (Figure 10) [5].
with a notch concentrated at 60 Hz. The results of the code are
shown in (figure 9) below.
1 7 −k
H ( z ) = ∑ z (11)
8 k =0 (Figure 11): ECG signal with high-frequency (EMG like)
noise; fs = 1,000 Hz [5]
The transfer function of the filter is
1 7 −k
H ( z ) = ∑ z (12)
8 k =0
The 8-point MA filter may be rewritten as
1 1
y (n)= y (n − 1) + x(n) − x(n − 8)
8 8 (13)
10. M. Milanesi, N. Martini, N. Vanello, V. Positano, M. F. Submit your manuscript to a JScholar journal
Santarelli, R. Paradiso, D. De Rossi and L. Landini. (2006) and benefit from:
Multichannel Techniques for Motion Artifacts Removal from ¶¶ Convenient online submission
Electrocardiographic Signals. In: Proceedings of the 28th IEEE
¶¶ Rigorous peer review
EMBS Annual International Conference New York City, USA.
3391-3394 ¶¶ Immediate publication on acceptance
¶¶ Open access: articles freely available online
¶¶ High visibility within the field
¶¶ Better discount for your subsequent articles
Submit your manuscript at
http://www.jscholaronline.org/submit-manuscript.php