Euclidean Distance Measure for the Electrocardiogram Fiducial Points Detection in the Phase-Space Formed with the Derivative Rule

Developments in mobile healthcare result in wide use of mobile phones to acquire, store or analyse mobile users’ biosignals, such as the electrocardiogram (ECG). These activities have motivated global research in designing new QRS-complex detectors and delineators for single-lead ECG signals. This paper examines a QRS detection and delineation algorithm based on a Euclideandistance calculation in the phase space constructed with the derivative rule. The results confirmed that the phase-portrait constructed with the derivative rule is suitable for the QRS detection and delineation of the ECG signals, delivering comparable results to other established algorithm, such as PanTompkins [16].


INTRODUCTION
The electrocardiogram (ECG) is one of the elementary and well researched biosignals.Recent developments in mobile healthcare domain have revived the demand for fast and efficient ECG processing algorithms for the QRS-complex detection and delineation.These algorithms are designed for mobile and embedded devices where low-power and real-time computation is crucial [15].Besides, the importance of clinical, real-time applications running on mobile, low-cost and low-power devices is increasing in the sense of early diagnosis and treatment, cost reduction, etc., which has also been addressed in several major research activities, such as [5].
In Figure 2 a single-lead ECG signal is constructed in a twodimensional (2D) phase space into a phase portrait.Construction and analysis of the phase portraits are suitable for the automated detection and delineation of the QRS-complexes, although they are not as common as the established methods, such as the Pan-Tompkins algorithm [16].
With the development of portable devices and non-clinical applications [15] phase-space algorithms have gained interest, because of the real-time capability and simplicity of the algorithm [12].
The methods used to analyze the ECG signals in the derivativeconstructed phase space was suggested in [4,10].The derivative rule for the phase-portrait construction uses the signal values on one axis of the 2D phase space and the values of the same derived signal on the other.In [4], the phase portraits were used to detect acute coronary occlusion (ACO) and in [10], a phasespace analysis was used to detect the fetal heart rate from the multivariate abdominal ECG recordings.
The methods used to analyze the ECG signals in the time-delayconstructed phase space proved to be efficient [7,12,17,18].The time-delay rule for the phase-portrait construction uses the signal values on one axis of the 2D phase space and the values of the same delayed signal on the other.It was previously combined with the algorithms for area calculation [12] and Euclideandistance calculation [17] to provide an effective detection of the QRS-complexes [12], the ECG fiducial P-QRS-T points [17] and feature extraction [7,18].In [12], the area calculation algorithm was used and the detection of the fiducial points was performed by calculating the areas of certain sections of the phase portrait following a planar-geometry equation.In [17], the Euclidean-distance calculation algorithm was introduced to detect the ECG fiducial points exploiting the geometrical properties of the phase portrait by calculating the maximum and minimum Euclidean distances between the data points in the phase portrait.
In [18], the phase portraits of the ECG signals were used to determine the image-based self-similarity to detect ventricular fibrillation.In [7], a sleep-apnea detection algorithm was presented using nonlinear features of the phase portraits of the ECG signals, e.g.correlation dimension, Lyapunov exponents and spectral entropy.
The paper examines the phase-space construction (phase portrait) with the single-lead ECG signal values on one coordinate and the values of the signal (first) derivative on the other (Figure 2).

ECG FIDUCIAL POINTS DETECTION 3.1 Setup
The proposed method was verified with the Long-Term ST Database (ltstdb) [8] and the QT Database (qtdb) [11].The selection granted sufficient validation of the proposed method on two different clinical databases covering long-term recordings for efficient QRS-complex detection and ECG excerpts for reliable QRS-complex detection and delineation of various QRS-complex types.For comparison Pan-Tompkins algorithm was implemented and validated with the same databases.
The algorithm performance was evaluated using the sensitivity (Se) and the positive predictive value (PPV).The method was designed and evaluated with MATLAB®.

Algorithm
The proposed algorithm (der-euc) is composed of four steps: 1) pre-processing, 2) phase-portrait construction, 3) detection of the R points with adaptive thresholding, and 4) detection of the Q and S points by using the Euclidean-distance measure between the R points and the neighboring data points.The delineation of the QRS-complex is executed in parallel with the detection of the QRS-complex.
In the pre-processing step, all the signals are filtered with a band-pass filter with cut-off frequencies at 0.05 and 100 Hz, thus eliminating the low-frequency (baseline wandering) and highfrequency (muscle contractions) interferences.The band-pass filter is composed of a Butterworth 4th-order, high-pass filter and a Butterworth 4th-order, low-pass filter having the flattest passband magnitude response.The Butterworth filters for ECG filtering were previously used in [1].
Phase portrait of an ECG signal, described by one-dimensional time series of measured scalar values y(t), is constructed in a 2D phase space where x[k] presents the signal values on the abscissa axis and y[k] represents the values of the signal derivative on the ordinate axis.
The adaptive thresholding used in the proposed method is based on [2].It is used to detect the R points directly from the phase portrait.The adaptive-thresholding value calculation is based on a buffer combining five thresholding values.Firstly, the initial thresholding value is calculated as 80 % of the maximum value in the first five seconds of the signal.Then, the five values of the buffer are pre-set to the initial thresholding value.The thresholding value M used for the peak detection is calculated as the mean value of the five buffer values.Whenever the signal value is higher than the calculated thresholding value, a peak is detected and the thresholding buffer is updated by shifting its values to the left by one and replacing the fifth value with the value equal to 80 % of the detected peak.This also updates the mean of the thresholding buffer.
Using the algorithm, the R point (the center point of the QRScomplex) is determined by adaptive thresholding (4) combined with a zero-crossing condition (3) from a phase-spaceconstructed ECG signal.The onset (Q point) and offset (S point) points of the QRS-complex are detected among the neighboring data points of the detected R points using the Euclidean distance measure between the detected R points and the neighboring data points dist|(x1,y1),(x2,y2)|=sqrt( (x1-x2)^2+(y1-y2)^2 ).( 2) Following ( 1), the points of the observed signal in the 2D phase space are described by pairs (x[k],y[k]),k=1,…,N.Firstly, the R point is located for each ECG cycle and, secondly, the onset-and offset-point positions are determined by their relation to the R point.
Let N-1 be the number of the points on the curve, (x,y) the point coordinates and i∈{1,…,N-1} the point index.The following conditions for the R-point detection have to be satisfied according to the position of the R point where sgn(y[i]) extracts the mathematical sign of sample y(i) and M is the adaptive-thresholding value for coordinate x, according to Section 3.2.3.If the conditions (3) and ( 4) are satisfied for any then the R point will be determined as the i-th R point.
The detection of the R points is followed by the detection of the Q and S points.The Q point is the local minimum preceding the R point in the time domain.Therefore, the position of the Q point in the phase space is determined as the maximum distance from the R point to the limited interval of the points with indices smaller than the R point.Equations ( 5)-( 8) illustrate the detection of the Q onset point of the QRS-complex The amplitude values (8) and the locations (7) of the Q points are determined by calculating the maximum Euclidean distance (6) between the R point and every point on a selected time interval before the current R point (5).The length of the time interval is determined as one-quarter of the interval between the current and the previous R points.
The S point is the local minimum following the R point in the time domain.Accordingly, the position of the S point in the phase space is determined as the maximum distance from the R point to the limited interval of the points with indices greater than the R point.Equations ( 9)-( 12) describe the detection of the S offset point of the QRS-complex The amplitude values (12) and the locations (11) of the S points are determined by calculating the maximum Euclidean distance (10) between the R point and every point on a selected time interval after the current R point (9).The length of the time interval is determined as one quarter of the interval between the current and the previous R points.

RESULTS
The results of the proposed method are represented by the numbers of the total detections, true positive (TP), false positive (FP) and false negative (FN) detections compared to the numbers of the annotated QRS-complexes and the annotated points Q, R and S. The detection is TP if a true QRS-complex or point is detected.The detection is FP if the detected point is not annotated in the database and is therefore not true.The detection is FN if an annotated point from the database is missed (not detected).The performance of the proposed method was assessed by using the sensitivity (Se) and the positive predictivity (PPV) Table 1 lists the results of detecting the QRS-complexes in the signals from the ltstdb for the proposed method.The value of the Se parameter is 99.74%.The value of the PPV parameter is 99.91%.The performance of the two proposed methods is better than in [16].The performance of the detection and delineation of the QRScomplexes of the proposed method was evaluated with the qtdb and the results are given in Table 2. Two additional parameters are introduced: the localization error (LE) and the accepted tolerances (σref) for the localization of the Q and S points.LE comprises the mean error (µ) and the standard deviation (σ) of the differences between the automated-detection results and the annotations.The accepted tolerances (σref) for the Q and S points are recommended by [3].
The values of the Se parameter are 99.97 % for the Q points, 99.94 % for the R points and 100.00 % for the S points.The values for the PPV parameter are 99.97 % for the Q points, 99.94 % for the R points and 100.00 % for the S points.LE is smaller than one sample (4 ms) for the Q points, approximately one sample for the R points and approximately three samples for the S points.The results for the Se, PPV and LE values for the QRS-complex delineation are comparable with the results of the known previous investigations [6,9,13,14,16,17,19].

CONCLUSIONS
Mobile healthcare, as well as other mobile users' activities monitoring, demands development of new as well as redesign of established algorithms for mobile computing domain.
The proposed algorithm is suitable candidate for mobile applications where low computational complexity is crucial design parameter.
The results for the QRS-complex detection and delineation confirm that the proposed method based on the derivative-rule phase portrait gives results that are comparable to the proven time-delay rule phase-portrait construction combined with the same algorithm [17] as well as to Pan-Tompkins algorithm [16].

ACKNOWLEDGMENTS
This work was supported in part by the National Research Agency of Slovenia and Ministry of Higher Education, Science and Technology, Slovenia, under the P2-0246 Scientific Program.

Figure 2 .
Figure 2. The phase portrait constructed with the derivative rule with delineated QRS-complexes.