Skip to main content

ORIGINAL RESEARCH article

Front. Physiol., 21 October 2022
Sec. Computational Physiology and Medicine

A wavelet-based VCG QRS loop boundaries and isoelectric coordinates detector

Jan Kijonka,
Jan Kijonka1,2*Petr VavraPetr Vavra2Pavel ZoncaPavel Zonca2Marek Penhaker,Marek Penhaker1,3
  • 1Department of Cybernetics and Biomedical Engineering, Faculty of Electrical Engineering and Computer Science, VSB—Technical University of Ostrava, Ostrava—Poruba, Czechia
  • 2Department of Surgical Studies, Faculty of Medicine of the University of Ostrava, Ostrava, Czechia
  • 3Faculty of Electrical Engineering and Information Technology, University of Žilina, Žilina, Czechia

This paper deals with a wavelet-based algorithm for automatic detection of isoelectric coordinates of individual QRS loops of VCG record. Fiducial time instants of QRS peak, QRS onset, QRS end, and isoelectric PQ interval are evaluated on three VCG leads (X,Y,Z) together with global QRS boundaries of a record to spatiotemporal QRS loops alignment. The algorithm was developed and optimized on 161 VCG records of PTB diagnostic database of healthy control subjects (HC), patients with myocardial infarction (MI) and patients with bundle branch block (BBB) and validated on CSE multilead measurement database of 124 records of the same diagnostic groups. The QRS peak was evaluated correctly for all of 1,467 beats. QRS onset, QRS end were detected with standard deviation of 5,5 ms and 7,8 ms respectively from the referee annotation. The isoelectric 20 ms length PQ interval window was detected correctly between the P end and QRS onset for all the cases. The proposed algorithm complies the (2σCSE) limits for the QRS onset and QRS end detection and provides comparable or better results to other well-known algorithms. The algorithm evaluates well a wide QRS based on automated wavelet scale switching. The designed multi-lead approach QRS loop detector accomplishes diagnostic VCG processing, aligned QRS loops imaging and it is suitable for beat-to-beat variability assessment and further automatic VCG classification.

Introduction

Analysis of the electrocardiogram (ECG) which is an image of the electrical cardiac activity is widely used method for diagnostics of many heart diseases. Automatic detection of fiducial points of cardiac cycle: QRS peak, P, QRS, T waves onsets and ends is essential for ECG diagnostics, signal processing and further automatic heart diseases classification. Isoelectric line detection allows ECG beats alignment in order to averaging and ectopic ECG beats evaluation (Gatzoulis et al., 2018) and ECG record intra-individual variability assessment (Matveev et al., 2007; Penhaker et al., 2014).

Besides the common 12-leads ECG imaging, the vectorcardiography (VCG) with its three (X,Y,Z) leads provides us three-dimensional imaging fully sufficient for description of cardioelectric space (Pavlov and Abel, 1975; Burch, 1985). Compared to common 12-leads ECG, the VCG is more advantageous method for computer processing due to fewer signals containing no redundant information and more accurate with corrected orthogonal leads, although clinical use is not common yet (Malmivuo and Plonsey, 1995). In both cases, the diagnostic information is evaluated from the characteristic P, QRS, T waves of common 12 ECG or 3 VCG leads.

We can find different approaches for automatic QRS detection and P, QRS, T waves segmentation based on the first and second derivative (e.g., Pan-Tompkins algorithm (Pan and Tompkins, 1985; Arzeno et al., 2006)), low-pass differentiation (LPD) (Chazal and Celler, 1996; Laguna et al., 1994), adaptive filtering (Soria-Olivas et al., 1998), wavelet transform (WT) (Martínez et al., 2004; Mahmoodabadi et al., 2005; Sahambi et al., 1997), morphology and gradient (TDMG) (Mazomenos, 2012), dynamic time warping (DTW) (Vullings et al., 1998a) or artificial neural networks (Dokur et al., 1997). An appropriate algorithm selection depends on a few factors like real-time (Pan and Tompkins, 1985; Mazomenos, 2012; Guven et al., 2014) or offline data processing (Martínez et al., 2004; Mahmoodabadi et al., 2005; Vullings et al., 1998a; Dokur et al., 1997), requirements for robustness of the detector in evaluation of records of purely healthy or also pathological cases, ability to recognize noisy signals with motion and other artifacts, processing of a standard quality or a diagnostic high resolution and high sampling rates ECG records, including single or multi-leads approaches.

Featured work follows on from the previous study of intra-individual variability of VCG record evaluation (Penhaker et al., 2014), where VCG loops were spatially aligned based on manually annotated isoelectric coordinates by cardiologist, time synchronized by QRS peaks and compared on specified QRS length (global QRS boundaries) for the intra-individual variability assessment. The proposed algorithm automates the process of the isoelectric coordinates and global QRS boundaries detection and follows the QRS peak detector based on wavelet transform and biorthogonal wavelet presented in previous work (Penhaker et al., 2014), as an alternative to Daubechies wavelet used in studies (Martínez et al., 2004; Mahmoodabadi et al., 2005; Sahambi et al., 1997). The properties of the biorthogonal wavelets were found ideally suited for ECG parameters estimation in (Sivannarayana and Reddy, 1999) since they excite various morphologies of ECG’s better at different scales. The wavelet scales for the proposed algorithm were experimentally established for QRS complex detection (QRS onset and QRS end) including wide-QRS conditions assessment detected on a different scale unlike previous studies (Martínez et al., 2004; Mahmoodabadi et al., 2005; Sahambi et al., 1997) using the same scales for various QRS morphologies. The QRS peak, QRS onset and QRS end detection is performed based on standardly used techniques of searching for maxima, minima, zero crossings and energy of wavelet coefficients in combination of time-domain signal analysis for QRS onset and QRS end adjusting by slope performed on a temporal search window. A time-domain signal analysis technique was already used in TDGM algorithm (Mazomenos, 2012) including signal preprocessing, QRS complex feature extraction employing Pan-Tompkins detection method (Pan and Tompkins, 1985) and temporal search windows followed by P-wave and T-wave feature extraction. While WT is quite robust in the presence of noise and baseline wander situations (Sivannarayana and Reddy, 1999; Dinh et al., 2001), the TDGM performed better in intricate ECG morphologies (Mazomenos, 2012). To benefit from both techniques, the proposed algorithm uses signal preprocessing before applying WT followed by time-domain-analysis. The signal preprocessing is performed by digital finite impulse response (FIR) high pass filter with 1 Hz cuttoff frequency in passband (0 dB signal attenuation) and infinite impulse response (IIR) 50 Hz or 60 Hz notch filter used for powerline distorted signals, meeting requirements for diagnostic ECG frequency bands (Klingfield et al., 2007; Medteq, 2022). The isoelectric line is searched on a temporal window localized before QRS onset as a flattest interval of a PQ segment, where the PQ segment appears to be the most acceptable location of zero cardiac activity, which is suitable for most pathological cases (Guven et al., 2014). In case of VCG leads, the isoelectric lines of the (X, Y, Z) leads defines coordinates with zero electrical activity situated in origin of the Cartesian coordinate system. With this assumption, the spatiotemporal VCG QRS loops alignment is performed by QRS loop isoelectric coordinates offsets removal and ECG beats synchronized with QRS peaks detected in one of the X, Y, or Z leads (Matveev et al., 2007). To compare individual QRS loops of a record, time-intervals to the left and to the right of the synchronization QRS peak are evaluated. In proposed algorithm, QRS global boundaries common for all QRS loops of a record are computed based on QRS onsets and QRS ends as number of samples to the left of the QRS peak (boundL) and to the right of the QRS peak (boundR).

The algorithm was developed and optimized on 161 records of 58 healthy control subjects (HC), 69 patients with myocardial infarction (MI), and 34 patients with bundle branch block (BBB) of the PTB (Physikalisch-Technische Bundesanstalt) diagnostic database of 12 standard ECG leads and 3 Frank VCG leads. All recordings are 2 min long, sampled at 1,000 Hz (Matveev et al., 2007; Bousseljot et al., 1995). The diagnostic ECG data are processed offline based on 3 VCG leads increasing robustness of the detector. Validation of the QRS detector and QRS onset and QRS end time instants detection was performed on CSE (Common Standards for Quantitative Electrocardiography) multilead database dataset 3 with 12 standard leads and 3 Frank leads of 125 biological ECGs. All recordings are 10 s long sampled at 500 Hz (Goldberger et al., 2000).

Used methods

One of possible signal analysis is its comparison with a set of the test functions, where Q={φq=eiωt,ωR} is set of test functions for well-known Fourier transform (FT), that contain all the dilatations and reductions of the periodic function eit by the factor ω (Willems et al., 1985). Another option for the time-frequency analysis is application of the WT similar to the FT. While the FT decomposes signal into a series of sine waves of different frequencies, WT decomposes signal into the “wavelets”, dilated and translated versions of the so-called Mother wavelet ψ(t). Wavelet is nonzero only at the finite time interval, or the values outside the interval are negligibly small. Consequently, whatever value of the spectrum is used, based on the wavelet, it is influenced only by the corresponding time interval of the analysed signal. Wavelet basis functions cover the entire time span of the analysed signal in parts. Therefore, the full information is preserved. Compared to the smooth sinusoidal curve of an infinite length, wavelet is compact and irregular shaped. With these features, wavelet is an ideal tool for unsteady signals with discontinuities and sharp changes analyses and possibilities of localization in time (Aldroubi and Unser, 1996).

Continuous wavelet transform

If the base fiction Q={ψ((tb)/a),(a,b)(0,)×R} is used, we obtain the continuous wavelet transform (Wψf)(a,b) of the signal f(t)L2(R) (Aldroubi and Unser, 1996):

(Wψf)(a,b)=|a|1/2f(t)ψ(tba)¯dt(1)

where a is so-called dilatation scaling parameter, b is translation parameter, ψ¯ is complex conjugate of ψ and where ψL2(R) is mother wavelet—oscillation function.

Continuous wavelet transform (CWT) uses a sampled data, but the process of translation is a smooth operation across the length of the sampled data. The scaling can be defined from a minimum (original signal scale) to a maximum selected by the user, making a finer resolution possible. The disadvantage compared to discrete wavelet transform (DWT) is increasing of the computational time and higher memory requirement for wavelet coefficients calculation (Aldroubi and Unser, 1996).

Wavelet type used

Wavelets can be classified as orthogonal, non-orthogonal and biorthogonal. Only biorthogonal wavelets provide the time symmetry and prevent phase shifts of the transformed signal (Altmann, 1996). For the ECG signal analysis, the shape of the signal in the time-domain is important, while a signal reconstruction (inverse-transform) is not required. From this standpoint, the biorthogonal wavelets are advantageous for the ECG signal analysis. The shape of the biorthogonal wavelet 2.2 used in this work resembles the shape of the ECG waveform (see Figure 1) which excite various morphologies of ECG waveforms better at different scales (Sivannarayana and Reddy, 1999). Application of biorthogonal wavelets for the ECG parameters (P, QRS, and T) estimation is known from the literature (Sivannarayana and Reddy, 1999; Louis et al., 1997) and it was already used for QRS peak detection in the previous work (Penhaker et al., 2014). The central frequency of the biorthogonal wavelet 2.2: fcentral=1,0008 Hz has a relation to scale a from the Eq. 1 and pseudofrequency at the scale a according to the relation (3) and Table 1, further explained in the next chapter 2.3.

FIGURE 1
www.frontiersin.org

FIGURE 1. Biorthogonal wavelet 2.2 with the central frequency fcentral=1,0008 Hz used in the presented QRS detector algorithm.

TABLE 1
www.frontiersin.org

TABLE 1. Pseudofrequencies for the scales a={10,30,50,70,120}, central frequency fcentral=1,0008 Hz and sampling period =0,001 s.

Scalogram and coefficients of the continuous wavelet transform

In Figure 2 there is the scalogram of continuous wavelet transform for biorthogonal wavelet 2.2 which is used in this work. The input signal is one VCG lead of healthy control patient (HC), a patient with inferior myocardial infarction (MI) and a patient with the left bundle branch block (LBBB).

FIGURE 2
www.frontiersin.org

FIGURE 2. Scalogram of the continuous wavelet transform for biorthogonal wavelet 2.2, scale parameter a={10,,120} and corresponding pseudofrequencies fa{100,,8}Hz. The input signal is one lead VCG of one cardiac cycle of the named records of the diagnostic PTB database: from the left the “s0130lre” of a HC patient, the “s0235lre” of a MI patient, “the s0448_re” of a LBBB patient. The single Q, R, S waves are marked by dashed lines in the input signal.

The scalogram represents the percentage of energy of wavelet coefficients at the given scale a and location b of the wave ψa,b by the relation:

Ep(a,b)=|(Wψf)(a,b)|2i=1Mj=1N|(Wψf)(ai,bj)|2100(2)

where M is number of the scales, N is number of the translations corresponding to the number of samples of the input signal.

The scaling parameter is selected in the range of a={10,,120}. For the related scales the corresponding pseudofrequencies are calculated (Kumar et al., 2018):

fa=fcentrala(3)

where fa(Hz) is pseudofrequency at the scale a, fcentral(Hz) is the central frequency of the wavelet, a is scale and (s) is sampling period.

Among the scale and frequency there is only an approximate relationship since the wavelet contains other frequency components in addition to the calculated central frequency fcentral. The selected range of the scales was specified on the basis of the power spectrum of the QRS. To a frequency about 10 Hz the P and T waves spectra and the motion artefacts can be shown. The representation of the frequencies above 40 Hz is relatively low and the high-frequency interference is shown in this band. For the central frequency fcentral=1,0008 Hz of the biorthogonal wavelet used (Figure 1) and the sampling period =0,001 s there are computed the pseudofrequencies at the desired scales a={10,30,50,70,120} shown in the Table 1.

The scalogram (see Figure 2) shows the highest percentage of energy of coefficients concentrated at the R wave and Q, S wave times for the record of healthy patient in the entire range of scales a={10,,120}. The record of patient with inferior MI has a small R wave amplitude considering the P, T waves and has a high-frequency noise. For this record, there appear brighter areas in time intervals of the T and P waves for the scale a>60 in the scalogram. The last record of patient with LBBB with a wide QRS complex and therefore with the higher proportion of lower frequencies has a relatively small percentage of energy for the scale <40 .

The coefficients of wavelet transform for discrete scale values a={10,30,50,70,120} are plotted in Figure 3. At the scale a=10, there are relatively large frequency noise and low values of coefficients. At the scale a=30 and a=50 there are good localisations of Q, R, S waves with a small amplitude for the P and T waves. The higher scales are suitable for Q, R, S localisation for the records with a wide QRS.

FIGURE 3
www.frontiersin.org

FIGURE 3. Coefficients of the wavelet transform for the scale parameter a={10,30,50,70,120} and the mother biorthogonal 2.2 wavelet. The input signal is one VCG lead of one cardiac cycle of the named records of the diagnostic PTB database: from the left the “s0130lre” of a HC patient, the “s0235lre” of a MI patient, “the s0448_re” of a LBBB patient. The single Q, R, S waves are marked by dashed lines in the input and transformed signals.

Algorithm description

A flowchart of the algorithm is shown in Figure 4. Individual parts of the algorithm are described in figures from Figures 510. The input signals of the algorithm are VCG leads (X,Y,Z) with indexes iI={1,2,3}, samples of the signal record are marked as bB={1,,N}, where N is the total number of samples. Functional values of the input signals are marked as fi(b) in units GAINmV, where GAIN=2000 is gain of the signal. The signals are sampled with the sampling frequency fs=1000Hz. The outputs of algorithm are the time instants of the QRS peak, QRS onset and QRS end, and PQ interval onset and offset for each QRS complex and each signal of the VCG record. These time instants are stored in the matrixes R, Q, S, PQ, where the indexes i,k of each matrix element corresponds to the signal index and the sequential number of the heartbeat detected. Another output is the QRS loop global boundaries marked as boundL and boundR. The boundaries indicate the number of samples on left and right to the synchronizing QRS peaks detected, evaluated globally for a record. As the synchronizing wave the QRS peak time instant in the lead X is selected. An example of QRS boundaries and isoelectric lines detection is in Figure 11.

FIGURE 4
www.frontiersin.org

FIGURE 4. Algorithm flowchart.

FIGURE 5
www.frontiersin.org

FIGURE 5. QRS detection flowchart.

FIGURE 6
www.frontiersin.org

FIGURE 6. Founded zero points zsi,kL to the left of the bpeaki,k and zti,kR to the right of the bpeaki,k in the TTLS bounds. The zero points met the condition corresponding to the green denoted intervals and the elements {logicLsi,k}1α1={1,0,0,0,0,1} and {logicRti,k}1β1={1,0,0,0,0,0,0}.

FIGURE 7
www.frontiersin.org

FIGURE 7. QRS onset detection flowchart.

FIGURE 8
www.frontiersin.org

FIGURE 8. Adjusting the QRS onset for a wide QRS. In the first graph from the top: the original signal fi(b) (wide QRS). In the second graph from the top: W30i(b) with the set of Pi,k points found and delimited by the TTAR. In the third graph from the top: W70i(b) and zero points from zL701i,k to zL704i,k detected in the range of TT3LS, the time interval of the zero point zL704i,k is coloured by red, where logic704i,k=1, the new zero point zL70oni,k=zL703i,k found and the QRS onset q70i,k. In the fourth graph from the top: W120i(b) for comparison to scalogram. In the fifth graph from the top: EPi(70,b) and EPi(120,b) and maximum energy Ei,kMAX0,81 in the range of TT1LS, the qi,k neighbourhood coloured by red is the zone for the high energy detection by the defined condition. In the ε1 neighbourhood there were not any thresholds for Ei,k(a,b) exceeded, however, at the scale 120 there was the double energy related to the scale 70 in the range defined by TT1LS. On condition for the wide QRS was met and the QRS was qualified as wide.

FIGURE 9
www.frontiersin.org

FIGURE 9. Marking of the shifting window with the width of TW, initial point in the qi,kSTART point, end point in the qi,k=qi,k+STOP point and shift step DELTA. In each window, there is the line slope SLOPE evaluated. In the case of the QRS onset and offset adjustment, the line slope is evaluated only from the initial and end points of the window. The new point qSLi,k marked in the graph is defined based on the THSLOPE parameter.

FIGURE 10
www.frontiersin.org

FIGURE 10. QRS loop boundaries detection flow chart.

FIGURE 11
www.frontiersin.org

FIGURE 11. Illustration of the QRS loop boundaries detection and the individual time instants qi,k, ri,k, si,k, PQi,k. The function value in the synchronising point r1,k is marked by the red triangle, next there are marked the function values in the points r2,k, r3,k (empty triangle), function values in the points qi,k of the QRS onsets (blue circle), function values in the points si,k of the QRS ends (green circle), function values in the points of the PQi,k sets of the PQ segments (black circle). The boundaries of the QRS loop boundL, boundR marked with violet colour. Isoelectric coordinates ISOi,k marked with blue isolelectric lines.

Signal preprocessing

The VCG leads (X,Y,Z) signal preprocessing is performed to remove noise added from powerline interference and baseline wander caused by respiratory and motion artefacts. The baseline wander removal is accomplished by digital FIR high pass filter with 1 Hz cuttoff frequency in passband (−0 dB) and 0,5 Hz cutoff frequency in stopband (−61 dB). The properties of the FIR filter type used allows to preserve useful ECG frequency bands with no additional signal distortion, meeting requirements of American Heart Association (AHA) (Klingfield et al., 2007) for diagnostic ECG. The powerline interference is filtered by notch 50 Hz or 60 Hz filter depending on the presence of the interfering signals. Used 0.17 Hz narrowband notch with an attenuation greater than 60 dB affects the original signal only in the narrow frequency band around the 50 Hz or 60 Hz interference with a negligible effect on the useful ECG frequency band (Klingfield et al., 2007), (Medteq, 2022).

QRS peak detection

QRS detection is based on waletet transform of input signals on scale a=30 (see Figure 3). At first, the threshold THOi of wavelet transform function W30i(b) for each signal iI is defined, where parameter RATIOO=0,7 is the oscillation ratio of the absolute maximum value of W30iκ(b) function. Then, the sets Pi,k are formed, where each set represents the estimated time instants of the heartbeat. The criterion for the Pi,k sets definition is the parameter TTG=200samples, which indicates the maximum number of samples between the two subsequent heartbeats. From each set of the bmaxi,kPi,k points with the function values lower then RATIOA=0,7 are excluded. Then the comparison of the QRS detected (represented by Pi,k sets) between signals is done. If the QRS is detected in a single lead then the QRS (corresponding Pi,k=) is excluded. If the QRS is detected in two of three leads, the new point of QRS detection is added to the corresponding Pi,k set. All the QRS detected at the edge of the record within the limits TTE=200samples of the record are excluded. Then the matrix P with the elements bpeaki,k is created, where bpeaki,k is one element from each Pi,k set defined as the maximum function value of the |W30i(bmaxi,k)|. In the neighbourhood of the point bpeaki,k, where the neighbourhood of the point is defined as ε=10samples, the maximum amplitude of the function |fi(b)| is found. This point indicates the time instant of the QRS occurrence and it is added to the R matrix. Simplified flowchart of the QRS peak detection is in Figure 5.

QRS onset and QRS end detection

Detection of the QRS onset and QRS end is based on the zero crossing of the function W30i(b). (i,k) zero points in the neighbourhood of bpeaki,k are searched for, where bpeaki,k are elements of the P matrix. The bpeaki,k neighbourhood is defined by the parameter TTLS=150samples. In the left neighbourhood of the bpeaki,k the zero points zsi,kL are searched for, where s{1,,α}, α is the number of zero points in the left neighbourhood of the bpeaki,k. In the right neighbourhood of the bpeaki,k zero points zti,kR are searched for, where t{1,,β}, β is the number of zero points in the right neighbourhood of the bpeaki,k. (i,k), there is defined the oscillation threshold THLSi,k of the function W30i(b) by the parameter RATIOLS=0,3.

For the QRS onset detection, there is the partial function logicsi,k defined, where for each zero point zsi,kL, where s{1,,α1} is the function value 1 assigned if the condition W30i(zsi,kLbzs+1i,kL)>THLSi,k is met or the function value 0 is assigned if the condition is not met.

An example of zero points in the bpeaki,k neighbourhood finding and the logicsi,k definition is shown in the Figure 6. The elements of {logicsi,k}1α1 is the sequence of values 1 and 0, where 1 corresponds to the suitable interval of the signal W30i(b) and 0 correspond to the non suitable interval, where zsi,kLbzs+1i,kL, s{1,,α1}. There are the rules for the QRS onset zoni,kL detection established:

• If the length of one last non suitable interval is lower then TTSN=10samples, the interval is assigned as the suitable one.

• As the zero point zoni,kL of the QRS onset, the zero-point located after couple of the unsuitable intervals is assigned or the zero-point located after an unsuitable interval with the length higher then TTLN=25samples is assigned.

The QRS onset is than accurately traced in the interval between the zero points zoni,kL and zon+1i,kL. The criterion for the QRS onset assignment is the signal shape of the function W30i(b) in the right neighbourhood of the zoni,kL. The founded QRS onset is put into the matrix Q. The flowchart of the QRS onset detection is in Figure 7.

The QRS end is detected by analogy in the right neighbourhood of the bpeaki,k. The founded QRS end is put in the matrix S.

Wide QRS onset and QRS end detection

Adjusting the QRS onset or QRS end is performed in the case of meet the condition of exceeding the percentage of energy of the wavelet coefficients 2) in the QRS onset or QRS end neighbourhood. It is compared the energy percentage at scales a=70 and a=120 in the time window width, given by the parameter TT1LS=200samples and the percentage of energy at these scales in the ε=16samples1 neighbourhood for the QRS onset, and TT2LS=200samples and ε=24samples2 neighbourhood for the QRS end. The adjusting of the QRS onset and QRS end is based on the zero crossing of the function W70i(b), when the similar process as for the QRS onset and QRS end detection is kept. (i,k) there are the zero points zsi,kL70 and zti,kR70 found in the neighbourhood bpeak70i,k, given by the parameter TT3LS=200samples. The bpeak70i,k are the points with the local maximum of the function |W70i(b)| where b{min(Pi,k)TTARbmax(Pi,k)+TTAR}. Parameter TTAR=50samples. An example for the QRS onset adjustment for the wide QRS is shown in Figure 8.

QRS onset and QRS end adjustment by slope

QRS onset and QRS end adjustment by slope is based on the linear regression method and line slope calculation on the time window of the input signal in the section before the QRS onset (qi,k point), and after the QRS end (si,k point).

For the QRS onset adjusting there are some parameters set: the window width TW=10samples, the initial point of the investigation—number of samples before the qi,k, START=30samples, the end point of the investigation—number of samples after the qi,k, STOP=0samples, the movement step of the window, DELTA=2samples. The line slope SLOPEsi,k is evaluated based on the linear regression of the initial and end points of the time window. The threshold for the slope exceeding is set to THSLOPE=10. If the slope SLOPEsi,k is exceeded for s>3, where s is the accumulate shift of the window s{0,DELTA,2DELTA,,START+STOPTW}, then the first window in the sequence with the slope SLOPEsi,k<THSLOPE is found and the new QRS onset is defined. If there is not any time window that met the condition, the new QRS onset is defined in the point qSLi,k=qi,kSTART. The QRS onset adjustment by slope is shown in Figure 9.

Finding the slope in the right neighbourhood of the si,k and finding the new QRS end sSLi,k is carried out analogously.

QRS onset and QRS end alignment between signals

Aligning of the QRS onsets or QRS ends between the three VCG leads is performed in case of exceeding the distances between the qi,k, or si,k points for the given k and triple of signals iI by the defined threshold TTBS=80samples. If the condition is met, the farthest point is shifted on the mean value of the remaining two points and the new QRS onset qALi,k or QRS end sALi,k is found.

PQ detection

PQ isoelectric interval detection is based on linear regression and line slope evaluation on the temporal search window of the input signal in the neighbourhood of the QRS onset point qi,k. By the experimental work of the PQ detector, there were any other parameters evaluated on the time window (line slope difference, the mean value of the signal, standard deviation difference). However, only one parameter—the line slope was chosen for the algorithm. The time window is given by parameters: the window width TW1=20samples, the initial point of the investigation—the number of samples before the qi,k, START1=50samples, the end point of the investigation—number of samples after the qi,k, STOP1=10samples, the movement step of the window, DELTA1=2samples. The line slope SLOPEsi,k is evaluated based on the linear regression of the function fi(b) on the time window. The time window with the minimum line slope is selected and defined as looked-for part of the PQ segment. Although the PQ segment is usually longer than TW1, its entire interval is known as isoelectric. For this reason, it is sufficient to choose only the suitable part of the PQ segment for isoelectric line evaluation. The beginning and end of the time window founded are put into the PQi,k set and into the PQ matrix.

QRS loop boundaries detection

The QRS loop boundaries detection is performed based on the QRS peak detected (R matrix), the PQ segment detected (PQ matrix) and the QRS end detected (S matrix). (k) the maximum distance of the PQi,k and r1,k is computed, where r1,k is the time instant of the QRS detected in the lead X, specified as a synchronising wave for all the three leads X,Y,Z and given k. Median of these distances is assigned as boundL—the left boundary of the QRS, its value is the number of samples to the left of the synchronising wave. (k) there is computed the maximum distance of si,k and r1,k. Median of these distances is assigned as boundR—the right boundary of the QRS loop, its value is the number of samples to the right of the synchronising wave, where boundL and boundR are identical for all k (all the QRS loops of the record). The flowchart of the QRS loop boundaries detection is in Figure 10.

QRS loop isoelectric coordinates detection

Isoelectric coordinates are evaluated for each of the QRS loop k{1,,p} of the record based on the mean voltage levels in the PQ intervals detected for the signals iI from the relation (4):

ISOi,k=meanmin(PQi,k)<b<max(PQi,k)(fi(b))(4)

where k is the sequence number of QRS loop detected, i is index of the signal, fi(b) is the input signal, b is sample of the signal, PQi,k is set of beginning and end point of the PQ interval, mean() is a mean value.

Results

Validation of the QRS detector and QRS onset and QRS end time instants was performed on CSE multilead database dataset 3 with 12 standard leads and 3 Frank leads of 125 biological ECGs. All recordings are 10 s long sampled at 500 Hz with 1 µV resolution. Patients with various diagnoses including bundle branch blocks and aspecific conduction defects with significant changes in ECG image causing a wide QRS (>120 ms) was observed in 21 of total of 125 cases. Number of cases for four main groups of diagnoses can be seen in Table 2 (Goldberger et al., 2000), (Zhao et al., 2004), (Willems et al., 1990).

TABLE 2
www.frontiersin.org

TABLE 2. Preview of CSE validation database diagnoses.

To use the records sampled a at 500 Hz, the records were firstly resampled to 1,000 Hz in the context of preserving original filters and frequency scales of wavelet transform. Form the total of 125 records, one record with an artificial pacemaker was excluded.

Median referee annotation based on five referee cardiologists and median program annotation based on nine different ECG analysis programs are provided in CSE database together with ECG waveforms in digital data file format. The cardiologists only analysed every fifth record and additionally some waves, for which a set of analysis programs differed significantly. For this study, the records were divided into two groups, where in the first group the results were compared with median referee annotation, while for the second group only the median program annotation was available. However, the median wave recognition results of the nine ECG analysis programs are almost identical to the final visual estimates obtained by the referees and thus can be used as a substitute of the reference annotation (Zhao et al., 2004).

In the CSE database we obtained 3 different sets of annotations, one for each channel (X,Y,Z). For selecting a single location for each characteristic point, we used a rule consisting of ordering the 3 single-lead annotations and selecting as the onset (end) of QRS the first (last) annotation whose k=1 nearest neighbor lay within smallest δ ms interval. This rule had been already used in (Chazal and Celler, 1996), (Laguna et al., 1994), (Martínez et al., 2004), where values k=2 to k=3 and δ=6 ms to δ=10 ms were used for 12 or 15 single leads annotations.

To evaluate the QRS peak detector, we use the sensitivity (Se) and positive predictivity (P+) formulas:

Se=TPTP+FN;P+=TPTP+FP(5)

where TP is number of true postive detections, FN is number of false negative detections and FP is number of false positive misdetections

For total of 1,467 beats, we obtained a sensitivity of Se=100% and a positive predictivity of P+=100%.

To assess QRS onset and QRS end time delineation performance, mean value μ and standard deviation σ of time differences between presented algorithm and reference annotation were calculated. The algorithm accomplishes the two standard deviations (2σCSE) tolerances (“loose criteria”) for both QRS onset and QRS end time evaluation (see Table 3), where the (2σCSE) criteria is a robust estimation of the “median reader” of what can be expected from an expert cardiologist (Willems et al., 1990). This criterion was also used in (Laguna et al., 1994; Martínez et al., 2004; CSE WORKING PARTY, 1985; Vila et al., 2000), while for others (Chazal and Celler, 1996), the one standard deviation criteria (“strict criteria”) should be attained. The delineation results comparison between LPD methods presented in (Chazal and Celler, 1996; Laguna et al., 1994) and WT methods presented in (Martínez et al., 2004; Sahambi et al., 1997) in the CSE database are already available in (Martínez et al., 2004), where the proposed algorithm achieves comparable or better results for the QRS onset and QRS end detection than others except for (Sahambi et al., 1997), where lower error standard deviation is reported. However, we have no information about what dataset and what one-lead to multilead rule were used.

TABLE 3
www.frontiersin.org

TABLE 3. ORS onset and QRS end delineation performance.

To evaluate the isoelectric PQ segments detection accuracy, a condition was established: The PQ interval of the temporal 20 ms window must be located between the end of the P wave and the beginning of the QRS onset annotated by a referee. The condition was met for all the 124 records.

Requirements for the global boundL and boundR QRS boundaries detection, calculated by relations (see Figure 11) were to include all QRS loops of the record between these two bounds with respect to intra-individual variability of the record (Penhaker et al., 2014). The boundL detected in isoelectric PQ segment and boundR detected in the most probably QRS end was ideal for QRS loops comparing and visualisation.

Conclusion

Designed QRS loop detector evaluates zero crosses of the wavelet transform, linear regression and percentage of energy of the wavelet coefficients on specified scales and uses the experimentally set logical terms to select an appropriate interval between zero crossings to QRS onset and QRS end evaluation. To provide a finer resolution an accurate localisation in time, a continuous WT and biorthogonal wavelet versus quadratic spline in other studies is used. To adjust fiducial points, the problem is transferred to time-domain on pre-defined temporal windows. The PQ isoelectric interval is found on temporal search window as the flattest part of the PQ segment.

Detected isoelectric coordinates of the individual QRS loops of a VCG record allows the spatiotemporal QRS loops alignment synchronized by QRS peaks with the length of QRS determined by automatically detected QRS bounds of the record. The spatiotemporal QRS loops alignment allows the QRS loops comparison, averaging, ectopic QRS loops evaluation and intra-individual variability assessment which was addressed in the previous study.

Compared to other algorithms, the proposed solution combines both WT as a robust method in the presence of noise as well as in baseline wander situations, and time-domain techniques for better performance in intricate ECG morphologies to adjust QRS onset, QRS end, and isoelectric PQ interval detected on temporal search window. Special care is given to wide pathological QRS, where fiducial points are evaluated on different scale for experimentally set conditions. The algorithm uses multilead approach, where three VCG leads are used simultaneously for detection of QRS onset and QRS end.

The results of QRS peak, QRS onset and QRS end detection was compared with other published approaches and have shown that the developed algorithm provides a reliable and accurate delineation of the ECG signal better or comparable with other algorithms with standard deviation complying (2σCSE) limits for the CSE database, promising extension of P and T waves detection for further VCG processing and automatic VCG classification.

Data availability statement

Publicly available datasets were analyzed in this study. This data can be found in the PTB Diagnostic ECG Database: https://physionet.org/content/ptbdb/1.0.0/. Requests to access the CSE database should be directed to prubel.lyon@gmail.com.

Author contributions

JK developed signal processing algorithm on input data. The processed VCG signals and results were assesed and consulted by physicians PV and PZ under the guidance of research work MP.

Funding

This publication has been produced with the support of the Integrated Infrastructure Operational Program for the project: Creation of a Digital Biobank to support the systemic public research infrastructure, ITMS: 313011AFG4, co-financed by the European Regional Development Fund.

Conflict of interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

Aldroubi A., Unser M. (1996). Wavelets in medicine and biology. Boca Raton: CRC Press, 616.

Google Scholar

Altmann J. (1996). Wavelet basics. online]. [cit. 2015-05-11]: http://www.wavelet.org/tutorial/wbasic.htm.

Google Scholar

Arzeno N. M., Poon C. S., Deng Z. D. (2006). Quantitative analysis of QRS detection algorithms based on the first derivative of the ECG. New York, USA: International Conference of the IEEE Engineering in Medicine and Biology Society, 1788–1791. doi:10.1109/IEMBS.2006.260051

CrossRef Full Text | Google Scholar

Bousseljot R., Kreiseler D., Schnabel A. (1995). Nutzung der EKG-Signaldatenbank CARDIODAT der PTB über das Internet. Biomed. Technik/Biomedical Eng. 1, 317–318. doi:10.1515/bmte.1995.40.s1.317

CrossRef Full Text | Google Scholar

Burch G. E. (1985). The history of vectorcardiography. Med. Hist. 29, 103–131. doi:10.1017/S002572730007054X

CrossRef Full Text | Google Scholar

Chazal P., Celler B. (1996). “Automatic measurement of the QRS onset and offset in individual ECG leads,” in Presented at the 18th Ann. Int. Conf.. (Amsterdam, Netherlands: IEEE Eng. Med. Biol. Soc.).

Google Scholar

CSE WORKING PARTY (1985). Recommendations for measurement standards in quantitative electrocardiography. The CSE Working Party. Eur. Heart J. 6, 815

PubMed Abstract | Google Scholar

Dinh H. A. N., Kumar D. K., Pah N. D., Burton P. (2001). “Wavelets for QRS detection,” in Conference Proceedings of the 23rd Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Istanbul, Turkey, October 25–28, 2001, 207–211. doi:10.1109/iembs.2001.1020593

PubMed Abstract | CrossRef Full Text | Google Scholar

Dokur Z., Olmez T., Yazgan E., Ersoy O. K. (1997). Detection of ECG waveforms by neural networks. Med. Eng. Phys. 198, 738–741. doi:10.1016/s1350-4533(97)00029-5

PubMed Abstract | CrossRef Full Text | Google Scholar

Gatzoulis K. A., Arsenos P., Trachanas K., Dilaveris P., Antoniou C., Tsiachris D., et al. (2018). Signal‐averaged electrocardiography: Past, present, and future. J. Arrhythm. 343, 222–229. doi:10.1002/joa3.12062

PubMed Abstract | CrossRef Full Text | Google Scholar

Goldberger A. L., Amaral L. A. N., Glass L., Hausdorff J. M., Ivanov P. Ch., Mark R. G., et al. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation 101 (23), e215–e220. doi:10.1161/01.cir.101.23.e215

PubMed Abstract | CrossRef Full Text | Google Scholar

Guven O., Eftekhar A., Hoshyar R., Frattini G., Kindt W., Constandinou T. G. (2014). “Realtime ECG baseline removal: An isoelectric point estimation approach,” in 2014 IEEE Biomedical Circuits and Systems Conference (BioCAS) Proceedings, Lausanne, Switzerland, October 22–24, 2014, 29–32. doi:10.1109/BioCAS.2014.6981637

CrossRef Full Text | Google Scholar

Klingfield P., Gettes L. S., Bailey J. J., Childers R., Deal B. J., Hancock E. W., et al. (2007). Recommendations for the standardization and interpretation of the electrocardiogram: Part I: The electrocardiogram and its technology: A scientific statement from the American heart association electrocardiography and arrhythmias committee, council on clinical cardiology; the American college of cardiology foundation; and the heart rhythm society: Endorsed by the international society for computerized electrocardiology. Circulation 115 (10), 1306–1324. doi:10.1161/CIRCULATIONAHA.106.180200

PubMed Abstract | CrossRef Full Text | Google Scholar

Kumar A., Berwal D., Kumar Y. (2018). Design of high-performance ECG detector for implantable cardiac pacemaker systems using biorthogonal wavelet transform. Circuits Syst. Signal Process. 379, 3995–4014. doi:10.1007/s00034-018-0754-3

CrossRef Full Text | Google Scholar

Laguna P., Jané R., CanimaL P. (1994). Automatic detection of wave boundaries in multilead ECG signals: Validation with the CSE database. Comput. Biomed. Res. 27 (1), 45–60. doi:10.1006/cbmr.1994.1006

PubMed Abstract | CrossRef Full Text | Google Scholar

Louis A. K., Maass D., Rieder A. W. (1997). Theory and applications. Chichester, England.

Google Scholar

Mahmoodabadi S. Z., Ahmadian A., Abolhasani M. D., Eslami M., Bidgoli H J. (2005). “ECG feature extraction based on multiresolution wavelet transform,” in 2005 IEEE Engineering in Medicine and Biology 27th Annual Conference, Shanghai, China, September 1–4, 2005, 3902–3905. doi:10.1109/IEMBS.2005.1615314

CrossRef Full Text | Google Scholar

Malmivuo J., Plonsey R. (1995). Bioelectromagnetism: Principles and applications of bioelectric and biomagnetic fields, XXII. New York: Oxford University Press, 482.

Google Scholar

Martínez J., Almeida R., Olmos S., Rocha A. P., Laguna P. (2004). A wavelet-based ECG delineator: Evaluation on standard databases. IEEE Trans. Biomed. Eng. 514, 570–581. doi:10.1109/TBME.2003.821031

CrossRef Full Text | Google Scholar

Matveev M., Krasteva V., Naydenov S., Donova Ta (2007). Possibilities of signal-averaged orthogonal and vector electrocardiography for locating and evaluating the size of acute myocardial infarction. J. Electrocardiol. 40, S62–S63. doi:10.1016/j.jelectrocard.2007.03.059,

CrossRef Full Text | Google Scholar

Mazomenos E. B. (2012). “A time-domain morphology and gradient based algorithm for ECG feature extraction,” in Industrial Technology (ICIT), 2012 IEEE International Conference (IEEE), 117–122.

CrossRef Full Text | Google Scholar

Medteq (2022). ECG filters. [cit. 2022-05-10]. Available at: http://www.medteq.info/med/ECGFilters

Google Scholar

Pan J., Tompkins W. J. (1985). A real-time QRS detection algorithm. IEEE Trans. Biomed. Eng. 3, 230–236. doi:10.1109/TBME.1985.325532

PubMed Abstract | CrossRef Full Text | Google Scholar

Pavlov Z., Abel H. (1975). Physiological correlations of the heart generator system, the electrical properties of the heart and body structures. Theory of cardioelectric space. Adv. Cardiol. 19, 10–11. doi:10.1159/000399609

CrossRef Full Text | Google Scholar

Penhaker M., Darebníková M., Jurek F., Augustynek M. (2014). “Evaluation of electrocardiographic leads and establishing significance intra-individuality,” in Innovations in bio-inspired computing and applications. Advances in intelligent systems and computing, Cham, Germany. Editors A. Abraham, P. Krömer, and V. Snášel, 237

CrossRef Full Text | Google Scholar

Sahambi J. S., Tandon S., Bhatt R. K. P. (1997). Using wavelet transforms for ECG characterization. An on-line digital signal processing system. IEEE Eng. Med. Biol. Mag. 16 (1), 77–83. doi:10.1109/51.566158

PubMed Abstract | CrossRef Full Text | Google Scholar

Sivannarayana N., Reddy D. C. (1999). Biorthogonal wavelet transforms for ECG parameters estimation. Med. Eng. Phys. 213, 167–174. doi:10.1016/s1350-4533(99)00040-5

PubMed Abstract | CrossRef Full Text | Google Scholar

Soria-Olivas E., Martinez-SoberM. , Calpe-Maravilla J., Guerrero-Martinez J. F., Chorro-Gasco J., Espi-Lopez J. (1998). Application of adaptive signal processing for determining the limits of P and T waves in an ECG. IEEE Trans. Biomed. Eng. 45, 1077–1080. doi:10.1109/10.704877

PubMed Abstract | CrossRef Full Text | Google Scholar

Vila J., Gang Y., Presedo J., Fernandez-Delgado M., Malik M. (2000). A new approach for TU complex characterization. IEEE Trans. Biomed. Eng. 47, 764–772. doi:10.1109/10.844227

PubMed Abstract | CrossRef Full Text | Google Scholar

Vullings H., Verhaegen M., Verbruggen H. (1998). “Automated ECG segmentation with dynamic time warping,” in Proc. 20th ann. Int. Conf. IEEE engineering in medicine and biology soc.. Hong Kong, China: (Hong Kong), 163

Google Scholar

Willems J. L., Arnaud P., Jan H., Bourdillon P. J., Degani R., Denis B., et al. (1985). Establishment of a reference library for evaluating computer ECG measurement programs. Comput. Biomed. Res. 18, 439–457. doi:10.1016/0010-4809(85)90021-7

PubMed Abstract | CrossRef Full Text | Google Scholar

Willems J. L., Arnaud P. V., Jan H., Degani R., Macfarlane P. W., Zywietz C. (1990). Common standards for quantitative electrocardiography: Goals and main results. Methods Inf. Med. 29 (4), 263–271. doi:10.1055/s-0038-1634793

PubMed Abstract | CrossRef Full Text | Google Scholar

Zhao G., Jiang D., Diao J., Qian L. (2004). “Application of wavelet time-frequency analysis on fault diagnosis for steam turbine;” in 5th International Conference of Acoustical and Vibratory Surveillance Methods and Diagnostic Techniques, France, CETIM, Senlis, France, 11–13.

Google Scholar

Keywords: vectorcardiography, QRS detection, segmentation, wavelet transform, isoelectric line detection

Citation: Kijonka J, Vavra P, Zonca P and Penhaker M (2022) A wavelet-based VCG QRS loop boundaries and isoelectric coordinates detector. Front. Physiol. 13:941827. doi: 10.3389/fphys.2022.941827

Received: 12 May 2022; Accepted: 04 October 2022;
Published: 21 October 2022.

Edited by:

Rajesh Kumar Tripathy, Birla Institute of Technology and Science, India

Reviewed by:

Sibghatullah Khan, Sreenidhi Institute of Science and Technology, India
Rishi Raj Sharma, Defence Institute of Advanced Technology (DIAT), India

Copyright © 2022 Kijonka, Vavra, Zonca and Penhaker. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Jan Kijonka, jan.kijonka@vsb.cz

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.