**1. Introduction**

According to the World Health Organization (WHO), cardiovascular diseases (CVDs) are the number one cause of death globally, and an estimated 17.7 million people died from CVDs in 2015, representing 31% of all global deaths, of these deaths, an estimated 7.4 million were due to coronary heart disease (CHD) [1]. CHD is a narrowing or blockage of the blood vessels that supply blood and oxygen to the heart, then, the cells in the region served by the vessel will behave abnormally due to hypoxia (myocardial ischemia) or may die (myocardial infarction) [2]. In Mexico, data of the National Institute of Statistics and Geography (INEGI) showed that in 2015, the heart diseases are the main cause of death, and the most frequent is the ischemic heart disease (IHD) [3].

have been standardized. The lead system most accepted in clinical practice is the standard 12-lead system, that is, the combination of the bipolar limb leads I, II and III, the augmented unipolar limb leads aVR, aVL and aVF and the six unipolar precordial leads V1–V6. Limb leads (I, II, III) derive signals from the left arm (LA), the right arm (RA) and the left leg (LL).

An Algorithm Based on the Continuous Wavelet Transform with Splines for the Automatic…

http://dx.doi.org/10.5772/intechopen.74864

25

In **Figure 1**, waves and intervals of interest of the ECG are shown. The P, QRS and T waves reflect the rhythmic electrical depolarization and repolarization of the myocardium associated with the contractions of the atria and ventricles. The P wave represents depolarization of the atrial musculature. The QRS complex is the combined result of the repolarization of the atria and the depolarization of the ventricles, which occur almost simultaneously. The T wave

Time intervals like RR and QT are important in electrocardiographic diagnosis because they reflect electrophysiological processes of heart and autonomic nervous system (ANS) and carry clinical implications when they lie outside the range of the normal variation. The RR interval measured from the R wave peak to the peak of the next consecutive R wave is the interval between consecutive heart beats, and it determines the heart rate (HR). The QT interval measured from the Q wave onset to the T wave end reflects the total period of ventricular depolarization and repolarization, and it is used in clinical electrocardiology to quantify the

Prolongation of the QT interval is recognized as an indicator of an increased risk of malignant ventricular arrhythmias and/or sudden cardiac death in various clinical conditions such as myocardial infarction or ischemia, electrolyte or metabolic imbalance or the action of various drugs [9, 10]. Also, QT interval has an interlead space variability, which led to the hypothesis that the differences between electrocardiographic leads might reflect regional differences in repolarization. Based on experimental and clinical electrophysiological studies which supported the evidence that increased heterogeneity of repolarization may be responsible for

The right leg (RL) electrode is the common reference in the amplifier [8].

represents repolarization of the ventricles.

duration of ventricular repolarization [9].

**Figure 1.** Waves and intervals of interest of the ECG.

The kidneys are a pair of bean-shaped organs that lie on either side of the spine in the lower middle of the back. Its main function is to remove soluble waste products and excess water and electrolytes from the bloodstream. Chronic kidney disease (CKD) is defined as abnormalities of kidney structure or function, present for 3 months or more, with implications for health [4]. Abnormalities in kidney structure (damage) usually precede abnormalities in function. CKD is divided into five stages of increasing severity. Stage 5 referred to as kidney failure or end-stage renal disease (ESRD) is traditionally considered as the most serious outcome of CKD because there is total or near-total loss of kidney function and patients require treatment with dialysis or transplantation.

CKD is considered a risk factor for the development of cardiovascular disease (CVD) because patients with CKD are more likely to die of CVD than to develop kidney failure [4, 5]. Primary types of CVDs with a high prevalence in CKD are arterial vascular disease in its two subtypes: atherosclerosis and arteriosclerosis, and cardiomyopathy. Clinical presentations of atherosclerosis include IHD, manifested as angina, myocardial infarction and sudden cardiac death, which is common in CKD, cerebrovascular disease, peripheral vascular disease and heart failure [5]. Patients with ESRD requiring maintenance hemodialysis (HD) have a high mortality rate, which is primarily attributable to CVD, including ventricular arrhythmias and sudden death, and the incidence of arrhythmias increases during and immediately after HD [6, 7].

Therefore, the use and development of noninvasive techniques such as electrocardiography, which records the electrical activity generated by the muscles of the heart in the surface of the body, open a useful perspective for diagnosis and treatment in patients with heart diseases such as ischemia and infarction. The electrocardiogram (ECG) is the waveform produced by this electrical activity of the heart and its generation depends on four electrophysiological processes such as the formation of electrical impulse in the main heart pacemaker (sinoatrial node), the transmission of this impulse through specialized fibers in the conduction, the activation (depolarization) and the recovery (repolarization) of the myocardium [8].

The electrical activity generated by the heart can be modeled as a vector whose magnitude and direction change throughout the cardiac cycle. To record the different projections of this vector, several electrodes are attached to the body in different locations known as leads. Because each lead measures the ECG between two points from different directions, amplitudes, polarities, times and durations of the ECG components vary between leads, so these have been standardized. The lead system most accepted in clinical practice is the standard 12-lead system, that is, the combination of the bipolar limb leads I, II and III, the augmented unipolar limb leads aVR, aVL and aVF and the six unipolar precordial leads V1–V6. Limb leads (I, II, III) derive signals from the left arm (LA), the right arm (RA) and the left leg (LL). The right leg (RL) electrode is the common reference in the amplifier [8].

In **Figure 1**, waves and intervals of interest of the ECG are shown. The P, QRS and T waves reflect the rhythmic electrical depolarization and repolarization of the myocardium associated with the contractions of the atria and ventricles. The P wave represents depolarization of the atrial musculature. The QRS complex is the combined result of the repolarization of the atria and the depolarization of the ventricles, which occur almost simultaneously. The T wave represents repolarization of the ventricles.

Time intervals like RR and QT are important in electrocardiographic diagnosis because they reflect electrophysiological processes of heart and autonomic nervous system (ANS) and carry clinical implications when they lie outside the range of the normal variation. The RR interval measured from the R wave peak to the peak of the next consecutive R wave is the interval between consecutive heart beats, and it determines the heart rate (HR). The QT interval measured from the Q wave onset to the T wave end reflects the total period of ventricular depolarization and repolarization, and it is used in clinical electrocardiology to quantify the duration of ventricular repolarization [9].

Prolongation of the QT interval is recognized as an indicator of an increased risk of malignant ventricular arrhythmias and/or sudden cardiac death in various clinical conditions such as myocardial infarction or ischemia, electrolyte or metabolic imbalance or the action of various drugs [9, 10]. Also, QT interval has an interlead space variability, which led to the hypothesis that the differences between electrocardiographic leads might reflect regional differences in repolarization. Based on experimental and clinical electrophysiological studies which supported the evidence that increased heterogeneity of repolarization may be responsible for

**Figure 1.** Waves and intervals of interest of the ECG.

**1. Introduction**

24 Topics in Splines and Applications

heart disease (IHD) [3].

ment with dialysis or transplantation.

According to the World Health Organization (WHO), cardiovascular diseases (CVDs) are the number one cause of death globally, and an estimated 17.7 million people died from CVDs in 2015, representing 31% of all global deaths, of these deaths, an estimated 7.4 million were due to coronary heart disease (CHD) [1]. CHD is a narrowing or blockage of the blood vessels that supply blood and oxygen to the heart, then, the cells in the region served by the vessel will behave abnormally due to hypoxia (myocardial ischemia) or may die (myocardial infarction) [2]. In Mexico, data of the National Institute of Statistics and Geography (INEGI) showed that in 2015, the heart diseases are the main cause of death, and the most frequent is the ischemic

The kidneys are a pair of bean-shaped organs that lie on either side of the spine in the lower middle of the back. Its main function is to remove soluble waste products and excess water and electrolytes from the bloodstream. Chronic kidney disease (CKD) is defined as abnormalities of kidney structure or function, present for 3 months or more, with implications for health [4]. Abnormalities in kidney structure (damage) usually precede abnormalities in function. CKD is divided into five stages of increasing severity. Stage 5 referred to as kidney failure or end-stage renal disease (ESRD) is traditionally considered as the most serious outcome of CKD because there is total or near-total loss of kidney function and patients require treat-

CKD is considered a risk factor for the development of cardiovascular disease (CVD) because patients with CKD are more likely to die of CVD than to develop kidney failure [4, 5]. Primary types of CVDs with a high prevalence in CKD are arterial vascular disease in its two subtypes: atherosclerosis and arteriosclerosis, and cardiomyopathy. Clinical presentations of atherosclerosis include IHD, manifested as angina, myocardial infarction and sudden cardiac death, which is common in CKD, cerebrovascular disease, peripheral vascular disease and heart failure [5]. Patients with ESRD requiring maintenance hemodialysis (HD) have a high mortality rate, which is primarily attributable to CVD, including ventricular arrhythmias and sudden death, and the incidence of arrhythmias increases during and immediately after HD [6, 7].

Therefore, the use and development of noninvasive techniques such as electrocardiography, which records the electrical activity generated by the muscles of the heart in the surface of the body, open a useful perspective for diagnosis and treatment in patients with heart diseases such as ischemia and infarction. The electrocardiogram (ECG) is the waveform produced by this electrical activity of the heart and its generation depends on four electrophysiological processes such as the formation of electrical impulse in the main heart pacemaker (sinoatrial node), the transmission of this impulse through specialized fibers in the conduction, the acti-

The electrical activity generated by the heart can be modeled as a vector whose magnitude and direction change throughout the cardiac cycle. To record the different projections of this vector, several electrodes are attached to the body in different locations known as leads. Because each lead measures the ECG between two points from different directions, amplitudes, polarities, times and durations of the ECG components vary between leads, so these

vation (depolarization) and the recovery (repolarization) of the myocardium [8].

generation of malignant ventricular arrhythmias, the interlead variation of QT interval duration was proposed as an index of arrhythmia susceptibility [10]. This measure was termed QT dispersion (QTd), and it was defined as the difference between the maximum and minimum QT interval on the standard 12-lead ECG [11].

In this chapter, *B*-splines have been used which allow the evaluation of the CWT in any integer scale [20]. In this formulation, the input signal *x*(*t*) and the analyzing wavelet *ψ*(*t*) are both

An Algorithm Based on the Continuous Wavelet Transform with Splines for the Automatic…

from polynomial segments of degree *n* of unit length that are smoothly connected together at joining points called knots in such a way that guarantees the continuity of the function and its

Assuming that the input signal *x*(*t*) is characterized in terms of its *B*-spline expansion of degree

x(t) <sup>=</sup> <sup>∑</sup><sup>k</sup>∈<sup>Z</sup> c(k) <sup>β</sup>n1(t <sup>−</sup> k) (2)

*<sup>ψ</sup>*(*t*) <sup>=</sup> <sup>∑</sup>*<sup>k</sup>*∈*<sup>Z</sup> <sup>p</sup>*(*k*) *<sup>β</sup><sup>n</sup>*2(*<sup>t</sup>* <sup>−</sup> *<sup>k</sup>*) (3)

*B*-splines satisfy a two-scale equation for any integer *m*, where *m* is not restricted to a power of

*mn*<sup>2</sup> (∑ *k*=0 *m*−1 *z* <sup>−</sup>*<sup>k</sup>* ) *n*2 +1

*k*<sup>0</sup> = (*n*<sup>2</sup> + 1)(*m* − 1)/2 (6)

Therefore, the resulting CWT at scale *m* evaluated at integer time samples is a polynomial

Inc.) [22] calculates the CWT of the discrete signal *x*(*t*) at the integer scale *m* of the cubic spline wavelet (*<sup>n</sup>* <sup>2</sup> <sup>=</sup> <sup>3</sup>) with expansion coefficients spline *<sup>p</sup>*, where *x*(*t*) is considered a spline of order *<sup>n</sup>*<sup>1</sup> <sup>=</sup> 1. Implementation of the program *spwav* is based on the fast algorithm proposed by Unser

*n*2

and *m* are not both even, is given by *z* transform,

*<sup>n</sup>*<sup>2</sup> ∗ *bn*<sup>1</sup> +*n*<sup>2</sup>

is equivalent to a cascade of (*n*<sup>2</sup> <sup>+</sup> 1) filters of moving average of order (*<sup>m</sup>* <sup>−</sup> 1) with an

)represents the upsampling of the sequence *p* by a factor of *m*,

, *<sup>n</sup>*1) developed by Arregui (written in MATLAB®, The MathWorks

is the *B*-spline representation of a spline of order *n*<sup>1</sup> <sup>+</sup>

⁄*m*) = ∑*<sup>k</sup>*∈*<sup>Z</sup>*([*p*]↑*<sup>m</sup>* ∗ *um*

*<sup>n</sup>*2(*z*) = *zk* \_\_\_0

, respectively. The splines considered are constructed

http://dx.doi.org/10.5772/intechopen.74864

with its *B*-spline expansion

)(*k*) *β<sup>n</sup>*2(*t* − *k*) (4)

+1 ∗ *c*)(*k*) (7)

(5)

27

and *n*<sup>2</sup>

two; thus, the wavelet expanded by a factor *m* can be expressed as:

*<sup>n</sup>*2(*k*), when *n*<sup>2</sup>

*CWT*{*x*(*t*), *m*, *k*} = ([*p*] ↑*<sup>m</sup>* ∗ *um*

that ensures its symmetry, *b<sup>n</sup>*<sup>1</sup>

*n*2

*s* are the *B*-spline coefficients.

et al. [20], which is done in the following three steps:

+*n*2 +1

polynomial splines of degree *n*<sup>1</sup>

derivatives up to order (*n*−1) [21]

*ψ*(*<sup>t</sup>*

*um*

where the sequence *um*

spline function given by:

where the notation ([*p*] <sup>↑</sup>*<sup>m</sup>* <sup>∗</sup> *um*

The program *<sup>w</sup>* <sup>=</sup> *spwav* (*x*, *<sup>m</sup>*, *<sup>p</sup>*, *<sup>n</sup>*<sup>2</sup>

*n*2

with

the filter *um*

*<sup>n</sup>*<sup>2</sup> <sup>+</sup> <sup>1</sup> and *<sup>c</sup>* (*k*)′

offset *k* 0

and the sequence of *B*-spline coefficients *c*(*k*)

Likewise, the wavelet *ψ*(*t*) is a spline of degree *n*<sup>2</sup>

*n*1

Increased QTd has been associated with an increased risk for ventricular arrhythmias and sudden death in the general population and in various clinical conditions, among them, CKD is common. Several studies have reported that QTd increased in patients with ESRD, particularly after the end of HD [6, 12], so that it may be useful to identify patients at high risk for overall and cardiovascular mortality [13]. However, this index is affected by: an inaccurate measurement of the QT interval because of different definitions for the T wave end (with and without fusion with U or P waves), influence of HR, no simultaneous ECG leads recordings and number of ECG leads and of the ECG lead system used [14].

As beat-by-beat manual measurement of QTd on three orthogonal ECG leads is impractical in routine clinical practice, the development of accurate and robust methods for automatic detection of characteristic points of QRS and T waves is important in electrocardiographic diagnosis, in particular for the analysis of long recordings [15]. Wavelet transform is a suitable tool that has been used to determine peaks and limits of ECG waves because of its ability to detect transients and of its robustness in front of noise and artifacts [16–18]. This chapter presents the development of an algorithm based on the continuous wavelet transform (CWT) with splines for the automatic measurement of QTd in the quasi-orthogonal leads DI, aVF and V2, and its application for the analysis of QTd in patients with CKD.
