You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/234047548

FILTERS FOR ECG DIGITAL SIGNAL PROCESSING

Conference Paper · January 2005

CITATIONS READS

5 7,455

3 authors:

Oldrich Ondracek Jozef Pucik


Slovak University of Technology in Bratislava Slovak University of Technology in Bratislava
39 PUBLICATIONS   45 CITATIONS    33 PUBLICATIONS   66 CITATIONS   

SEE PROFILE SEE PROFILE

Elena Cocherová
Slovak University of Technology in Bratislava
34 PUBLICATIONS   51 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Message Driven Monitoring Systems View project

Kucharik, M., Saling, M., & Pucik, J. (2012). 12. Stance with head extension–Posturographic test. Clinical Neurophysiology, 123(3), e12. View project

All content following this page was uploaded by Jozef Pucik on 30 May 2014.

The user has requested enhancement of the downloaded file.


International Conference “Trends in Biomedical Engineering”
September 7 - 9, 2005, University of Zilina
FILTERS FOR ECG DIGITAL SIGNAL PROCESSING
Oldřich Ondráček, Jozef Púčik, Elena Cocherová
Department of Radioelectronics, SUT FEI, Ilkovičova 3, 812 19 Bratislava, Slovak Republic
Tel: +421 2 6029 1532, Fax: +421 2 6542 9683
E-mail: elena.cocherova@stuba.sk

Summary
In the article, different types of filters for applications in biomedical signal processing are presented: FIR and IIR filters,
adaptive filters and median filters. Given filter types have been analyzed from the view of appropriate applications for
suppression of izoelectric line fluctuations, suppression of powerline noise and suppression of mother ECG signal influence
on fetal ECG signal.

Abstrakt
V článku sú prezentované rôzne typy filtrov použité pri spracovaní biomedicínskych signálov: FIR a IIR filtre, adaptívne
filtre a mediánové filtre. Dané typy filtrov sú analyzované z hľadiska vhodnosti použitia v aplikáciách pre potlačenie
kolísania izoelektrickej línie EKG signálu, pre potlačenie sieťového rušenia a potlačenie rušenia fetálneho EKG materinským
EKG signálom.

Key words
Biosignal processing, FIR filter, IIR filter, adaptive filter, median filter, electrocardiogram (ECG)

1 Introduction The critical point of filter design is the choice of


filter pass-band, since the low-frequency
Recorded ECG signal is often affected by the components of ECG signal are important to keep the
noise of environment (e.g. powerline noise), artifacts correct shape of ST segment. According to the
from movements of patient and fetal ECG can be American Heart Association [5], the demand on the
hidden in mother ECG of higher amplitudes. analog ECG signal recording is frequency band from
According to the purpose of application, biosignal 0.05 Hz to 100 Hz, however this range is doubtful.
processing involves the usage of different types of According to the other articles, e.g. [6], even cutoff
filters [1] - [3]. frequency of 2 Hz does not cause visible changes of
ST segment.
1.5
2 System description and results
1
Filter evaluations is accomplished with regard
to achievement of distortion filtration and with
0.5
regard to minimal additional deformation of ECG
→ x (mV)

signal shape (declination of ST interval, abnormal


0
pronunciation or reduction of particular waves, etc.).
Basic shape of ECG signal is shown in Fig. 1. Signal −0.5
processing is performed in program Matlab.
R −1
ECG (mV)

P wave T wave mean value


−1.5
of ECG 0 1 2 3 4 5 6
→ t (s)
Fig. 2 Input ECG with uncorrected baseline
Q S isoelectric line
t (s) 1.2
PQ interval ST interval FIR
1 IIR − nonlinear phase
Fig. 1 Schematic illustration of ECG signal components IIR − forward−backward

0.8
2.1 Isoelectric Line Corrections
→ |H(f)|

0.6
Isoelectric line (baseline, isoline) of ECG signal
is often affected by the artifacts from breathing or 0.4
electrode phenomena. Fluctuations of isoelectric line
can be suppressed using high-pass (HP) filters. 0.2
Example of ECG signal (Fig. 2) we used to evaluate
suitability of given filter type for isoelectric line 0
0 0.2 0.4 0.6 0.8 1 1.2
correction, is taken from database of PhysioBank → f (Hz)
Archive [4]. Fig. 3 Magnitude frequency characteristics of three types
of HP filters

91
International Conference “Trends in Biomedical Engineering”
September 7 - 9, 2005, University of Zilina
In the case, when the FIR filter design [2] with The Butterworth IIR HP filter (see magnitude
Hamming window is considered (see magnitude characteristic in Fig. 3) designed by means of
frequency characteristic of filter in Fig. 3), the bilinear transformation [2] with similar magnitude
minimum required filter order is estimated by characteristic as designed FIR filter (see Fig. 3) is of
N ≈ 6.6 ⋅ f s 2( f 2 − f1 ) = 1500 , where sampling 7th order. The resulting filtered ECG signal (Fig. 5)
depicts the corrupted ST segment due to nonlinearity
frequency is f s = 250 Hz , transition band is from of phase frequency characteristic of IIR filter.
f1 = 0.35 Hz to f 2 = 0.9 Hz . The resulting filtered The IIR filter with zero-phase frequency
ECG signal is shown in Fig. 4. The filter delay is characteristic (non-causal filter) can be used for off-
line processing. In this case, the input signal is
τ g = N (2 ⋅ f s ) = 3 s . Except of the high delay, the
filtered once in the forward direction, then the
result of FIR filtration is excellent. filtered sequence is reversed and run back trough the
filter (the same as run through filter with inverse
1.5 transfer function). The result has zero phase
unusable part of signal frequency characteristic and the magnitude
1
due to filter delay characteristic is the square of the single filter
magnitude characteristic. The filtered ECG signal at
the output of zero-phase IIR filter, that is shown in
0.5
Fig. 6, looks similar as in the case of the FIR filter.
→ y (mV)

The significant advantage is low order of IIR filter


0 (single filter is Butterworth IIR HP filter of order 5).
Since mean value of ECG is not precisely zero,
−0.5 removing of dc component by means of
abovementioned HP FIR and IIR filters does not
allow to adjust zero potential with ECG baseline.
−1
0 1 2 3 4 5 6 Solution of this problem is better achieved by the
→ t (s) following two methods.
Fig. 4 Filtered ECG signal using the FIR filter

1.5 1.5

1
1

0.5
→ y (mV)
→ y (mV)

0.5
0

0
−0.5

−1 −0.5
0 1 2 3 4 5 6 0 1 2 3 4 5 6
→ t (s) → t (s)
Fig. 5 Filtered ECG using IIR filter with nonlinear phase Fig. 7 Corrected ECG using the interpolation of baseline
frequency characteristic
1.5 1.5

1
1

0.5
→ y (mV)
→ y (mV)

0.5

0
−0.5

−1 −0.5
0 1 2 3 4 5 6 0 1 2 3 4 5 6
→ t (s) → t (s)
Fig. 6 Filtered ECG using zero-phase IIR filter Fig. 8 Corrected ECG using the median filter

92
International Conference “Trends in Biomedical Engineering”
September 7 - 9, 2005, University of Zilina
Further method of removing the isoelectric line 2.2 Suppression of powerline noise
alternations is the spline interpolation. First step in
this method is to estimate the isoelectric line, which We have the situation, that the ECG signal was
is subsequently subtracted. To estimate the recorded together with powerline noise (50 Hz or
isoelectric line we need to detect points, which 60 Hz). Two filters are presented: 2nd order IIR
should have zero potential (e.g. the interval before P filter and adaptive filter.
wave), that requires usually additional processing Input signal to IIR filter as is shown in Fig. 9,
(detection of the QRS complex). The isoline is has spectrum with dominant 60 Hz powerline noise
reconstructed from these points using interpolation. (Fig. 10). Filter is designed as a notch filter for
Corrected ECG signal using interpolation is shown removing frequency f0 = 60 Hz (width of stop band
in Fig. 7.
Method of median filtration is generally used is 5 Hz for 3 dB decrease of magnitude characteristic
mainly for suppression of impulse noise. As such a shown in Fig. 11).
noise can be considered also the QRS complex (if Transfer function of the 2nd order IIR filter is
the window width for median evaluation is twice the (1 − z0 z −1 )(1 − z0* z −1 ) r − 2 r cosθ 0 ⋅ z −1 + r z −2
H (z) = k =
impulse width) and can be effectively filtered out
from the ECG signal. It is possible to suppress the
(1 − p0 z −1 )(1 − p0* z −1 ) 1 − 2 r cosθ 0 ⋅ z −1 + r 2 z −2
other waves (P, T) by repeating the filtration and where zeros and poles are
j θ0 ∗ − j θ0
thereby obtain the isoelectric line, which is z 0 = 1⋅ e z 0 = 1⋅ e
subsequently subtracted. Filtered signal from median j θ0 ∗ − j θ0
filter (triple filtration using rectangular window p0 = r ⋅ e p0 = r ⋅ e
width of 51, 101, 201 samples, respectively; sample and k = r, θ 0 = 2π f 0 f s , sampling frequency is
frequency 250 Hz) is shown in Fig. 8. The resulted
fs= 250 Hz. Distance of poles from z-plane origin is
output is not satisfactory, as the T wave is deformed
especially for faster changes of isoline. determined by r = 1 − π ∆f f s . Output signal of
notch filter is depicted in Fig. 12.

11
1
10.5

10 0.8
→ x (mV)

→ | H( f ) |

9.5
0.6
9
0.4
8.5

8 0.2

7.5
0 2 4 6 8 10 0
→ t (s) 0 20 40 60 80 100 120
→ f (Hz)
Fig. 9 ECG with powerline noise
Fig. 11 Magnitude frequency characteristic of notch filter

250
11

10.5
200

10
150
→ | X( f ) |

→ y (mV)

9.5

100 9

8.5
50
8

0 7.5
0 20 40 60 80 100 120 0 2 4 6 8 10
→ f (Hz) → t (s)
Fig. 10 Spectrum of ECG with powerline noise Fig. 12 Filtered ECG using notch IIR filter

93
International Conference “Trends in Biomedical Engineering”
September 7 - 9, 2005, University of Zilina
In the case of powerline noise suppression by The amplitude A and phase ϕ of harmonic
adaptive filter, the recording of reference powerline signal y(n) is set up by an adaptation of filter
signal x(n) is required, as shown in Fig. 13. From coefficients a and b:
reference powerline signal x(n) the phase shifted y (n ) = A ⋅ cos(θ 0 n + ϕ ) = a ⋅ x1 (n ) + b ⋅ x2 (n )
signals x1(n) and x2(n) are derived. Phase shift ∆ϕ
After correct set up of adaptation coefficients,
can be realized easily by time delay.
signal y(n) is subtracted from input signal u(n) so,
that the output signal e(n) represents ECG signal
u(n) e(n) with eliminated powerline noise.
ECG + Adaptation can be performed by use of simple
LMS (Least Mean Square) algorithm:
x(n) x1(n) a (n + 1) = a (n ) + 2 µ e(n )⋅ x1 (n )
50Hz a
b(n + 1) = b(n ) + 2 µ e(n )⋅ x2 (n )
∆ϕ +
x2(n) y(n) where µ is parameter of convergence.
b Adaptive filter was realized in program
Simulink. Input signal u(n) consists of ECG signal
generated synthetically with amplitude of 1 mV and
Fig. 13 Principle of adaptive filtration of ECG signal additional 50 Hz noise signal with amplitude also of
corrupted with powerline noise 1 mV (see Fig. 14). Sampling frequency is 200 Hz.
Proceeding of filter adaptation is seen in Fig. 15
2 for convergence parameter µ = 0.01 . Filtering error
1.5 r(n) (lower trace of Fig. 15) is difference between
1
output signal from filter e(n) and an ideal ECG
signal.
→ u (mV)

0.5 Via proper choice of convergence parameter, it


0 is possible to achieve faster adaptation (even sooner
−0.5
than in one cardiac cycle) but at a cost of larger
filtering error (see Fig. 16).
−1 The presented method is usable for any periodic
−1.5 distortions and can be directly expanded also for
0 0.5 1 1.5 2 2.5 3
→ t (s) higher harmonic components. It is important
especially in the cases, when spectrum of noise
Fig. 14 Input signal for adaptive filtration (ECG interferes with the spectrum of useful signal.
corrupted with powerline noise)

1.5
1

1
0.5
→ e (mV)

0.5
→ e (mV)

0
0

−0.5 −0.5

−1
−1

0.5
0.5
→ r (mV)
→ r (mV)

0
0

−0.5
−0.5

0 0.5 1 1.5 2 2.5 3


0 0.5 1 1.5 2 2.5 3 → t (s)
→ t (s)
Fig. 16 Filtered ECG (upper trace) and filtering error
Fig. 15 Filtered ECG (upper trace) and filtering error
(lower trace) for µ = 0.2
(lower trace) for µ = 0.01

94
International Conference “Trends in Biomedical Engineering”
September 7 - 9, 2005, University of Zilina
2.3 Fetal ECG processing The result of off-line processing using 20th
order of the FIR filter and delay of u(n) signal
Fetal ECG (F-ECG) recorded from abdominal (D = 10 samples) is shown in Fig. 19.
electrode (lead) is a mixture of maternal and fetal
ECG signals (Fig. 17) [7]. The maternal ECG 50
(M-ECG) has lower frequency and higher amplitude
than F-ECG, as it is shown in upper trace of Fig. 18.
To achieve alone F-ECG using an adaptive

→ y (µV)
filter, the reference maternal signal x(n) has to be 0
recorded, as shown in lower trace of Fig. 18. The
reference maternal signal is used for optimal linear
estimation of M-ECG recorded in the place of
F-ECG recording. It is assumed that M-ECG and
−50
F-ECG are non-correlated. We consider FIR filter,
which optimal parameters are determined in the 30

process of adaptation, using e. g. LMS, RLS 20


(Recursive Mean Square) algorithms or in the case
10
of off-line processing it is possible to use directly

→ e (µV)
equation: 0
−1
h = K x ⋅ k xu −10

−20
where K x is autocorrelation matrix of signal x(n)
−30
and k xu is vector of cross-correlation function of
0 0.5 1 1.5 2
signals x(n) and u(n). → t (s)
Fig. 19 Separated components of thoracic lead: maternal
ECG (upper trace), fetal ECG (lower trace)
u(n) e(n)
F-ECG D +
Disadvantage of LMS algorithm is the slow
convergence: the time of convergence of LMS
algorithm is longer than recorded signal. Therefore
x(n) y(n)
M-ECG h(n) the signal of several cardiac cycles can be run
repeatedly, until the algorithm attains convergence.
The achieved values of filter coefficients are used as
Fig. 17 Adaptive filtration of F-ECG beginning values for next repetition (Fig. 20).

50 30

20

10
→ e (µV)
→ u (µV)

0 0

−10

−20

−30
−50
1
30

20

0.5 10
→ e (µV)
→ x (mV)

−10
0
−20

−30
−0.5 0 0.5 1 1.5 2
0 0.5 1 1.5 2
→ t (s) → t (s)

Fig. 18 Input signals for adaptive filtration: abdominal Fig. 20 Extracted fetal ECG signal by means of LMS
lead - mixture of maternal and fetal ECG signaol (upper algorithm (for µ = 0.0000001) after 1st repetition of
trace), thoracic lead (reference input) - maternal ECG recorded signal (upper trace) and after 10th repetition
signal (lower trace) (lower trace)

95
International Conference “Trends in Biomedical Engineering”
September 7 - 9, 2005, University of Zilina
3 Discussion band) for monitoring purposes may be relaxed in
comparison to diagnostic ones.
In the sections 2.1 - 2.3, filter based methods of More sophisticated methods must be used to
ECG processing for three situations are presented. distinguish fine components of ECG (microvolt
In the first case, it is analyzed the problem of signals) usually lost in standard ECG, such as VLP,
suppression of baseline alternations under QRS notches, epsilon waves, T wave alternations,
simultaneous preservation of signal shape (primarily noninvasive recording of His-Purkinje activity.
of ST segment). ST segment is important part of Special consideration is required in methods of
ECG for judgment of an ischemic changes, e. g. at separation of fetal ECG from the maternal one.
load-ECG when the artifacts often appear.
Disadvantage of abovementioned FIR and IIR Acknowledgement
filters is that the time mean value need not to be
precisely 0; i. e. it is rather suppression of baseline This work was supported by the Ministry of Education of
wandering than suppression of dc offset. Another the Slovak Republic under Grant No. VTP 102/2000, by
the Grant No. 1/0144/03 and by VEGA 1/2047/05.
possible method for isoelectric line correction is the
wavelet transformation [8].
References
In the second case, the simple IIR filter is often
satisfying for powerline noise suppression. Despite [1] J. Jan, Číslicová filtrace, analýza a restaurace
nonlinear phase, observable distortion was not signálů, VUT Brno, (2004)
visible. Sharp changes of phase characteristic may
[2] O. Ondráček, Diskrétne signály a sústavy,
be expected close to notch frequency, where only
Vydavateľstvo STU, Bratislava, (2002)
small part of spectrum extends. Despite it, higher
frequencies are important for keeping the shape [3] D. Schlichthärle, Digital filters. Basics and
(amplitude) of QRS complex. While for monitoring design, Springer - Verlag, Berlin, (2000)
purposes, the bandwidth up to 40 Hz is [4] http://physionet.org, [online], [cit:2005-06-14]
recommended, a demand on bandwidth above [5] J. J. Bailey et al., Recommendations for
standard 100 Hz can be e. g. at pediatric ECG [9]. standardization and specifications in
Attention has to be paid at HR (High Resolution) automated electrocardiography: Bandwidth
ECG [10], where so called VLP (Ventricular Late and digital signal processing. Circulation, 81,
Potentials) have spectrum approximately from 40 Hz (2), pp. 730-739, (1990)
to 300 Hz, thereby the spectrum interleaving with [6] C. R. Lambert et al., Low-frequency
spectrum of powerline noise may cause a problem. requirements for recording ischemic ST-
In such the cases, methods of subtracting are segment abnormalities in coronary artery
advantageous, where the interference is estimated disease. American Journal of Cardiology, 58,
from the reference signal or from the isoelectric (3), pp. 225-229, (1986)
portions of ECG. [7] B. L. R. De Moor (ed.): Database for the
The third case was referred to separation Identification of Systems, Cutaneous potential
maternal and fetal ECG signals. We presented the recordings of a pregnant woman, Department
method that can be easily implemented e. g. using of Electrical Engineering, ESAT/SISTA,
artificial neural networks [11]. For the purposes of K.U.Leuven, Belgium,
noninvasive fetal electrocardiography with http://www.esat.kuleuven.ac.be/sista/daisy/,
multichannel records from abdominal electrodes, [online], [cit:2005-06-14]
also the other methods can be useful: BSS (Blind [8] V. Eck et al., Electrocardiogram Baseline
Source Separation) from signal mixtures, such as Removal Using Wavelet Approximations, In:
SVD (Singular Value Decomposition), PCA Analysis of Biomed. Signals and Images,
(Principal Components Analysis), ICA (Independent Vol. 1,VUTIUM Press, Brno, pp. 136-138,
Component Analysis). (2000)
[9] R. Peter et al., Minimum Bandwidth
4 Conclusions Requirements for Recording of Pediatric
In the article, applications of filter-based Electrocardiograms, Circulation, 104,
methods for improving quality of ECG in three pp. 3087-3090, (2001)
specific situations are presented. The selection of [10] S. Narayanaswamy, High Resolution
proper method would be done with respect to Electrocardiography, Indian Pacing and
whether the processing is done as an input to the Electrophysiology Journal, 2, (2), pp. 50-56,
subsequent automatic analyses, or the result is (2002)
dedicated only for direct visual inspection, and [11] G. Camps et al., Fetal ECG Recovery Using
whether on-line or off-line processing is wanted. Dynamic Neural Networks with FIR Synapses,
The ultimate aim of analysis or processing must be 2nd Virtual Congress of Cardiology 2001,
taken into consideration for choice of parameters http://www.fac.org.ar/scvc/index2.htm,
(and method): the requirements (like frequency [online], [cit:2005-06-14]

96

View publication stats

You might also like