MATHEMATICAL
BIOSCIENCES
A Mathematical J. RICHARDSON,
321
(1971)
Model for ECG Wave Forms and Power Spectra L. J. HAYWOOD,
Los Angeles County-University Los Angeles, California
Communicated
12, 321-328
V. K. MURTHY
of Southern
California
AND
Medical
G. HARVEY Center
by Richard Bellman
ABSTRACT It is desirable to construct a mathematical model that will accurately reproduce the discrete waves of an electrocardiograph signal. The usual cycle for one heartbeat includes a P wave (atrial depolarization), QRS waves (ventricular depolarization), and T wave (ventricular repolarization). The model presented simulates real or observed ECG signals and has many practical applications.
I. INTRODUCTION
In considering the problem of formulating suitable concepts for the automatic classification of electrocardiogram (ECG) wave forms, certain approaches require flexible mathematical models that can be satisfactorily To understand the fitted to a large number of actually observed ECGs. Fourier transforms and power spectra of observed ECGs, it is desirable that the mathematical models also have relatively simple Fourier transforms and power spectra. Based on empirical spectral analysis of ECGs, it was recently shown that a mathematical model based on the periodic approximation corresponding to harmonics up to the fifteenth multiple of the fundamental frequency (heart rate) compared well with the actual observed electrocardiogram in “ normal ” patients [I, 21. In this article a mathematical model for the individual P, QRS, and T waves, respectively, during the duration of a period (beat or cycle) is presented. The proposed model contains only 11 adjustable parameters for the representation of one period or beat and satisfies our requirements for accuracy. We discuss in considerable detail the calculation of the corresponding Fourier transforms and power spectra, with particular emphasis on the case of finite observation times. For the sake of simplicity, the Copyright 22
0 1971 by American Elsevier Publishing Company, Inc.
322
J. RICHARDSON,
L. J. HAYWOOD,
V. K. MURTHY
AND G. HARVEY
present treatment is limited to perfectly periodic wave forms. More realistic cases of nonperiodic and approximately periodic wave forms will be treated in a later communication. 2.
FORMULATION We
complex, sions.
OF MODEL
consider three elementary wave forms: the P wave, the QRS and the T wave. These are represented by the following expres-
(1) ag’ + apf
R(QRS) :
+ up, ‘:)exp[--q]=&(r-7.);
(2)
( T:
+exp[-wz]
= $r(t
- zr).
In (2) and in the following treatment we use, for the sake of brevity, the letter R to represent the QRS complex. In (I), (2) and (3) the amplitude coefficients ap, ap), ag), ag), and uT must be real but may be positive or negative. The width parameters b,, b,, and b, are conventionally assumed to be real and positive, although clearly the sign is of no consequence. The center positions zg, rR, and zr may of course assume any values in the interval of the time under consideration. Clearly, a wide variety of alternatives to the Gaussian function a exp[ - (t - T)2/2b2] may be considered that still give reasonably faithful representations of normal ECGs. However, the Gaussian function has many convenient properties, particularly in connection with the computation of the power spectrum. A simple alternative representation of a normal ECG wave form involves the use of a Gaussian pulse of the form (1) or (3) for each of the P, Q, R, S, and T elementary wave forms, thereby breaking the QRS complex into three separate wave forms. In this case, in order to represent one period or beat of a normal ECG, one must specify a, b, and z for five separate elementary wave forms, making a total of 15 parameters. Another representation used frequently involves 19 parameters [3]. The representation given here by Eqs. (l), (2), and (3) entails 11 parameters, a substantial reduction. The question, of course, remains how well real ECGs can be approximated. A perfectly periodic ideal ECG can be written in the form r(t) =
: l&O - rP - no) + &(t - rR - no) + &(t - rr - no)] (4) n=-m
ECG WAVE
FORMS
AND
POWER
323
SPECTRA
where Q is the period (i.e., the duration of one beat). The periodicity this expression can be easily verified by calculating v(t + f3).
of
3. FITTING THE MODEL TO OBSERVED WAVE FORMS Let us write
to-denote
the equation
of the P wave. Similarly,
T(t) = o,exp[-(‘2hT)‘] denotes
= &(t
- zT)
the T wave and
+
(1)
aR
d + ,(2)R dt
~t~]exp[-(t ;$)‘I=$Rct-
_
zR)
c7)
for the QRS complex. We now assume that P(t), to such a small extent that fitting the model to an observed ECG reduces to fitting the foregoing wave forms separately. Let us assume that the observed ECG has the values vi at a discrete set of points ti. We will assume that the ECG has been appropriately filtered to remove baseline drift, so that the values vi are measured relative to reasonable zeros of voltage. The mathematical problem for a given beat or period is to choose parameter values such that the errors denotes
the equation
T(t), and R(t) overlap
ei = vi - P(t,) -
R(ti) -
T(ti),
i=
l,...,N
(8)
are minimized according to certain criteria. According to the assumption of lack of overlap stated in the last paragraph, we can to a good degree of approximation handle the error minimizations for the P, R, and T wave forms separately in the intervals [tl, tNPR],[tN,,, tivRT], and [tag=, t,], respectively. yli = log Zri- log P(ti) = log q -
A, -
Bpti -
C&J?,
i=l
, .**, t Npn
(9)
where A, = log (a,) -’
,2b;’
1 B, = $3
C* = -5;.
(10)
P
The corresponding expressions for the T wave form are obvious. It is to be noted that in (9) considerable difficulty is encountered if any of the values of Vi are negative. These difficulties can be avoided if we eliminate from our calculation all values of i for which vi is negative. In fact, in order
324
J. RICHARDSON,
L. J. HAYWOOD, V. K. MURTHY AND G. HARVEY
to be on the safe side, we should eliminate all values of i for which ui is below a certain positive threshold. It is clear that we can readily apply least squares techniques to determine A,, BP, and C, in (9) and then calculate aa, b,, and rP using (10). The procedures for the T wave form are identical. In the case of the QRS complex, the codetermination of a&O),up), (2) Therefore, we propose a hybrid aR , 5R, and b, is not as straightforward. procedure. The last two parameters are determined by ad hoc procedures and then the first three are determined by conventional least squares techniques. We define x = t - zR and then write R(x + zR) = =
up’ +
ag’g
+ ag’ dx “:)
(a0+ a,x + cr2x2) exp
exp( -5) x2
(11)
-z2
(
R
)
where (2)
(1)
(2)
aR aR ai = --) u2 =4. (12) b; ’ bi b, rR and b, is as follows. We set rR The ad hoc procedure for determining equal to the time at which the maximum of the R wave (a component part of the QRS complex) occurs. We take b, equal to .423 times R-wave width at half maximum height (half-maximum points of original and model then coincide). Now, having determined zR and bR, we can determine uo, El? and a, by least squares techniques, that is, by minimizing the sum of the squares of the errors (0) _ aR a0 = aR
ei
=
ui
-
xi
=
ti -
(cc0 +
c(,xi
+
,
exp
a2xi)
i = NPR,. . ., IV,,. (13)
ZR,
This completes the discussion of the method for determining the parameters in the P wave form, T wave form, and QRS complex (denoted by R). 4.
FOURIER TRANSFORM
Since v(t) (given by (4)) is periodic sented by the Fourier series
u(t) = where
2
nl=-cc
with the period
21,eiJnnt
6, it can be repre-
(14)
325
ECG WAVE FORMS AND POWER SPECTRA
The coefficients
are given by
1 B dt o(t)e-““o’ 2: = -1 I1 0 o
= 1e “j,
+bR(t
1 =
-
11 “C4P(’
ZR
-
d)
+
dT(t
zR)
+
-
‘P
-
-
ZT
ne)
-
d)]e-imRf
m
g
_
s It is useful Writing
dt[4,(t
-
zp)
+
4R(t
-
$T(t
-
rT)]epimRt.
(16)
m
to work
out the details
in (16) for an arbitrary
frequency.
89 dt u(e) exp( - iot)
= exp( - i~0t,)~~(w)
s0 + exp( - iwr,)%(w)
+ exp( - ior,)@,,(
(17)
with a+.(w) = R T
sm
atqY~~(t)exp( -
--on
id),
(18)
R T
we obtain $(w)
= ,/27r b,a, exp( - +zo2bs)
T
T
T
(19)
T
and QR(m) = ,/2n
bR(ahoo’+ a~‘)ico + Gus’“)
exp( --$i2bi)
E IQRIexp(icc)
(20)
where IX= Arg(ak” pDRI
Alternatively, expression
=
[(up’
the angle
-
- LZ~~)CIJ~ + ag)io) upco2)2
-
c( is given
(21)
(uk”o)y.
(with an ambiguity
of +n)
by the
Ua])W
tan c!= Qk”’Using these results, v, = $exp( + exp( -
@la)
up(jp’
(16) can now be expressed
in the form
- imQr,)@,(mR) im&R)@R(m~)
+
exp(
-
indhT)@T(nzfi)].
(22)
It is to be noted that mP and @‘Tare always real, whereas QR is in general complex.
326
J. RICHARDSON,
The Fourier
L. J. HAYWOOD,
transform V(0) = =
V. K. MURTHY
AND G. HARVEY
of u(t) is given by
m dt u(t) exp( - iot) s -cc
sm --m
dt
f v, exp[?n=-co
i(0 - mQ)t]
= 27r F 0,6(0 - mR). WI=-CC This is an improper function composed of equally w-space with the v, as coefficients.
(23) spaced 6 functions
in
5. FOURIER TRANSFORM AND POWER SPECTRUM OF ECG VIEWED THROUGH A WINDOW
Instead of v(t), -cc < t < 00, let us consider window function belonging to L1; that is,
w(t)v(t) where w(t) is a
s sm m
--m
dt w’(t) < co.
For the best results, the function w(t) should be assumed smooth to avoid ripples in its Fourier transform. W(w) =
--m
dt w(t)e+‘;
(24) to be sufficiently
(25)
however, the subsequent treatment is not limited to this case. The Fourier transform of w(t)v(t) is found to be
s m
--co
dt w(t)v(t)e+’
= V,(w)
=
-f
v,W(w - msz),
(26)
??I=-CC
a function consisting of a superposition of W functions centered at w= . . ., -2Q -Q, 0, Q, 2Q, . . . with the coefficients v,. If the function W(w) is negligibly small when 101 > +Q, the functions W(w - m!A) and W(w - (m - 1)0) centered at adjacent positions w = rnfl and w = (m + 1)Q on the w axis will have negligible overlap. In this case the power spectrum is found to be
lUw)12 =
2
m=-CC
b,121Ww- mfW
(27)
ECG WAVE
FORMS
AND
POWER
327
SPECTRA
where Iv,12 is given by
+ z\iD,\iD, cos[o(zr
- rR) + E-J + 2qJDr
cos O(XT - rp)),=,*
(28)
This expression is valid independently of the signs of @r and @r. It is of interest to consider several representative “window” functions. Let us first consider w(t) = 1, = 0,
Itl < +T,
I4 > %T,
(29)
corresponding to an observation of the unmodulated wave z)(t) in the time interval [ - +T, +T]. The corresponding Fourier transform is W(w) = Another
possibility
sin(3w-r) (30)
.
$0
is t2
( >
44 = exp
-9
(31)
,
in which case W(o)
= llr;l d exp( - +~‘g”).
It is to be noted that the W just given (32) has a smooth ripples characteristic of (30).
(32) form without
the
6 DISCUSSION We have described a parametrized mathematical model having the following properties. I. It involves only 11 parameters for the representation of an ECG for one beat or period (or, alternatively, for the representation of a periodic ECG of arbitrary length). 2. It allows the use of a relatively simple procedure for the determination of the parameters giving an optimal fit to an observed ECG. This procedure entails the underlying assumption that the P wave form, the T wave form, and the QRS complex overlap to a negligible extent. On the other hand, the procedure allows for the fact that the Q, R, and S components of the QRS complex may overlap strongly. 3. In the frequency domain, the model has about the same degree of complexity as in the time domain. We have also determined the effects of the observational window on both the Fourier transform and the power spectrum.
328
J. RICHARDSON,
L. J. HAYWOOD,
V. K. MURTHY
AND G. HARVEY
Further theoretical work, of course, needs to be done. The treatment in this article is limited to the overidealized case of perfectly periodic ECGs. In a later communication, we will deal with the problems arising from various degrees of aperiodicity. Additional effort is being expended on testing how well the model can be fitted to actual observed ECGs, at least for one beat. The results of this work will be presented in a later communication.
ACKNOWLEDGMENT This investigation was supported by PHS grant number HS00106 from the National Eenter for Health Services Research and Development. REFERENCES 1 V. K. Murthy, L. J. Haywood, J. Richardson, R. Kalaba, S. Saltzberg, G. Harvey, and D. Vereeke, Math. Biosci. 6, 357 (1971). 2 V. K. Murthy, L. J. Haywood, D. Vereeke, R. Kalaba, G. Harvey, S. Saltzberg, and J. Richardson, Proc. 4th Asilomar Conf. Circuits and Systems (November, 1970). 3 L. J. Haywood, S. Saltzberg, and V. K. Murthy, 8th International Conference on Medical and Biological Engineering, 16-6, July, 1969.