Authors: Ben Ali Sabrine, Aguili Taoufik
Categories: Article, Fractal dimension, Fractal signal, Electrocardiogram signal, Classification of heart diseases
Source: The Journal of Tehran University Heart Center
Authors: Ben Ali Sabrine, Aguili Taoufik
Fractals are an intriguing mathematical tool that enables us to model the intricate structures found in nature and comprehend the complexity of such objects. They serve as a valuable resource for better understanding our world. Fractal objects are typically characterized by their fractal dimension, which plays a vital role in the analysis of fractal signals. In this study, we define the concept of fractal dimension and present various methods for its calculation. We demonstrate that the electrocardiogram (ECG) is a fractal signal, allowing us to classify heartbeats based on fractal theory. Our goal is to develop a digital technique for ECG signal analysis, with the aim of achieving accurate diagnosis of cardiovascular diseases.
Fractal geometry emerged in the 1970s as a culmination of over a century’s worth of research in mathematics and physics. This innovative field introduced novel concepts, such as fractal dimension and fractal signal, which helped deepen our understanding of various phenomena. The distinguishing feature of fractals is their fractal dimension, which serves as the primary characteristic of each fractal object. This dimension encapsulates information on the object’s geometric structure and is considered a potent indicator for gauging its irregularity. It is the overarching measure of the erratic nature of fractal objects. Regarding temporal signals, the fractal dimension serves as a quantifier for the degree of their fluctuation, enabling us to analyze, compare, classify, and predict these signals. A key attribute of fractal signals is their resilience to changes in time or space dilation. Fractal signals can either be one-dimensional, such as fractal time series, or multidimensional, like fractals derived from natural terrain models. Moreover, these signals may exhibit either continuous or discrete amplitude, as well as continuous or discrete character.
Our work aims to explore the connection between fractal signals and their fractal dimensions, focusing on how fractal characteristics can be leveraged for analysis. To illustrate this concept, we present an example of a fractal signal in the form of an electrocardiogram (ECG). We selected this example due to the global significance of cardiovascular diseases as a leading cause of mortality, as reported by the World Health Organization (WHO), and the widespread use of ECG signals for detecting these conditions. ECG remains one of the most commonly performed examinations for cardiovascular disease detection and a primary tool for diagnosing and analyzing cardiac arrhythmias.
Cardiovascular disease is recognized as the leading cause of mortality worldwide, with statistics indicating a rising number of deaths attributable to cardiovascular complications. According to the WHO, in 2008, 17.3 million deaths globally were caused by cardiovascular issues,^1^ and this figure is projected to increase to 23.3 million by 2030. Countries with low to moderate per capita income account for roughly 80% of these cases, with a significant portion resulting from delayed or inaccurate diagnosis of the underlying pathology. As an affordable and dependable method for diagnosing cardiac conditions, the ECG signal is crucial to assessing heart health.^2^ The ECG provides a visual representation of the heart’s electrical activity. The various waves and complexes observed on an ECG trace correspond to specific events in the cardiac cycle. The T wave signifies ventricular repolarization, the P wave represents atrial depolarization, and the QRS complex corresponds to ventricular depolarization. The analysis of these components allows medical professionals to assess the electrical activity of the heart and identify potential abnormalities or arrhythmias that may indicate underlying cardiovascular conditions.
The various waves in an ECG signal typically exhibit distinct temporal locations and frequency spectra, even when originating from the same individual, whether they have a cardiac disease or are healthy. Although ECG signal analysis can help identify and interpret numerous cardiac conditions, some anomalies may not be detectable through this method alone. Consequently, there is a need for a more robust and reliable approach to ECG signal evaluation that can enhance diagnostic accuracy and contribute to improved patient care.
The goal of this study is to maximize the utility of ECG data by proposing a heartbeat classification method. This approach is fundamentally rooted in the concept of fractals, as the heart exhibits a fractal structure.
The process consists of 2 primary fractal dimension calculation and classification. The initial step involves determining the fractal dimension, while the final phase focuses on categorizing arrhythmias.
The ECG reflects the heart’s electrical activity, initiated by the electrical activation of muscle cells. In response to stimulation, the cell surface rapidly depolarizes, generating an electric current that induces contraction. The ECG activation wave begins in the right atrium, specifically at the Keith and Flack node (denoted as K and F in the figure) located near the superior vena cava. This wave then spreads across both atria, ultimately reaching the atrioventricular node (also known as the Aschoff-Tawara node, denoted as AT in the figure) before progressing to the ventricles.

The activation wave generated during cardiac electrical activity results in cell depolarization and repolarization processes, which can be detected by strategically placed electrodes on the body’s surface. The recorded electrical signals produce the characteristic waveform seen in a typical ECG, as depicted in the figure below.


In a normal cardiac rhythm, ventricular myocardium activation occurs through the bundle of His and Purkinje fibers. Purkinje fibers are highly branched and exhibit a fractal structure. Research has demonstrated that Purkinje fiber activation results in fractal depolarization of the ventricles, a process that is reflected in the QRS complex of an ECG.

The figure above demonstrates a logarithmic plot of the average power spectrum of QRS complexes from multiple individuals. The plot reveals a decay in 1/fβ, where β represents the fractal dimension and f denotes frequency. This decay pattern indicates that the QRS complex spectrum follows an inverse power law and exhibits a fractional slope. The fractal structure of the heart’s conduction network, particularly the highly branched Purkinje fibers, has been suggested as the underlying reason for this spectral characteristic.
The ECG signals utilized in this study were obtained from the MIT/BIH database,^5^ a widely recognized and extensively used resource for cardiac research. This database comprises 48 distinct ECG signal recordings, each approximately 30 minutes, collected from 47 unique patients. The resolution of these recordings is 200 samples per mV, and the sampling frequency is 360 Hz. Across all 48 records, there are nearly 109,000 heartbeats classified into 15 different types of heartbeats. These classifications are based on the MIT-BIH arrhythmia classes, which form the foundation for distinguishing various cardiac conditions. Among these classes, the normal rhythm class, accounting for 70% of the beats, is the most prevalent.
The fractal dimension is a fundamental concept for characterizing fractal objects, serving as a comprehensive index to gauge their complexity.^6^ A fractal is considered rigorously self-similar if it can be described as a combination of sets, where each set is an exact reduced replica of the entire set, as observed in Koch flakes and Sierpinski triangles. Nonetheless, most natural objects exhibiting fractal-like properties lack this precise self-similarity. Instead, they display semi-self-similarity or statistical self-similarity, where a magnified image of a part of the object may not be a replica but retains a similar qualitative appearance. As the human heart’s ECG signal exhibits self-similarity, it necessitates the use of fractal dimension for its characterization.^7^
Various methods have been developed for calculating the fractal dimension, including the Higuchi method,^8^ the Katz method,^9^ the Regularization method,^10^ and the box-counting method.^11^ Each of these techniques has its unique strengths and weaknesses, making them more or less suitable for different applications and contexts.
The fractal dimension has proven to be a valuable descriptive measure for evaluating the self-similarity and complexity of biological signals. As the human heart’s ECG signal exhibits self-similarity, it necessitates the use of fractal dimension for its characterization and differentiation between various cardiac pathological conditions.^12^
Numerous algorithms have been developed for calculating the fractal dimension, as previously mentioned. Among these methods, the Higuchi algorithm has been recognized as a reliable technique and a good representative for identifying disease-related changes in fractal signals.
Presume a time sequence of x={x(1), x(2), …, x(N)}.
The fractional dimension is determined in the following
a) Create K new time series xm^k^ , which are described
(1)xmk={x(m), … ,x(m+⌊(N-m)/k⌋k)}
Here, K represents the discrete time interval between points, and m=1, 2, …, K denotes the initial time value.b) As outlined earlier, calculate the length of each new time series using the following
(2)Lm(k)=1K/{(N-1)/⌊(N-m)/K⌋K∑|x(m+ik)-x(m+(i-1)k)|}
Here, the normalization factor is given by (N − 1)/ ⌊ (N − m)/K⌋K.c) Calculate the curve’s length for the time interval K using the following
(3)L(k)=1/K∑m=1kLm(k)
d) Finally, the fractional dimension D is represented by the curve in the following
(4)log(L(k))=D log(1/K)+b¯
The fractal dimension is calculated from the time series using the following (5)DFK=(Log(L))/(Log(d))
Here, d is the Euclidean distance between the first point of the series and the point farthest from it. L represents the total length of the ECG time series. The total length L of the waveform, which consists of ordered pairs of points (x, y), is calculated as the sum of the distances between consecutive points as (6)L=sum (dist (i,i+1))
The distance between 2 coordinate pairs a = (x, y) and b = (u, v), is denoted by the symbol dist (a and b).
Waveforms that progress monotonically possess inherent starting points. Thus, the diameter of a waveform, defined as its planar extent, is the maximum distance between its starting point (point 1) and any other point (point i) on the waveform. This is expressed as (7)d=max (dist (l, i))
This method involves covering the curve with balls Bi, each having a diameter diam (Bi) that is less than or equal to εε. The total measurement of the object can be approximated by summing the diameters of these balls. Since the intersections of these balls are non-empty, the minimum of these measurements should be considered. To achieve the best approximation of the set E, εε should be allowed to approach 0.
The Hausdorff dimension is then calculated using the following (8)DFH= Limδ→0 (lnNδ/ln(1/δ))
Here, Nδ is the bare minimum of balls with a diameter of δ required to pave the curve.

The figure above displays the PSD of a QRS complex, along with its approximations using 2 straight lines within the distinct frequency ranges of 15 Hz to 19 Hz and 3 Hz to 8 Hz. The slopes of these lines are calculated for their respective frequency intervals. Upon calculation, the first slope is found to be 0.02, denoted as p1=0.02, while the second slope is −0.02, denoted as p2= −0.02. Each slope corresponds to a fractal dimension.
The fractal dimension of an ECG serves as an indicator of the signal’s irregularity or complexity and enables the quantification of self-similarity across multiple scales within the ECG waveform. This measure provides valuable information about the cardiac system’s underlying dynamics and can assist in identifying specific heart conditions. Various algorithms have been developed to calculate the fractal dimension of ECG signals, including the Katz, Higuchi, Petrosian, Maragos, and amplitude scale methods.^13^ By employing these algorithms, researchers can estimate the fractal dimension accurately and classify ECG signals accordingly. Kourosh Kiani and Farzane Maghsoudi^14^ have further explored and reviewed these and other related techniques.
The Higuchi method has been recognized for its precision and ability to effectively represent disease-related changes in fractal signals. In the present study, the fractal dimension was computed using the Higuchi algorithm implemented in MATLAB. The estimated fractal dimension obtained from the raw ECG data was employed to distinguish between the ECG signals of healthy individuals and those affected by premature ventricular complex (PVC), paroxysmal supraventricular tachycardia (PSVT), and premature atrial contraction (PAC). By leveraging the fractal dimension values, it becomes possible to differentiate between normal and diseased states, as well as identify specific cardiac conditions such as PVST, PAC, and PVA.
Using the fractal dimension and the results, the ECG signals can be divided into the following Normal: fractal dimension >1.56PAC: 1.37 < fractal dimension ≤ 1.56PVC: 1.3 < fractal dimension ≤ 1.37PSVT: 1 < fractal dimension ≤ 1.3
The fractal dimension, therefore, enables differentiation between normal and diseased states based on its value. It also facilitates the identification of specific cardiac conditions such as PVST, PAC, and PVA. As a result, the principal objective of this research is to employ the fractal dimension for the accurate classification of various arrhythmias.
The fractal dimension of an ECG signal serves as a valuable tool for analyzing and quantifying its complexity.
This study aims to calculate the fractal dimension to facilitate the classification of various cardiac diseases. Fractal analysis techniques are drawn upon to examine irregular signals, which are inherently fractal, with ECG signals being a prime example. The description and analysis of these signals rely significantly on the characterization of local regularity.