Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Design of a Synthetic ECG Signal Based on the

Fourier Series

Jan Kubicek, Marek Penhaker, Radana Kahankova


Department of Cybernetics and Biomedical Engineering
VSB-Teclmical University of Ostrava, FEI,
17.1istopadu 15, 70833, Ostrava-Poruba, Czech Republic
jan.kubicek@vsb.cz, marek.penhaker@vsb.cz, radana.kahankova.st@vsb.cz

Abstract- The main objective of this work is creation of a not observable, to a value of 0.3 mY. The duration is about
synthetic ECG signal in software MA TLAB based on the analysis 100 ms.
of Fourier series. The individual elements of ECG signal are
approximated by mathematical model, which is thoroughly de­ R
scribed, explained and then applied. The output is a synthetic
model of an ECG. Our approach to modeling biological signals
allows change input parameters (amplitude and period of
significant elements ECG). Synthetic models of biological signals
P-R SOT
can be used for demonstration purposes, but mainly serves as a segment segment

material for functionality detectors for measuring and predicting


lengths of waves and intervals. u

Keywords-ecg; Synthetics; Fouirier series


SoT
P-R
1. INTRODUCTION 5 interval
interval ......

The electrocardiogram (ECG) is a graphical representation QRS


Q-T
komplex
of the electrical activity of the heart and in medicine plays an interval

indispensable role. ECG is one of the indicators of the total, as Fig. I. ECG signal

well as the current state of the human organism is therefore an


P-R interval
important diagnostic benefit.
This interval includes atrial actIVIty, ie the P wave, the
The aim of this work is to create a synthetic ECG signal
passage of impulses through the AV node, ie the PR segment,
using Fourier series and thus elucidate their theory in practice.
and ends at the beginning of the activity chambers, ie in the
For implementation was chosen MATLAB simulation
ventricular QRS complex. We can say, that this interval
software.
describes the atrio ventricular conduction. The length of this
For creation a synthetic model of any biological signal is
interval is in the healthy population ranges between 120 and
required knowledge of the typical characteristics and
200 ms.
parameters.
Fourier series is very helpful instrument for approximation
QRS complex
of periodic signals, which includes ECG. They therefore
The QRS complex is a graphical representation of
applied to the basic ECG curve suitably distributed to
depolarization of the ventricles. It consists of waves Q, R and
elementary functions. [15]
S. Q wave, which is the first negative a part of
II. MORFOLOGY OF ECG electrocardiogram, reaching a quarter of the amplitude of the
new wave R and takes less than 30 ms. R wave, positive
An electrocardiogram is composed of several specific
displacement follow-up wave Q, can takes sizes up to several
parts, those parts are connected by isoelectric line.
mV, but can also be completely missing, which almost always
Isoelectric line is a section where the heart is inactive for a
refers to the pathological state of the heart. The last wave of
short time, this part of the ECG signal is given a zero voltage
the complex is also negative and is called S. Its amplitude
level. [5], [3]
value is 0.8 mY, and takes about 50 ms. Complex QRS is
given by range 50 to 110 ms. [2], [4]
P-wave
P wave is the first element of the ECG signal. This positive S-T segment
wave is given by activities sinoatrial node and indicates the S - T segment is normally horizontal and isoelectric
electrical activation of the atria, ie their depolarization. The segment between the QRS complex and the T wave. In
amplitude can takes different values from 0, when this wave is various heart diseases are added deviation.

978-1-4799-3080-7114/$31.00 ©2014 IEEE 1881


T-wave
In this part of the heart muscle is electrically returned to
the idle state. This process is also called repolarization. The
amplitude of this wave takes to 0.8 mV and lasts until 0.42
ms. [1], [10], [11]

III. DECOMPOSITION OF THE ECG SIGNAL

The Fourier series is used for the decomposition of Fig. 3. Fourier expansion of P wave

periodic functions. ECG signal is not periodic, because the


heart is not a machine. No two records of electrocardiograph Model of QRS complex
are the same, there are artifacts and various changes and also Wave R is as Q and S waves of triangular shape. They can
the very heartbeat is not regular. We can describe ECG signal be divided into two parts - the falling and rising and these can
by repetitive function. [6], [7] be represented by elementary functions (t)= -t and f(t) =
For the purposes of this paper, this fact is overlooked and t , with different shift and slope for the needs of each wave.
the ECG signal will be seen as a periodic function and it will For creation an upward portion of the QRS complex was
therefore be decomposed using Fourier series. Firstly we selected elementary function of the form f(t)= t
performed rough analysis of the ECG signal (Fig. 2). ECG Decomposition using Fourier series may be follows:

1 fc+Zrrt dt= -1 [t2] c+zrr


curve is composed of a repeating sine waves (P waves, T, U)
and triangular (QRS complex) form, which can be further
simplified so therefore was divided into 11 parts, and these rrC
ao = - rrZc = 0
- (5)
were described by mathematical functions.
Where a,b,c,d,k,l,m,n are coefficients describing shifts and 1 fc+zrrt cos(kt) dt= 0
ak= -rrc (6)
slope of elementary functions, which represent different parts
of the ECG. [11] 1 fc+zrrtsm(kt)dx=
. lZ
bk=;
c (-1) k+ k (7)

_1
f(t)= 2 Ir=l ( �k+1 sin(kt) (8)

§ 0

/#/-0

·'o!;------!c---;',;---;';c,,--,�--�--�
Fig. 4. Fourier series of ascending part QRS complex
Fig. 2. Decomposition of the ECG signal
Descending part of these waves, by contrast, decreasing
character. For the creation of the model is therefore selecting
IV. THE DESIGN OF A MATHEMATICAL MODEL ECG
the most appropriate elementary functions f(t)= -t
Decomposition using Fourier series may be follows:
Models of P and T waves
1 fc+Zrr-t dt= -1 [-_t2]c+zrr
-tz.
P and T waves can be approximated by a parabolic
function. We used a mathematical formulation f(t)= rrc
ao = - rr Z c = 0 (9)
The final form will be affected by the adjustable parameters
such as shift or width. Mathematical formulation has the 1 fc+zrr-t cos(kt) dt= 0
ak= -rrc (10)
following form:
+zrr k+ l
(1) rrc - tsin(kt)dx= - (( _ 1) �k)
bk= � { (11)

1 fc+zrr-tZcos(kt) dt f(t)= -2 Ir=l (-It+>sin(kt) (12)


ak= -rrC (2)

1 fc+zrrtsm(tx)dx
.
bk=-
rrc =0 (3)

(_l)k COs(kt)
f(t)= 4 Ir=l--;;z (4)

1882 20 I4Internationai Conference on Advances in Computing, Communications and Informatics (ICACCI)


Further step shows the algorithm adapts to the shape of
tbe ECG signal according to tbe variables a - g, given by tbe
user. Tbe variables are described below. Tbe principle of tbeir
effect on tbe sbape of individual elements can be seen in tbe
example of tbe source code.

T ableI. Parameters 0 f the synthetlc


. ECG sIgna

Fig. 5. The descending part of the QRS complex Function in synthetic Physiological
Variable
ECG signal interal
V. CREATION OF SYNTHETIC ECG SIGNAL
a Amplitude ofP wave 0-0.3 mV
Syntbetic ECG signal was developed using MATLAB
b Length ofP wave 0-160 ms
software. Advantage of tbe proposed metbod is relatively bigb
accuracy of approximations, but higher computational time. Amplitude of theQRS
c O-O.S mV
With the help of the mathematical model proposed in the complex
previous cbapter bas now made it possible to create a basic Lengtb ofQRS
synthetic ECG waveform in MATLAB. The form of the d SO-120 ms
complex
equations wbicb are given in Table 1, were selected according e Amplitude of T wave O-O.S mV
to tbe tbeoretical derivation and tben slope coefficients
f Length of T wave 0-300 ms
according to the desired appearance of the resulting ECG. The
lengths of the sections correspond to physiological parameters
and ECG algoritbm are tben determined intervals between
major sections named timeline TI - TIO, which determine the Approximation of significant parts ECG
beginnings and ends of eacb part of tbe syntbetic ECG. [17], fO=O;
[IS] fl=a-«allOO)/1S)*«SO/b)*(t-(200+(b/2))))1\2;%P wave
£2=0; %PQ interval
f3=«(140-d)/100)*g+ I)*c*« -1.1*0.3*(t-440))/20) %Q wave
f4=«(140-d)/100)*g+1)*c*«I.1*0.6*(t-(440+(I.S*d/7))))/20);
%R wave
fS=«(140-d)/100)*g+I)*c*«-I.I*0.S*(t-(440+(S*d/7))))/20);
I ... .. . ." : . ..
__ . � , · , • • . !. . _ . . - �- . . . . .
%passage of R, S
f6=«(140-d)/100)*g+I)*c*«(1.1*0.S*(t-(d+440)))/20); %wave
S
f7=0; %ST interval
01----
f8=e-((e/1OO)/1S)*((SO/f)*(t-(6S0+(f/2)))Y'2;%wave T
f11=0;
TO=O;
TOI=200; %beginning ofP wave
-0 50 lOO _ 3id -I0Il !ilX) 600 1I;Il EO! !Oil 1«0
""'"I
Tl=200+b; %end ofP wave
Fig. 6. Synthetic ECG signal T2=440; %beginning ofQRS complex
T3=440+(d/7);
T4=440+3*(d/7);
Part of proposed algoritbm TS=440+6*(d/7);
period=1OOO;%period of function T6=440+d; %end ofQRS complex
omi=2.*pi/period;%angular frequency T7=6S0; %beginning of T wave
aO=2/period*int(fO,t,TO,TO1)+2/period*int(fl,t,TOI,TI)+ ...+21 TS=6S0+f; %end of T wave
period.*int(f11,t,TS,T9);%coefficient aO T9=1000;
an=2/period*int(fO*cos(oml.*n.*t),t,TO,TOl)+...+2/period. *in
t(f11 *cos(omi.*n.*t),t,TS,T9);%coefficient an
bn=2/period*int(fO*sin(om1*n*t),t,TO,TO1)+...+2/period.*int(
VI. SIMULATION OF PATHOLOGICAL ECG
f11 *sin(oml.*n.*t),t,TS,T9);%coefficient bn
four=aO/2+symsum(an.*cos(omi. *n. *t)+bn.*sin(omi. *n. *t),n,
1,20); Supraventricular Tachycardia
t=0:10:IOOO;%interval of ECG This type of accelerated heartbeat (tachycardia) is
four=subs(four);%transformation to a numeric variable cbaracterized by a patbological rbytbm indicating tbe center is
located above the ventricles. ECG of this pathology is
characterized by increased frequency above 90 beats per
minute. Tbe sbapes of tbe individual waves andQRS complex

20 i4 International Conference on Advances in Computing, Communications and informatics (ICACCI) ISS3


are normal, between them are reduced in proportion to the
tachycardia. [5], [14]

Fig. 11. atrial flutter [14]

The design of this pathology requested stronger


Fig. 7. Supraventricular tachycardia [14]
intervention in the basic model of synthetic ECG signal. Left
to the equation for the QRS complex, contrariwise the wave
The implementation was performed by modifying the basic functions for P, Q, and individual isoelectric line were
synthetic ECG shortening the isolectric line between replaced by such whose appearance simulates a typical
individual parts ofECG. sawtooth waves of atrial flutter. [5], [14], [15], [16]

.s
••

",...., Fig. 12. Synthetic model of atrial flutter


Fig. 8. Simulation of supraventricular tachycardia
VII. CONCLUSION
Sinus Bradycardia
The aim of this work is to create a synthetic ECG signal in
Bradycardia refers to a slowed heart rate. Frequency is less
software MATLAB. In the first step, it was necessary to
than 1 Hz (60 beats per minute). P wave and QRS interval
prepare a theoretical basis for further development work -
have normal shape, PQ interval is extended proportionally.
closer to ECG signal specified, to clarify the circumstances of
[5], [14]
its origin and describe the different parts and shapes of real
ECG signal.
ECG signal was divided into various parts, which were
substituted by elementary functions. The aim of an analysis is
Fig. 9. Sinus bradycardia [14] an approximation of individual parts ECG by continuous
curves. The subsequent development of these periodic
Bradycardia is reverse pathology to tachycardia. The
functions was solved by Fourier series. The proposed
overall appearance of the individual parts again remains, but
methodology allows the simulation of pathological
parts between them are extended. Simulation of pathology was
phenomena in ECG records.
performed by similar alghorithm as supraventricular
The proposed algorithm can be used as a basis for
tachycardia. There was a significant prolongation of
detecting pathologies in the ECG. We would like to focus in
isoelectric line.
our future work on the detection of specific abnormalities in
ECG records using the numerical synthetic model.

ACKNOWLEDGMENT

The work and the contributions were supported by the


project SP20141194 'Biomedicinske inzenyrske systemy X',
and paper has been elaborated in the framework of the project
"Support research and development in the Moravian-Silesian
....!----=.- -'-, Region 2013 DT 1 - International research teams"
Fig. 10. Simulation of sinus bradycardia (RRC/05/2013). Financed from the budget of the Moravian­
Silesian Region. . The paper has been elaborated in the
Atrial Flutter
framework of BIOM (reg. c. CZ.l.0712.3.00120.0073).
Last of pathologies selected for this work is Atrial Flutter.
It is a type of heart failure which is caused by abnormal REFERENCES
proliferation of cardiac conduction in atrias. Atrial flutter is
[I] P. Osmancik "EKG ucebnice" 3. lekarska fakulta. III. intern! -
often accompanied by increased heart rate - tachycardia. kardiologicka klinika 3. LF UK a FNKV, 2011. [online]. 2011. ISBN
Flutter is characterized by distinct atrial waves "F" that still 978-80-260-1763-9. Dostupne z: http://www. ucebnice-ekg.cz
have the same saw-tooth shape, heart activity often stays [2] J. Hampton "EKG strucne, jasne, prehledne". 1. ceske vyd. Praha:
regular. Grada, 2013,192 s. ISBN 978-80-247-4246-5.
[3] L. Navratil "Medicinska bioJYzika" Vyd. I. Praha: Grada, 2005, 524 s.
ISBN 80-247-1152-4.

1884 2014 International Conference on Advances in Computing, Communications and Informatics (ICACCI)
[4] A. Merunkova, M.Ore!." Anatomie a/yziolof!,ie CloVlika: pro humanitni
obory" Vyd. l. Praha: Grada, 2008, 302 s. Psyche (Grada). ISBN 978-
802-4715-216.
[5] M. Stejfa, M.. Orel ,,Kardiolof!,ie: pro humanitni obory". l. vyd. Praha:
Grada publishing, 1998, 492 s. Biomedicinska infonnatika, 4. ISBN 80-
716-9448-7.
[6] E. Bruce M. Ore!."Biomedical sif!,nal processinf!, and siRnal modelinf!,"
\. vyd. New York: John Wiley, 2001, 520 s. Biomedicinska infonnatika,
ISBN 04-713-4540-7.
[7] E. Bruce M. Ore!. ,,Nonlinear biomedical sif!,nal processinf!," \. vyd.
New York: IEEE Press, 200I, 341 s. Biomedicinska infonnatika, 4.
ISBN 07-803-6012-5.
[8] Fourierovy fady. USTAV MATEMATIKY FSI VUT V
BRNE. MATEMATIKA online [online]. 2007 [cit. 2013-10-10].
Dostupne z: http://mathonline.fine.vutbr.cz/

[9] M. Penhaker ,,Lekafske diaf!,nosticke pfistroie" ucebni texty. I. vyd.


Ostrava: VSB - Technicka univerzita Ostrava, 320 s. ISBN 80-248-
0751-3.
[10] J. Rozman "Elektronicke pfistroie v lekafstvi" l. vydani, Praha :
Academia, 2006. 408 s. ISBN 80-200-1308-3
[II] R. KArthik "ECG simulation usinf!, MATLAB" Principle of Fourier
Series. College of Engineering, Guindy, Anna University, Chennai,
2006. Projekt. Anna University.
[12] P. Haman "Vyukovy web EKG" PIzen [cit. 2014-04-17].
[13] P. Mcsharrv. G. Cliford. L. Tarassenko. L. Smith ..A Dvnamical Model
for Generating Synthetic Electrocardiogram Signals", iEEE
Transactions On Biomedical Engineering. 2003, vo!' 50, no. 3
[14] M. Augustynek, Z.Labza M. Penhaker, D. Korpas "Verification of Set
Up Dual-Chamber Pacemaker Electrical Parameters" 20I0 Second
International Conference on Computer Engineering and Applications.
IEEE, 2010, s. 168-172. DOl: 1O.1109/ICCEA.2010.187
[15] 1. Pindor, M. Penhaker, M. Augustynek, D. Korpas, "Detection of ECG
Significant Waves for Biventricular Pacing Treatment". In 2010 The
2nd International Conference on Telecom Technology and Applications,
ICTTA 2010. March 19-21, 2010, Bali Island, Indonesia. 2010, p. 164-
167. ISBN 978-0-7695-3982-9., DOl: 10.1109/ICCEA.20I 0.186
[16] 1.Kubicek, M. Penhaker, "Measurement and Simulation of Pacemaker
Supply Management" In The 6th Asian Conference on Intelligent
Infonnation and Database Systems, 7th - 9th April, 2014 Bangkok,
Thailand, vo!' 551, pp. 265-273, Springer International Publishing, Print
ISBN 978-3-319-05502-2, Online ISBN 978-3-319-05503-9, Series
ISSN I860-949X, DOl 10.1007/978-3-319-05503-9_26.
[17] 1. Kubicek, V. Foldynova, "Proposing the Method for Measuring the
Batery State Charge" In Proc. International Conference on Biomedical
Engineering and Environmental Engineering, Singapore, December 1-3
,2013
[18] T. D'Alessio, S. Conforto, (2001) "Extraction of the envelope from
surface EMG signals", Engineering in Medicine and Biology Magazine,
IEEE, 20(6), 55-6\.

2014 International Conference on Advances in Computing, Communications and Informatics (ICACCI) 1885

You might also like