Jump to ContentJump to Main Navigation
Show Summary Details
More options …

Biomedical Engineering / Biomedizinische Technik

Joint Journal of the German Society for Biomedical Engineering in VDE and the Austrian and Swiss Societies for Biomedical Engineering and the German Society of Biomaterials

Editor-in-Chief: Dössel, Olaf

Editorial Board: Augat, Peter / Habibović, Pamela / Haueisen, Jens / Jahnen-Dechent, Wilhelm / Jockenhoevel, Stefan / Knaup-Gregori, Petra / Lenarz, Thomas / Leonhardt, Steffen / Plank, Gernot / Radermacher, Klaus M. / Schkommodau, Erik / Stieglitz, Thomas / Boenick, Ulrich / Jaramaz, Branislav / Kraft, Marc / Lenthe, Harry / Lo, Benny / Mainardi, Luca / Micera, Silvestro / Penzel, Thomas / Robitzki, Andrea A. / Schaeffter, Tobias / Snedeker, Jess G. / Sörnmo, Leif / Sugano, Nobuhiko / Werner, Jürgen /

6 Issues per year


IMPACT FACTOR 2017: 1.096
5-year IMPACT FACTOR: 1.492

CiteScore 2017: 0.48

SCImago Journal Rank (SJR) 2017: 0.202
Source Normalized Impact per Paper (SNIP) 2017: 0.356

Online
ISSN
1862-278X
See all formats and pricing
More options …
Volume 61, Issue 1

Issues

Volume 57 (2012)

P wave detection and delineation in the ECG based on the phase free stationary wavelet transform and using intracardiac atrial electrograms as reference

Gustavo Lenis
  • Corresponding author
  • Institute of Biomedical Engineering, Karlsruhe Institute of Technology (KIT), 76131 Karlsruhe, Germany
  • Email
  • Other articles by this author:
  • De Gruyter OnlineGoogle Scholar
/ Nicolas Pilia
  • Institute of Biomedical Engineering, Karlsruhe Institute of Technology (KIT), 76131 Karlsruhe, Germany
  • Other articles by this author:
  • De Gruyter OnlineGoogle Scholar
/ Tobias Oesterlein
  • Institute of Biomedical Engineering, Karlsruhe Institute of Technology (KIT), 76131 Karlsruhe, Germany
  • Other articles by this author:
  • De Gruyter OnlineGoogle Scholar
/ Armin Luik / Claus Schmitt / Olaf Dössel
  • Institute of Biomedical Engineering, Karlsruhe Institute of Technology (KIT), 76131 Karlsruhe, Germany
  • Other articles by this author:
  • De Gruyter OnlineGoogle Scholar
Published Online: 2015-07-02 | DOI: https://doi.org/10.1515/bmt-2014-0161

Abstract

Robust and exact automatic P wave detection and delineation in the electrocardiogram (ECG) is still an interesting but challenging research topic. The early prognosis of cardiac afflictions such as atrial fibrillation and the response of a patient to a given treatment is believed to improve if the P wave is carefully analyzed during sinus rhythm. Manual annotation of the signals is a tedious and subjective task. Its correctness depends on the experience of the annotator, quality of the signal, and ECG lead. In this work, we present a wavelet-based algorithm to detect and delineate P waves in individual ECG leads. We evaluated a large group of commonly used wavelets and frequency bands (wavelet levels) and introduced a special phase free wavelet transformation. The local extrema of the transformed signals are directly related to the delineating points of the P wave. First, the algorithm was studied using synthetic signals. Then, the optimal parameter configuration was found using intracardiac electrograms and surface ECGs measured simultaneously. The reverse biorthogonal wavelet 3.3 was found to be optimal for this application. In the end, the method was validated using the QT database from PhysioNet. We showed that the algorithm works more accurately and more robustly than other methods presented in literature. The validation study delivered an average delineation error of the P wave onset of -0.32±12.41 ms when compared to manual annotations. In conclusion, the algorithm is suitable for handling varying P wave shapes and low signal-to-noise ratios.

Keywords: atrial fibrillation; electrocardiogram; intracardiac electrogram; P wave delineation; phase free stationary wavelet transform; PhysioNet

Introduction

Detection and delineation of the P wave in the electrocardiogram (ECG) in an automatic and reliable manner has gained interest among cardiologists and researchers in recent years because of its important role in a variety of applications. For instance, supraventricular arrhythmias such as ectopic beats, atrial flutter, and fibrillation are the most frequent cardiac arrhythmias [8] and a major cause of stroke [12]. Thus, it is of highest priority to diagnose them at an early stage. The cause of these type of afflictions is often a structural remodeling of the heart tissue and the electrophysiological properties of the atria [10]. Therefore, modifications of the normal P wave morphology in the ECG could be evaluated over the course of time and subjects with higher risk could be identified and treated even before symptoms appear [3, 5, 34].

Minimally invasive radiofrequency ablation is commonly used as first-line therapy of supraventricular arrhythmia if pharmacological treatment fails. An exact characterization of the P wave morphology during sinus rhythm can be used to reconstruct local activation times (LAT) in the atria. Since ectopic beats have a different LAT map from the ones observed in sinus rhythm, this technique could be used to reconstruct its origin [7, 18, 26]. With this information, the physician can create an optimal ablation strategy to spend less time during an intracardiac mapping procedure. Even though ablation therapy is very successful for the majority of the patients, in some cases, the symptoms can reappear and the patient has to be treated repeatedly. Analyzing the evolution of the normal P wave morphology in the ECG after ablation can help forecast the final outcome of the chosen therapy [13, 22].

Considering atrial fibrillation, the analysis of the P wave during sinus rhythm is suggested as an approach for risk stratification [1]. The early diagnosis of the subjects prone to atrial fibrillation would also have a strong impact on the costs incurred by the local health-care systems. In the year 2000, for example, the UK spent around 665 million in hospitalizations, drugs, and home care of patients with atrial fibrillation [38].

Finally, the P wave has been studied during exercise and in stress testing. In one of the studies [28], it was shown that P wave duration analysis during the recovery phase can be a powerful tool for diagnosing coronary artery disease. Furthermore, in a different study, it was found that the slope of the PR interval series during the recovery phase is dependent on the fitness of the subject. It was also shown that a hysteresis pattern in the PR/RR interval occurs when exercise and recovery are compared [2]. This kind of studies can be used to diagnose pathological conduction paths in the atria and conduction delays in the atrioventricular node.

In the past, there has been a continuous development of algorithms to detect and delineate the P wave in the ECG. The initial methods used for this purpose date back to the early 1990s, where differentiation of the ECG signal, in particular its zero crossings, was used to find wave boundaries [16]. Years later, signal transformations such as Fourier-based filtering [27] and wavelet transform [24, 30] were used to bring the ECG into a different domain and thus facilitate wave detection and delineation. In more recent years, template building and matching [14], dynamic time wrapping [39], statistical methods [21], and machine learning algorithms [25] have been used for the delineation purpose. The majority of these procedures were developed, tested, and validated using ECG signals that were manually annotated by experts.

Even though well-known databases, such as PhysioNet [11], provide a very good basis for developing and validating this kind of algorithms, they are not always perfectly accurate. Manual annotation of ECG signals is a task that requires an experienced physician and a high level of concentration. Therefore, the process can be compromised by fatigue or abnormal signal morphology. In addition, the P wave is not always present in all ECG leads, and it is often characterized by low amplitude and low signal-to-noise ratio (SNR). Since no intracardiac information is present in the majority of the cases, it is impossible to be entirely sure that, for example, a point labeled as the end of the T wave indeed marks the moment when the repolarization phase of the ventricles finishes. Therefore, the golden truth about the fiducial points of the ECG waves remains unknown.

Figure 1 shows two ECG segments extracted from the QT database in PhysioNet [17]. Figure 1A is a segment from signal sel30, and it is a good representation of the majority of the cases in this database. It is characterized by high signal quality and a normal P wave morphology. In addition, the annotations carried out by the expert physician at the onset of the P wave (Pon) and the peak of the P wave (Ppeak) appear very intuitive. However, Figure 1B shows a segment from the signal sele0129 that is characterized by abnormal P wave morphology and low SNR. This is the type of case where the annotation is not intuitive, and it can be argued if it is correct. The only way to ensure these annotations are exact is to look into an intracardiac measurement in the atria and precisely set the instant of the beginning and peak of the wave.

ECG segments extracted from the QT database in PhysioNet. The database has been annotated by an expert physician. (A) High-quality signal (sel30) with intuitive annotations. (B) Low-quality signal (sele0129) with abnormal P wave morphology and arguable annotations. The fiducial points of the P wave are not set consistently by the expert physician.
Figure 1:

ECG segments extracted from the QT database in PhysioNet.

The database has been annotated by an expert physician. (A) High-quality signal (sel30) with intuitive annotations. (B) Low-quality signal (sele0129) with abnormal P wave morphology and arguable annotations. The fiducial points of the P wave are not set consistently by the expert physician.

In this work, we present a new algorithm to detect and delineate the P wave in the ECG. The method was developed and tested using a data set for which surface ECG and intracardiac electrograms were recorded simultaneously. A basket catheter was placed inside the heart in the right atrium close to the sinus node. Thus, we claim that the signals being recorded deliver the exact instant in time, when the electrical activation of the atria begins. From this idea, it follows that the beginning of the P wave in the surface ECG can be found at a very high degree of accuracy.

We focus our method primarily on finding an optimal algorithm to automatically set the beginning and peak of the P wave in the surface ECG. However, as we will see later, the atrial ECG can only deliver information about Pon. Thus, for validation purposes afterward, we will take into consideration both Ppeak and Pon. The validation process is carried out using the QT database from PhysioNet, which contains signals that are fully independent from the ones used to develop the algorithm.

Our method is based on a modified version of the stationary wavelet transform (SWT) [29, 36]. This extended version was specially created in this work, and it fulfills the property of a phase free transformation. Therefore, the extreme points of the transformed signal can be directly related to fiducial points of the P wave and achieve an automatic delineation. The algorithm was created in a general manner so that it can be used with all ECG signals, sample rates, and even P wave morphologies.

Methods

Clinical data

To develop and test the algorithm for the P wave detection and delineation, a data set of simultaneously recorded surface ECG signals and intracardiac electrograms was used. This data set was acquired at Städtisches Klinikum Karlsruhe (Karlsruhe, Germany) using the EnSite NavX Velocity electroanatomical mapping system (St. Jude Medical, St. Paul, MN, USA). Two basket catheters (Constellation; Marlborough, MA, USA) were used for simultaneous biatrial mapping. The signal was recorded from a 54-year-old female patient undergoing ablation therapy for paroxysmal atrial fibrillation. The surface ECG and the intracardiac electrograms were recorded at a sample rate of 2034.5 Hz.

A portion of the signal characterized by sinus rhythm and with a duration of 33 s (32 P waves present) was specially selected for the development of the method presented here. The placement of the basket catheter in the right atrium ensured good coverage of the area including the sinus node. Therefore, we assume that the initiation of the atrial depolarization can be accurately used as a reference when determining the beginning of the P wave in the surface ECG. Intracardiac electrograms and ECG signals were exported without any kind of filtering from the recording system for retrospective processing. The patients, whose data were used, gave their consent.

Meanwhile, the algorithm was validated using the well-known QT database from PhysioNet. This database contains 105 different signals. From each patient, a two-lead ECG was provided and manually annotated by expert physicians so that a total of 3194 annotated P waves are present in the database. Even though we have shown that some of the annotations are very arguable, we do accept the fact that the vast majority of them is highly accurate. Furthermore, we assume that, in average, the position of Pon and Ppeak in all the manual annotations in the data set is correct. Therefore, as mentioned before, the fiducial points Pon and Ppeak are the ones our method was developed for and validated with. For more information on the QT database, please refer to [17].

Signal processing of the ECG signal

Detecting QRS complexes in the ECG signal:

QRS detection in the surface ECG is the very first step in the signal processing chain presented here. It was carried out using a method based on the SWT that was previously introduced by Lenis [19]. In the standard configuration of the algorithm, the detail coefficients of the wavelet-transformed ECG in a fixed frequency band are obtained using the Haar wavelet. However, a signal-specific selection of the wavelet and frequency band is also possible and can be done manually for optimized results. Afterward, the signal is normalized by its energy content. In the end, an adaptive threshold, obtained from the moving average value of the normalized transformed signal, is calculated. Finally, the local threshold is applied and the signal portions above it are labeled as QRS complexes.

In a second processing step, the original signal is considered again, but only the intervals labeled as QRS complexes are taken into account. The greatest local maximum is set as the R peak and the next local minimal to left and right of the R peak are set as Q and S peaks.

Since a successful P wave analysis depends on the correct QRS detection, the automatically found QRS complexes were visually inspected or compared to the manual annotations to ensure no misdetections were present. It was established that the automatic detection of QRS complexes was indeed carried out correctly and the following P wave analysis should not be affected be by this matter.

Filtering the ECG signal for P wave detection:

Once the R peaks have been located in the signal, the algorithm for P wave detection and delineation starts with a filtering process. According to the spectral properties of the P wave presented in [37], the P wave is located in spectrum between 0 and 10 Hz. Therefore, every surface ECG used in this work was filtered using a concatenation of Gaussian high- and low-pass filters with cutoff frequencies located at 1 and 15 Hz, respectively. Even though the chosen cutoff frequencies might look too narrow for a general-purpose ECG application, in our particular case, it is valid because we are interested only in the P wave. After filtering, the baseline wander was completely removed, muscular and high-frequency noise were strongly attenuated and no power line interference was observed.

Extending SWT to be in phase with the original signal:

The SWT is a modified version of the original discrete wavelet transform [4] that was created to achieve the property of translation invariance of the transformed signal. For this purpose, no downsampling process of the signal being analyzed is carried out at every level in the filter bank implementation of the transformation. Instead of downsampling the signal, the filter coefficients are upsampled by adding a zero between every two values. Therefore, the number of approximation and detail coefficients of the transformed signal at every level is the same as the number of sample values of the original signal. This has the direct consequence that the transformed signal is redundant. However, redundancy is not a relevant drawback of this algorithm in this work. One of the advantages of this method is that it can be used to detect the exact time of occurrence of an event of interest in a signal, e.g. the appearance of a P wave in the ECG. Figure 2A shows the block diagram used in the SWT.

(A) Block diagram of the filter bank implementation used to carry out the SWT of a signal x(n). The operator Ui represents the upsampling process. Adapted from [36]. (B) Reverse biorthogonal 3.3 scaling (green) and wavelet (brown) functions. (C) Asymmetrical bell-shaped waveform similar to a P wave (black) and its SWT (red) using the reverse biorthogonal 3.3 wavelet at the decomposition level 7. It can be seen that there is a phase shift (time delay ∆t) between the original signal and its SWT.
Figure 2:

(A) Block diagram of the filter bank implementation used to carry out the SWT of a signal x(n). The operator Ui represents the upsampling process. Adapted from [36]. (B) Reverse biorthogonal 3.3 scaling (green) and wavelet (brown) functions. (C) Asymmetrical bell-shaped waveform similar to a P wave (black) and its SWT (red) using the reverse biorthogonal 3.3 wavelet at the decomposition level 7. It can be seen that there is a phase shift (time delay ∆t) between the original signal and its SWT.

A particular disadvantage of using the (stationary) wavelet transform in general-purpose discrete time applications is the fact that the transformed signal has a phase shift with respect to the original signal. This is not surprising because the majority of the wavelet decomposition schemes are given by FIR filter banks. As a matter of fact, many of the wavelets (e.g. Daubechies) do not even have a linear phase. This means, however, that if the signal being analyzed shows a special pattern of interest at a given point in time, the transformed signal presents the corresponding activity at a different (not trivially estimated) moment. Since this property is not desired in the algorithm developed in this work, we would like to relate the transformed signal directly with the original one.

To demonstrate the phenomenon mentioned previously, we have created a signal composed of two halves of Gaussian bells with different widths. The signal is therefore not symmetrical, which could be the case also for a real P wave in the ECG. Eq. 1 shows the mathematical representation of the signal. In this particular example, we have chosen a signal x(t) with a duration of 1024 ms and a sampling frequency of 1000 Hz. In addition, the following standard deviations were chosen to be σl=70 ms, σr=90 ms. An SWT using a reverse biorthogonal 3.3 wavelet (shown in Figure 2B) was applied, and the transformed signal at level 7 was taken into consideration. The resulting detail coefficients at this level show that the zero crossing of the transformed signal is not in phase with the maximum of the original signal (Figure 2C).

x(t)={e(-(t-μ)22σl2), for t0,e(-(t-μ)22σr2), for t>0. (1)(1)

To overcome this problem, a novel algorithm is proposed. The detail coefficients of a standard SWT with a chosen wavelet and up to a given level are computed at first and the transformed signal is stored (Figure 3A). Parallel to this process, the original signal is reversed in time and the same type of transformation is applied. By reversing again the transformed signal, we obtain a signal that looks like a reflected version of the initially transformed one (Figure 3B). By adding this signal to the non-reversed transformed one calculated initially, a new transformed signal is created that has no phase shift when compared to the original one (Figure 3C). A short mathematical explanation of this property is carried out in Eq. 2 and described as follows.

(A) Bell-shaped waveform (black) and its SWT (red) using a reverse biorthogonal 3.3 wavelet at the decomposition level 7. (B) To produce the signal in red, the original waveform (black) was initially reversed in time. Then, the same SWT was carried out on the reversed signal, and the resulting waveform was reversed in time again. (C) Original bell-shaped signal (black) and its phase free SWT (red). The red signal is obtained by adding the transformed signals from (A) and (B). The extrema in the phase free SWT can be used to automatically delineate the P wave.
Figure 3:

(A) Bell-shaped waveform (black) and its SWT (red) using a reverse biorthogonal 3.3 wavelet at the decomposition level 7. (B) To produce the signal in red, the original waveform (black) was initially reversed in time. Then, the same SWT was carried out on the reversed signal, and the resulting waveform was reversed in time again. (C) Original bell-shaped signal (black) and its phase free SWT (red). The red signal is obtained by adding the transformed signals from (A) and (B). The extrema in the phase free SWT can be used to automatically delineate the P wave.

Let us assume that x(t) is any given real valued signal with Fourier transform X(f)=ℱ{x(t)}. A filtering process is applied to it with a filter transfer function H(f) in the Fourier domain. Additionally, the original signal x(t) is reversed in time, producing x(–t). The reversed time signal has the Fourier transform X*(f)=ℱ{x(–t)}, where the asterisk, “*”, is used to denote the conjugate complex operator. The time-reversed signal is also filtered with H(f), and the resulting output is reversed in time again. Now, this signal and the originally filtered one are added together producing the filtered signal Y(f) in the Fourier domain. The resulting signal Y(f) behaves as a filtered version of X(f) using filter 2·Re{H(f)}. Since this filtering transfer function is purely real, it does not contain any phase and x(t) and y(t) are aligned in time.

Y(f)=X(f)H(f)+(X*(f)H(f))*=X(f)(H(f)+H*(f))=X(f)2Re{H(f)} (2)(2)

Besides the fact that the maxima of the transformed and original signals are now aligned, we also observe in Figure 3C that the new resulting transformed waveform has one more very important property: its minima left and right of the maximum can be related directly to the beginning and the end of the wave. Therefore, by finding the local side minima, we also automatically delineate the wave.

Even so, in this work, we focus our development only on the peak and beginning of the P wave in the surface ECG. This is because, as mentioned before, the intracardiac electrograms with the given catheter placement inside the atria can only be used to generate the golden truth for the beginning of the wave. Therefore, the method we developed can be evaluated only for Pon. However, as we will demonstrate later, the peak of the wave is necessary in the process of finding Pon. This is the reason why we validate both fiducial points with the QT database from PhysioNet.

Another advantage of using the SWT at a given frequency band is that noise or artifacts present in other bands are strongly damped in the transformed signal. Therefore, low-frequency baseline wander, power line interference at 50 or 60 Hz, and muscular or random noise at high frequencies are strongly attenuated in the transformed ECG that will be used in the delineation process.

Intracardiac signal processing

Filtering the intracardiac signals:

The signal processing chain developed in this article was specially created for bipolar intracardiac signals. The bipolar signals are obtained by subtracting the recorded extracellular potential from two neighboring electrodes in the basket catheter. Since deterministic perturbations such as power line interference, ventricular far field, or baseline wander caused by respiration appear equally in neighboring electrodes, subtracting the two signals delivers pure atrial activity. Therefore, bipolar signals are often characterized by a larger SNR than unipolar signals. Thus, the first step is to load the bipolar signals and preprocess them.

The extracted bipolar intracardiac signals were filtered using a concatenation of Gaussian high- and low-pass filters with cutoff frequencies located at 30 and 300 Hz, respectively. This type of filtering is in accordance with the spectral properties of intracardiac signals as shown in [15].

It is important to mention that the filtering process applied to both the surface ECG and the intracardiac signal results in filtered signals that are aligned in time. This is relevant because, otherwise, the beginning of the P wave in the intracardiac signal will no longer be synchronous to the beginning of the wave in the surface ECG, even though the two were recorded simultaneously.

Detecting the beginning of the atrial activity in the intracardiac signal:

As proposed in the beginning of this article, the golden truth about the initiation of the electrical activation of the atria can be accurately retrieved using intracardiac measurements and applying a multielectrode catheter covering the sinus node. Figure 4A and B show the atrial geometry from the perspectives left anterior oblique and right anterior oblique. Electrode placement inside the atria are represented with white dots in the figure. This positioning remained stable during the complete recording. The position, where the sinus node is expected to be, is covered by at least a group of electrodes from the basket catheter.

(A) Atrial geometry displayed from the perspective left anterior oblique. It was obtained from the patient during the ablation procedure. The position of the basket (white dots) catheter ensures a good coverage of the sinus node. The right atrium is colored blue, while the left atrium is green. (B) Perspective right anterior oblique from the same atrial geometry. (C) Multichannel intracardiac recordings obtained using the basket catheter. The color of the signals corresponds the atrium they were recorded from. (D) ECG signal and lead Einthoven II recorded simultaneously during the ablation procedure. Using the intracardiac signals, it is possible to set the beginning of the P wave and use it for validation purposes. The red dotted line marks the beginning of the P wave in the surface ECG.
Figure 4:

(A) Atrial geometry displayed from the perspective left anterior oblique. It was obtained from the patient during the ablation procedure. The position of the basket (white dots) catheter ensures a good coverage of the sinus node. The right atrium is colored blue, while the left atrium is green. (B) Perspective right anterior oblique from the same atrial geometry. (C) Multichannel intracardiac recordings obtained using the basket catheter. The color of the signals corresponds the atrium they were recorded from. (D) ECG signal and lead Einthoven II recorded simultaneously during the ablation procedure. Using the intracardiac signals, it is possible to set the beginning of the P wave and use it for validation purposes. The red dotted line marks the beginning of the P wave in the surface ECG.

To detect the initiation of the activity of the sinus node, the algorithm introduced by Schilling [31] was minimally extended. This algorithm uses a non-linear energy operator [32] to transform the bipolar atrial signal into a representation where high-frequency-high-amplitude components are potentiated. In the original algorithm proposed by Schilling, a signal-dependent threshold is chosen in every channel to detect atrial activity. If the signal exceeds the threshold, then atrial activity is detected. In our particular case, we are interested in finding the beginning of such depolarization wave. Therefore, we had to make the threshold more sensitive and reduce it by a fixed factor. However, in order not to lose robustness, we combined information from different channels. Thus, an activation is accepted as such only if it is present in at least two neighboring electrodes.

Figure 4C shows a multichannel intracardiac signal. In addition, its corresponding ECG is displayed in Figure 4D together with the sample point (dotted line in the figure) that was labeled as Pon in the ECG. To set this point, the intracardiac signals recorded in the proximity of the sinus node are used and the point is set when the signal-dependent threshold is exceeded in at least two neighboring intracardiac channels.

P wave detection and delineation in the surface ECG

Removing the QT interval:

In a normal ECG, a sequence of well-defined waves is always present. The atrial depolarization is characterized by the P wave. Ventricular depolarization and repolarization is represented in the ECG as the QRS complex, the ST segment, and finally the T (and sometimes the U) wave. Since the SWT is a linear operation, the transformed signal is always a linear combination of the transformation of each previously mentioned ECG waves. Therefore, we expect that the transformed P wave will be superimposed by the transformed QRS complex, and in some cases, even the T wave if a short T-P interval is present. This is a problem because it is well known that the QRS complex has normally the largest amplitude and highest frequency components in the ECG signal [37]. Due to the proximity of the QRS complex to the P wave, the transformed QRS complex will mask the transformed P wave and its detection and delineation will be hindered.

Consequently, it is necessary to suppress the QRS complex and the T wave before the phase free SWT is carried out. However, not every type of suppression or replacement is recommended here. It is very important that the original ECG is replaced in a way that the resulting signal is continuous and differentiable. Otherwise, the phase free SWT will deliver large detail coefficients at every discontinuity, making further detection impossible. In addition, the function used to replace the QRST segment should be very smooth. If not, the large detail coefficients of a rough replacing signal would mask the transformed P wave. Therefore, the replacing signal chosen in this work was a sigmoid function s(t) given by the following:

s(t)=s2-s11+e-t+s2. (3)(3)

In addition, parameter s1 and s2, which are just the boundary conditions of the replacing function, are chosen in such a manner that the resulting replaced ECG signal is continuous. The two time instants, tr1 and tr2, are the boundary points where the ECG signal x(t) is replaced by the sigmoid function.

s1=x(tr1) (4)(4)

s2=x(tr2) (5)(5)

The sigmoid function is then placed in the PR interval exactly 50 ms prior to the Q peak. It extends to 60% of the local RR interval. Even though these parameters have been fixed initially, they can be modified by the user if necessary. It is worth mentioning that the detection and delineation of the T wave is not necessary for the replacing algorithm. However, it could be integrated to make the replacement even more robust.

A graphical representation of a typical ECG prior and after filtering and removing of the QRST segment can be seen in Figure 5A. The resulting signal is very smooth and contains only the P waves.

(A) ECG signal before and after replacing the QRST segment. The replaced and filtered ECG is very smooth and contains only P waves. (B) Graphical representation of the delineation algorithm. Ppeak and Pon are obtained directly from the phase free SWT.
Figure 5:

(A) ECG signal before and after replacing the QRST segment. The replaced and filtered ECG is very smooth and contains only P waves. (B) Graphical representation of the delineation algorithm. Ppeak and Pon are obtained directly from the phase free SWT.

Setting the peak of the P wave:

The delineation process begins by finding the peak of the P wave. At this point, the ECG signal in which the QRST segment was previously removed is used for further processing. Now, the detail coefficients of the wavelet transform are computed. According to the results presented in the section “Extending SWT to be in Phase with the Original Signal”, the maximum of the phase free SWT signal is located at the same position of the maximum of the true P wave in the ECG. However, since negative P waves are also possible in the ECG, the absolute value of the phase free SWT signal is computed and used for further considerations.

The delineation algorithm starts by looking for the largest maximum in the final portion of the RR interval. Since the QRST segment was replaced prior to phase free SWT, we expect that the largest maximum in that signal corresponds to the peak of the P wave. Accordingly, this largest maximum is then set as an initial (often very accurate) guess for the peak of the P wave in the original ECG signal. The search then continues in the original filtered ECG signal where the largest absolute valued maximum, closest to the one found previously in the phase free SWT signal, is defined as the peak of the P wave. A graphical representation of the algorithm is displayed in Figure 5B.

Finally, for further delineation, the transformed P wave is segmented. An interval of 150 ms to the left and another 150 ms right of the peak is used to extract the P wave [35]. The length of the interval should not be an issue at this point of the algorithm because the QRST segment was removed previously. Thus, it is only necessary to choose an interval length securely larger than the P wave.

Setting the beginning of the P wave:

As can be seen in the section “Extending the SWT to be in Phase with the original signal”, the beginning of the P wave is transformed into a local minimum in the phase free SWT signal. However, depending on the chosen wavelet and the level used for the transformation, there can be more than one local minimum or maximum in the region of interest. This could lead to misplacing Pon. Figure 2C shows how a local maximum of lower amplitude is located prior to the local minimum that corresponds to the beginning of the simulated wave. Thus, it is very important to choose the correct local extremum. Again, to be able to delineate both positive and negative waves, only the absolute value of the transformed and segmented P wave is considered.

The procedure to set Pon starts by making an initial guess of the point of interest. That initial guess is calculated using the area under the curve covered by the absolute valued and segmented SWT signal. The point at which 10% of the area covered up to the peak of the transformed P wave is used as initial reference. Afterward, a correction to the next local extremum is carried out. This extremum is set as the beginning of the wave.

Figure 5 shows the most relevant steps carried out by the algorithm. After removing the QT interval and applying the newly introduced extended SWT, the transformed signal is characterized by a bell-shaped waveform appearing simultaneously with the P wave in the ECG. This is the type of result that is expected if the algorithm works correctly. The delineation process is then carried out using this transformed signal. A complete summary of the algorithm can be seen in the flow diagram presented in Figure 6.

Flow diagram of the signal processing algorithm used for delineation of the P wave in the ECG signal.
Figure 6:

Flow diagram of the signal processing algorithm used for delineation of the P wave in the ECG signal.

Simulation study to evaluate the method:

A simulation study was conceived to evaluate how the delineation algorithm performs when the P wave is corrupted by noise and when its shape changes. In all the different configurations of the study, the algorithm presented in the previous sections was applied to a modified P wave and its corresponding delineation points Pon and Ppeak were obtained in every case. The positions of the onset and peak of the modified P wave were compared to the ones from a reference (Figure 7A). As reference for comparison, the P wave model introduced in the section “Extending SWT to be in Phase with the Original Signal” was used. The deviation (dev) of the modified (mod) P wave from the reference (ref) was defined as Pon, dev=Pon, mod-Pon, ref and Ppeak, dev=Ppeak, mod-Ppeak, ref.

(A) Reference P wave model with the beginning of the wave labeled as Pon. (B) Inverted P wave and its automatically estimated point Pon. (C) Wider P wave for which its left side has been made 15 ms wider. (D) P wave corrupted by AWGN at an SNR of 12 dB.
Figure 7:

(A) Reference P wave model with the beginning of the wave labeled as Pon. (B) Inverted P wave and its automatically estimated point Pon. (C) Wider P wave for which its left side has been made 15 ms wider. (D) P wave corrupted by AWGN at an SNR of 12 dB.

For the first part of the study, the amplitude and width of the P wave were modified in the following manner:

  • The amplitude of original P wave from Eq. 1 was varied using a linear scaling factor:

    xa(t)=ax(t) (6)(6)

    The scaling factor a was chosen from -2 to +2 at intervals of 0.25. Figure 7B shows an example of a scaled P wave for which a=-1.

  • Since our developed algorithm deals with the detection of the beginning of the wave, we decided to make the wave wider only on the its left side. Thus, to the parameter σl, a variation Δσ was added:

    xΔσ(t)={e((t-μ)22(σl+Δσ)2), for t0,e((t-μ)22σr2), for t>0. (7)(7)

    The additive parameter Δσ was chosen from -20 to +20 ms at intervals of 1 ms. In this particular case, we compared the change of the width of the wave Δσ with the change in the position of Pon with respect to the reference P wave. Figure 7C shows an example of a wider P wave for which Δσ=+15 ms.

    In the second part of the study, the performance of the algorithm in the presence of noise was evaluated. The following noise models were added to our P wave reference (Figure 7A):

  • Additive white Gaussian noise (AWGN) with amplitude distribution:

    fX(x)=1σ2πe-12(xσ)2. (8)(8)

    The variance σ2 of the amplitude distribution can be adjusted to achieve different SNR levels.

  • Additive white Laplacian noise (AWLN) with amplitude distribution:

    fX(x)=12λe-|xλ|. (9)(9)

    The variance 2λ2 of the amplitude distribution can be modified to achieve different SNR levels.

  • Power line interference at 50 Hz and its harmonics were modeled in the following manner:

    pl(t)=Ak=151kcos(2πk50Hzt+ϕ(k)). (10)(10)

    The amplitude A of the power line model can be adjusted to achieve different SNR levels. The phase ϕ(k) of each cosine wave was chosen randomly from a uniform distribution in the interval [0; 2π).

  • Baseline wander up to 0.4 Hz was modeled in the following manner:

    bw(t)=Ak=15cos(2π(k-1)0.1Hzt+ϕ(k)). (11)(11)

The amplitude A of the baseline model can be varied to achieve different SNR levels. The phase ϕ(k) of each cosine wave was chosen randomly from a uniform distribution in the interval [0; 2π).

The SNR levels were chosen from -3 to 30 dB at intervals of 3 dB. It is important to recall here that an SNR of -3 dB means that the noise power is twice as large as the P wave power. This would recreate a signal of a very low quality. Such a noisy signal is probably not suited for P wave studies. Meanwhile, a high-quality ECG is expected to have an SNR of 20 dB or higher. Figure 7D shows an example of the P wave corrupted by AWGN at an SNR of 12 dB and the point labeled as Pon for that wave.

A total of 1000 repetitions were carried out for each type of noise and SNR level. The mean delineation error and its standard deviation were calculated for each type of noise and for both delineation points.

Finding the optimal configuration for the proposed algorithm:

The detection and delineation algorithm of the P wave relies on the fact that the fiducial points of the P wave in the ECG can be successfully transformed into extreme points of the phase free SWT signal. However, two very important parameters have to be chosen carefully. As we will see later, the accuracy of the algorithm depends on choosing them correctly.

  • The wavelet used for the transformation. A selected group of ten commonly used wavelets were tested: Haar, db2, rbio3.1, rbio3.3, rbio3.5, bior1.3, bior1.5, coif1, sym4, and sym5. In general, it was taken into account that the morphology of the chosen wavelets were similar to the P wave.

  • The level L up to which the phase free SWT is carried out. In general, an initial estimation of the best suited level for the analysis can be given when the spectral properties of the signal being analyzed are known. In the particular case of the P wave, the center frequency fcenter of its Fourier spectrum is located around 7 Hz [37].

Since the Nyquist (and sample) frequency of the resulting transformed signal is halved due to the downsampling process in every level of the transformation, the following formula can be used to give an initial guess of the level at which the transformation should be carried out.

Llog2(fNyquistfcenter)=log2(fsamplefcenter)-1 (12)(12)

=log2(2034.5Hz7Hz)-1=7 (13)(13)

Finally, we focused our study on the lead Einthoven II. It is well known that this lead delivers the largest amplitude of the normal P wave, and it is commonly used by physicians for some diagnostic purposes.

Results

Simulation study to evaluate the method

Figure 8 shows the results obtained for Pon in the simulation study. The automatically found position of Pon is minimally affected by the amplitude of the P wave. No delineation error is present if the P wave has a positive amplitude (a>0). However, a small delineation error can be observed, when the P wave is inverted (a<0). In addition, the delineation of the onset point is highly proportional to the width of the wave. The proportionality factor is almost 1. Thus, the automatically found point Pon is shifted in time accordingly to the width of the wave.

Deviations in the automatic delineation process when compared to a reference for Pon. The dots correspond to the mean deviation error and the bars to its standard deviation. The following cases were considered: (A) a varying amplitude of the P wave, (B) a wave with changing width on its left side, (C) AWGN, (D) AWLN, (E) power line interference, and (F) baseline wander.
Figure 8:

Deviations in the automatic delineation process when compared to a reference for Pon.

The dots correspond to the mean deviation error and the bars to its standard deviation. The following cases were considered: (A) a varying amplitude of the P wave, (B) a wave with changing width on its left side, (C) AWGN, (D) AWLN, (E) power line interference, and (F) baseline wander.

Furthermore, power line interference and baseline wander do not affect the automatic delineation of Pon at all. Even at very low SNR levels, the performance of the delineation results remained perfect. However, AWGN and AWLN do have a strong impact on the performance of the method. The accuracy of the algorithm (measured as the mean deviation from the reference) stays at very low values independent of SNR levels. Yet robustness (measured as the standard deviation of the delineation error) increases rapidly with decaying SNR levels. At an SNR level -3 dB, the standard deviation of the delineation error goes up to 20 ms, which is approximately 10% of the full width at half maximum of the chosen P wave model.

Figure 9 shows the results obtained for Ppeak in the simulation study. The delineation algorithm is not affected at all by the amplitude of the P wave. However, small deviations from the reference can be noticed when the width of the wave is varied. In the presence of noise, the performance of the algorithm for the point Ppeak is very similar to the one observed for Pon.

Deviations in the automatic delineation process when compared to a reference for Ppeak. The dots correspond to the mean deviation error and the bars to its standard deviation. The following cases were considered: (A) a varying amplitude of the P wave, (B) a wave with changing width on its left side, (C) AWGN, (D) AWLN, (E) power line interference, and (F) baseline wander.
Figure 9:

Deviations in the automatic delineation process when compared to a reference for Ppeak.

The dots correspond to the mean deviation error and the bars to its standard deviation. The following cases were considered: (A) a varying amplitude of the P wave, (B) a wave with changing width on its left side, (C) AWGN, (D) AWLN, (E) power line interference, and (F) baseline wander.

Optimal configuration and best parameters for the proposed algorithm

Table 1 shows the delineation results obtained for the proposed delineation algorithm using different wavelets and levels. To quantify the performance of the algorithm, we calculated the average and standard deviation of the difference between the golden truth obtained from the intracardiac signals and the automatic annotation using the algorithm presented here. Therefore, we define the delineation error as Perror=Pautomatic-Preference. This is a common way of quantifying the performance of a delineation algorithm and it is also used by Martínez et al. [24]. Thus, a positive average value means that, in average, the algorithm sets the delineating point too late. In addition, the standard deviation is a measure of the robustness of the chosen configuration. The smaller the standard deviation, the less sensitive is the algorithm to external perturbations.

Table 1

Results of the automatic delineation algorithm for the P wave validated using intracardiac measurements.

To choose the optimal configuration for the proposed algorithm, we not only considered the average delineation error but also the standard deviation of that difference. Based on these criteria and using the intracardiac data as golden truth, the reverse biorthogonal wavelet 3.3 and the decomposition level 7 (delineation error of 1.95±5.61 ms) were selected. Even though there are other configurations with different wavelets and decomposition levels that have a lower averaged difference, the combination of average and standard deviation was considered to be optimal for the mentioned configuration.

Validation of the algorithm using the QT database from PhysioNet

Since the algorithm presented here was created to work independently from intracardiac electrograms, it should be validated using a data set that has been annotated without intracardiac information. As mentioned before, the manual annotation of a physician is not always perfect and the quality of the annotation can be compromised by other external factors. However, it is the closest we can get to the golden truth when no intracardiac signals are given.

For delineation, the detail coefficients of an SWT computed using the reverse biorthogonal 3.3 wavelet at a decomposition level of 4 was used. Again, this is the wavelet that proved to be the best in the development process. The decomposition level had to be recalculated because the sampling frequency of the data set is a different one. Using Eq. 13, the decomposition level for this database was calculated to be 4.

To validate the algorithm presented here, the QT database from PhysioNet was used. This database contains 105 recordings with a duration of 15 min each. Every record contains a two-channel ECG signal obtained from other standard databases, e.g. the MIT-BIH arrhythmia database. Databases with sampling frequencies other than 250 Hz were resampled to this frequency by the creators of the data set. In each two-channel signal, a cardiologist manually annotated 30 consecutive beats (P, QRS, T, and U waves) of the dominant morphology. The trained physician had both channels in sight for each annotation point. If there were more dominant morphologies present, up to 20 beats of each were also annotated. A total of 3194 manually annotated P waves are present in the database. For further detailed information, see [17].

Since our algorithm was initially developed to delineate the peak and onset of the P wave, these were also the fiducial points we evaluated. Table 2 shows the results obtained for the complete data set. In addition, since the QT database has always two ECG channels, it is important to mention that the better performing channel was used to evaluate the algorithm. Again, this is the very same evaluation scheme that was carried out by Martínez et al. [24].

Table 2

Results obtained for the delineation for the QT database from PhysioNet.

To build a global score, the average and standard deviation of the error were computed for every signal. Second, a global average together with a global standard deviation among all P waves in the data set was then computed. The general performance of the algorithm can then be given by a global average and standard deviation of -0.32±12.41 ms for Pon and -5.75±9.12 ms for Ppeak.

To give a short illustration of the performance of the algorithm, the same signals presented in Figure 1 are displayed in Figure 10 showing the results of the automatic delineation. The fiducial points Ppeak and Pon delivered by the automatic and manual annotations are also depicted. It can be seen that for the high-quality signal (Figure 10A), the manual and automatic annotations are in full agreement. However, for the other signal (Figure 10B), the automatic annotation looks more intuitive.

Comparison between manual and automatic delineation. The red cross represents the annotation made by the physician, while the blue circle corresponds to the automatic delineation of Ppeak and Pon. (A) High-quality signal (sel30) for which manual and automatic annotations are in full agreement. (B) Low-quality signal (sele0129) with abnormal P wave morphology for which the automatic algorithm delivers more intuitive delineation.
Figure 10:

Comparison between manual and automatic delineation.

The red cross represents the annotation made by the physician, while the blue circle corresponds to the automatic delineation of Ppeak and Pon. (A) High-quality signal (sel30) for which manual and automatic annotations are in full agreement. (B) Low-quality signal (sele0129) with abnormal P wave morphology for which the automatic algorithm delivers more intuitive delineation.

Discussion and conclusion

Simulation study to evaluate the method

The newly introduced phase free SWT has proven to be a powerful method for the kind of applications, where signal features should be highlighted but must remain at the same position after the transformation. In the interest of better understanding other properties of the method, a simulation study was carried out. The study was created to investigate how the delineation algorithm behaves when the morphology of the P wave changes.

To account for some of the typical morphological changes that can arise when dealing with different ECG leads, electrode placements, respiration, or other physiological or pathological circumstances, the width and amplitude of the P wave were varied in the first part of the simulation study. The results showed that the method is minimally affected by changes in amplitude of the P wave. This is due to the fact that the SWT is a linear transformation. Therefore, the transformed signal used to delineate the P wave is scaled in amplitude, but its extrema stay in the same position. The small delineation errors observed can be explained by the preprocessing step carried out prior to SWT. This filtering process can cause little deviation in the peak and onset positions from the original wave.

The results also showed that the width of the wave is directly related to the delineation point Pon. The position of Pon scales almost 1:1 with the width of the wave. Thus, if the wave gets wider or thinner, the point Pon moves left or right in a directly proportional manner. This is a strong feature of a delineation method.

The second part of the study had the aim of quantifying the accuracy and robustness of the method in the presence of different kinds of noise. The results showed that for all types of noise and all SNR levels, the algorithm remains very accurate in delivering low-average delineation errors. We believe that this behavior is based on the fact that the detail coefficients of the phase free SWT come from a band pass filtering process that removes low- and high-frequency artifacts but maintains the P wave almost intact.

However, the robustness of the method, measured as the standard deviation of the delineation error, was strongly affected by very low SNR levels, in particular when Gaussian and Laplacian random noises were applied. This is plausible because the power spectral density of white Gaussian and Laplacian noises is equally distributed among all frequencies, and it is impossible to completely filter out these artifacts without affecting the P wave itself. Therefore, we expect that in every repetition of this experiment, a relatively small error can be observed. Yet, in average, the algorithm should deliver accurate results.

The band pass filtering process implicitly involved in the SWT also explains why baseline wander and power line interference have a smaller impact on delineation errors than Gaussian and Laplacian noise. Baseline wander is located in the spectrum below 0.5 Hz, and power line interference is found at 50 Hz and above. Thus, they are fully damped after the phase free SWT.

Plausibility of the algorithm

One of the greatest advantages of the method presented here is that the fiducial points of the P wave are linearly transformed into local extrema by the phase free SWT. The wavelet and the decomposition level that were found to be optimal for the transformation (Table 1) are in accordance with the morphological properties of the P wave. This is the reason why all the family of reverse biorthogonal 3.x wavelets was incorporated into the analysis. The scaling function in this family (up to bordering zeros) is exactly the same. Another advantageous feature is that it has a shape similar to the P wave. Therefore, the phase free SWT should deliver larger approximation coefficients than the ones obtained from other wavelet families. Yet, an interesting aspect was that among the reverse biorthogonal 3 family, it was the third wavelet that delivered the best results. The higher the wavelet order, the better the spectral sharpness, and therefore, the lower the time localization will be. Thus, in this particular application, this wavelet achieves the best tradeoff between time and spectral localization.

In addition, the obtained decomposition level 7 for a sampling frequency of 2034.5 Hz corresponds to the frequency band around 7 Hz where the spectral properties of the P wave are located. Since subband correlation is a known issue in all wavelet transform methods, it was also important to check the neighboring decomposition levels. In fact, other very accurate results are achieved at the decomposition level 6 and using the wavelets coiflet 1 and reverse biorthogonal 3.5. Yet the combination of accuracy and robustness, measured as average and standard deviation of the delineation differences using surface and intracardiac ECGs, was optimal for the reverse biorthogonal wavelet 3.3 at decomposition level 7.

Evaluation on the QT database and comparison with other methods

The amplitude and width of the P wave are not the only parameters that can vary in real-life ECG signals. To account for other morphological changes due to the aspects mentioned previously, we evaluated our algorithm with real-life recordings from the QT database. Since this data set comprises different subjects, ECG leads, and clinical cases, we assume that the results obtained from this validation study demonstrate that our method can be used in a large variety of applications.

One of the questions we wanted to address with this work was the clinical impact that this method could achieve. Thus, it was very important to evaluate it in a realistic data set known for its large variety of patients and signals. Even though we are critical about some of the manual annotations in the QT database from PhysioNet, we do assume that the majority of the annotations are correct and can be used for evaluation. In addition, using this data set is the only way to compare the algorithm to other well-established methods presented previously in literature.

The results obtained for the QT database were very convincing. Considering that the sampling frequency of the data set is 250 Hz, the average delineation difference for Ppeak was just above one sample time. In addition, the delineation error for Pon was less than 0.4 samples, which is significantly below the resolution of the signal. When compared directly to the results achieved by Martínez et al. [24], the algorithm presented here delivered a notorious improvement when finding the P wave onset. This is interesting because both methods are based on wavelet analysis. We believe that generating local extrema in the phase free SWT signal, and subsequently finding these extrema for delineation, is indeed a very robust method. Due to the wavelet decomposition algorithm, the phase free SWT signal is not perturbed by high-frequency noise, baseline wander, or local changes in signal amplitude. If the amplitude of the signal fluctuates, the extrema remain at the same position and the algorithm works accurately. Meanwhile, this is not the case when using thresholds for delineation like in the method used by Martínez et al. [24].

Strong and not easily modeled variations in the P wave morphology while the ECG signal is being recorded are also an important topic. In some special cases, the P wave shape can change abruptly from one beat to another. The QT database contains some signals with this property. However, we expect that the phase free SWT of the time-varying P wave morphology should also change in time in the same manner. Therefore, the delineation algorithm proposed here should not have any problems with a time-varying P wave morphology, since every wave is delineated independently of its neighbors. Time-varying morphologies can be indeed a problem for algorithms based on template matching [14]. In the extreme case that the P wave morphology changes three times within three beats, there is no template that can be matched for such a signal.

A comparison with other methods presented in literature can be seen in Table 3. The definitions used for sensitivity (Se) and positive predictive value (PPV) are the same ones used by Martínez et al. [24]. It is important to mention that we automatically delineated every single beat present in the QT data set independently of P wave amplitude, shape, or SNR. Therefore, the comparison is not straightforward because other authors decided not to delineate the waves with low amplitude or SNR, but rather remove them from the analysis while correctly reducing the values for sensitivity and specificity.

Table 3

Comparison among different delineation algorithms of the P wave found in literature.

In general, the method presented here delivers convincing results when compared to others in literature. Our algorithm proved to have the most accurate delineation of Pon, which is very satisfying because this method was specially developed for that particular point. Furthermore, the accuracy of the delineation of Ppeak shows a performance that conforms with other methods. In addition, the robustness of the algorithm is also better than half of the methods presented in Table 3.

Limitations

The most important limitation of this work is the size of the data used for the development of the algorithm. One patient and 32 P waves might be too few to be able to extrapolate the results obtained for the optimal parameters of the algorithm to any other ECG signal. However, it is worth mentioning that a patient in sinus rhythm with normal P waves and an ideal positioning of the basket catheter with good coverage of the sinus node is not the typical kind of data one would expect during an ablation procedure at the hospital. This is the reason why the algorithm was validated using the well-known QT database. The optimal configuration of the algorithm indeed delivered very good results.

Second, the optimal parameter were chosen from a reduced group of wavelets and decomposition levels. It could be possible that an algorithm based on a wavelet, and a decomposition level not considered here, could deliver even better results. However, this is not very likely because the wavelets considered in this work were meticulously chosen to be similar in their morphology to a P wave in the ECG, which facilitates delineation. In addition, the chosen wavelets can all be represented by just a few filter coefficients, which reduces computational time. This is an important issue when processing large studies with Holter ECG or in general long-time recordings. Other newly introduced delineation methods like the two dimensional wrapping algorithm [33] might deliver accurate results but are computationally very costly.

Third, the delineation process is strongly dependent on the initial guess of the beginning of the P wave. Therefore, waves having an uncommon morphology might be hard to delineate if the initial guess does not deliver an accurate position of the local extremum. However, in that particular case, we would still expect the algorithm to work robustly because it would always choose the same local extremum in the phase free SWT signal.

Finally, it is important to mention that this algorithm in its current form is not suited for P wave analysis during cardiac arrhythmias such as macro-reentrant atrial flutter, atrial fibrillation, ventricular ectopic beats (VEBs), or ventricular tachycardia (VT). In these cases, the number of P waves prior to a QRS complex is highly variable. During sustained atrial flutter, for example, two or more P waves can be seen in on single RR interval. Yet prior to a VEB or during VT, no P wave is normally observed. Since the algorithm presented here assumes one single P wave before the QRS complex, it will be able to deal with these cases and an incorrect detection will be delivered. However, the method can still be used during episodes of intermittent sinus rhythm activity without affecting the related diagnostical benefit.

Conclusion

A new algorithm to detect and delineate the P wave in the ECG was developed. For this purpose, the SWT was used. The transformation was extended so that there is no phase shift between the original and the transformed signal. The local extreme points of the transformed signal were directly related to the fiducial points needed to delineate the P wave.

The simulation study showed that the new method remains very accurate but loses robustness by low levels of SNR. In addition, automatic delineation is minimally affected by changes in amplitude of the P wave. Furthermore, the automatically found Pon scales almost 1:1 with the width of the wave.

The optimal configuration of the algorithm was studied, and different wavelets and decomposition levels were analyzed. For this development process, intracardiac signals measured with a basket catheter located in the proximity of the sinus node and the corresponding simultaneously measured ECG were used. Therefore, it was possible to set the position of the beginning of the P wave at a very high level of accuracy. The newly developed algorithm was then validated using the well-known QT database from PhysioNet.

A considerable increase in performance could be observed for Pon when compared to similar methods proposed in literature. The new algorithm was not only more accurate (mean delineation error), but also more robust (standard deviation of the delineation error). In addition, since the algorithm is based on the extreme points of the transformed signal, we assume that it should be more robust than other methods based on signal-dependent thresholds [24]. Furthermore, when applied correctly, the performance of the proposed method should be independent of wave morphology and thus of P wave templates. Finally, we believe that the algorithm can be extended to also find the end of the P wave and even delineate other ECG waves with similar morphology.

Further improvements and future studies

In the future, it would be very interesting to record more data with simultaneous intracardiac electrograms and ECG recordings. The question about the optimal configuration could be further investigated. By extending the database to contain a large number of patients, ECG signals, and physiological and pathological P waves, the algorithm could be definitely evaluated.

Moreover, it would be interesting to extend the current algorithm to detect and delineate P waves in the case of atrial flutter and fibrillation. The idea of combining information from intracardiac electrograms with surface ECG could be further exploited to create a strong method that provides new insights for these common diseases. Specially, the availability of biatrial panoramic mapping using basket catheters opens up new possibilities to benchmark ECG-based algorithms with respect to the real intracardiac data.

Second, other intracardiac measurements could be used to develop automatic delineation methods for other fiducial points in all the ECG waves. This way, it could be beneficial to place the catheter electrodes completely covering the left atrium to exactly detect the end of the P wave in the ECG. Analogous methods are imaginable for the T wave too.

Acknowledgments

The authors would like to thank the German State of Baden-Württemberg for the financial support provided to G.L. and the Institute of Biomedical Engineering over the last years. In addition, the work of T.O. is funded by the German Research Foundation (DO637/14-1).

References

  • [1]

    Alcaraz A, Martínez A, Rieta JJ. Role of the P-wave high frequency energy and duration as noninvasive cardiovascular predictors of paroxysmal atrial fibrillation. Comput Methods Prog Biomed 2015; 119: 110–119.Web of ScienceGoogle Scholar

  • [2]

    Cabasson A, Dang L, Vesin J, et al. P-wave indices to detect susceptibility to atrial fibrillation. Comput Cardiol 2011; 38: 257–260.Google Scholar

  • [3]

    Clavier L, Boucher J-M, Lepage R, et al. Automatic P-wave analysis of patients prone to atrial fibrillation. Med Biol Eng Comput 2002; 40: 63–71.Google Scholar

  • [4]

    Daubechies I. The wavelet transform, time-frequency localization and signal analysis. IEEE Trans Inform Theory 1990; 36: 961–1005.CrossrefGoogle Scholar

  • [5]

    de Sisti A, Leclercq JF, Stiubei M, Fiorello P, Halimi F, Attuel P. P wave duration and morphology predict atrial fibrillation recurrence in patients with sinus node dysfunction and atrial-based pacemaker. Pacing Clin Electrophysiol 2002; 25: 1546–1554.Google Scholar

  • [6]

    Dumont J, Hernandez AI, Carrault G. Parameter optimization of a wavelet-based electrocardiogram delineator with an evolutionary algorithm. Comput Cardiol 2005; 32: 707–710.Google Scholar

  • [7]

    Fitzgerald DM, Hawthorne HR, Crossley GH, Simmons TW, Haisty Jr WK. P wave morphology during atrial pacing along the atrioventricular ring: ECG localization of the site of origin of retrograde atrial activation. J Electrocardiol 1996; 29: 1–10.CrossrefGoogle Scholar

  • [8]

    Fuster V, Rydén LE, Cannom DS, et al. ACC/AHA/ESC 2006 guidelines for the management of patients with atrial fibrillation. J Am Coll Cardiol 2006; 48: e149–e246.CrossrefGoogle Scholar

  • [9]

    Ghaffari A, Homaeinezhad MR, Akraminia M, Atarod M, Daevaeiha M. A robust wavelet-based multi-lead electrocardiogram delineation algorithm. Med Eng Phys 2009; 31: 1219–1227.Web of ScienceCrossrefGoogle Scholar

  • [10]

    Goette A, Honeycutt C, Langberg JJ. Electrical remodeling in atrial fibrillation time course and mechanisms. Circulation 1996; 94: 2968–2974.CrossrefGoogle Scholar

  • [11]

    Goldberger AL, Amaral LAN, Glass L, et al. PhysioBank, PhysioToolkit, and PhysioNet components of a new research resource for complex physiologic signals. Circulation 2000; 101: e215–e220.Google Scholar

  • [12]

    Haissaguerre M, Jas P, Shah DC, et al. Spontaneous initiation of atrial fibrillation by ectopic beats originating in the pulmonary veins. N Engl J Med 1998; 339: 659–666.Google Scholar

  • [13]

    Kaiman JM, Hamdan MH, Lesh MD, Barron HV. P-wave morphology during right atrial pacing before and after atrial flutter ablation – a new marker for success. Am J Cardiol 1997; 79: 1417–1420.Google Scholar

  • [14]

    Karimipour MR, Homaeinezhad A. Real-time electrocardiogram P-QRS-T detection-delineation algorithm based on quality-supported analysis of characteristic templates. Comput Biol Med 2014; 52: 153–165.CrossrefWeb of ScienceGoogle Scholar

  • [15]

    Keller M, Schuler S, Wilhelms M, et al. Characterization of acute radiofrequency ablation lesion development based on simulated and measured intracardiac electrograms. IEEE Trans Biomed Eng 2014; 64: 2467–2468.CrossrefGoogle Scholar

  • [16]

    Laguna P, Jané R, Caminal P. Automatic detection of wave boundaries in multilead ECG signals: validation with the CSE database. Comput Biomed Res 1994; 27: 45–60.Google Scholar

  • [17]

    Laguna P, Mark RG, Goldberg A, Moody GB. A database for evaluation of algorithms for measurement of QT and other waveform intervals in the ECG. Comput Cardiol 1997; 24: 673–676.Google Scholar

  • [18]

    Lee SP, Fynn JMS. P wave morphology in guiding the ablation strategy of focal atrial tachycardias and atrial flutter. Curr Cardiol Rev 2015: 103–110.Web of ScienceGoogle Scholar

  • [19]

    Lenis G, Baas T, Dössel O. Ectopic beats and their influence on the morphology of subsequent waves in the electrocardiogram. Biomed Technik/Biomed Eng 2013; 58: 109–119.Google Scholar

  • [20]

    Lin C, Kail G, Tourneret JY, Mailhes C, Hlawatsch F. P and T wave delineation and waveform estimation in ECG signals using a block Gibbs sampler. In: 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). New York: IEEE 2011: 537–540.Google Scholar

  • [21]

    Lin C, Mailhes C, Tourneret J-Y. P- and T-wave delineation in ECG signals using a Bayesian approach and a partially collapsed Gibbs sampler. IEEE Trans Biomed Eng 2010; 57: 2840–2849.Web of ScienceGoogle Scholar

  • [22]

    Maan A, Mansour M, Ruskin JN, Heist EK. Impact of catheter ablation on P-wave parameters on 12-lead electrocardiogram in patients with atrial fibrillation. J Electrocardiol 2014; 47: 725–733.Web of ScienceCrossrefGoogle Scholar

  • [23]

    Martínez A, Alcaraz R, Rieta JJ. Automatic electrocardiogram delineator based on the phasor transform of single lead recordings. Comput Cardiol 2010; 37: 987–990.Google Scholar

  • [24]

    Martínez JP, Almeida R, Olmos S, Rocha AP, Laguna P. A wavelet-based ECG delineator: evaluation on standard databases. IEEE Trans Biomed Eng 2004; 51: 570–581.CrossrefGoogle Scholar

  • [25]

    Mehta NS, Lingayat SS. Development of SVM based classification techniques for the delineation of wave components in 12-lead electrocardiogram. Biomed Signal Process Control 2008; 3: 341–349.Google Scholar

  • [26]

    Modre R, Tilg B, Fischer G, et al. Atrial noninvasive activation mapping of paced rhythm data. J Cardiovasc Electrophysiol 2003; 14: 712–719.Google Scholar

  • [27]

    Murthy UC, Niranjan ISN. Component wave delineation of ECG by filtering in the fourier domain. Med Biol Eng Comput 1992; 30: 169–176.CrossrefGoogle Scholar

  • [28]

    Myrianthefs MM, Ellestad MH, Startt-Selvester RH, Crump R. Significance of signal-averaged P-wave changes during exercise in patients with coronary artery disease and correlation with angiographic findings. Am J Cardiol 1991; 68: 1619–1624.CrossrefGoogle Scholar

  • [29]

    Nason BW, Silverman GP. The stationary wavelet transform and some statistical applications. In: Wavelets and statistics. New York, NY, USA: Springer 1995: 281–299.Google Scholar

  • [30]

    Sahambi JS, Tandon SN, Bhatt RKP. Using wavelet transforms for ECG characterization. an on-line digital signal processing system. IEEE Eng Med Biol Mag 1997; 16: 77–83.CrossrefGoogle Scholar

  • [31]

    Schilling C. Analysis of atrial electrograms. PhD thesis, Karlsruhe Institute of Technology (KIT), Karlsruhe 2012.Google Scholar

  • [32]

    Schilling C, Nguyen MP, Luik A, Schmitt C, Dössel O. Non-linear energy operator for the analysis of intracardial electrograms. In IFMBE Proceedings World Congress on Medical Physics and Biomedical Engineering, volume 25/4, 2009; 872–875.Google Scholar

  • [33]

    Schmidt M, Baumert M, Porta A, Malberg H, Zaunseder S. Two-dimensional warping for one-dimensional signals – conceptual framework and application to ECG processing. IEEE Trans Signal Process 2014; 62: 5577–5588.CrossrefWeb of ScienceGoogle Scholar

  • [34]

    Schreier G, Kastner P, Marko W. An automatic ECG processing algorithm to identify patients prone to paroxysmal atrial fibrillation. Comput Cardiol 2001; 28: 133–135.Google Scholar

  • [35]

    Schuster H-P, Trappe H-J. EKG-Kurs für Isabel. Stuttgart, Germany: Georg Thieme Verlag 2005.Google Scholar

  • [36]

    Shensa M. The discrete wavelet transform: wedding the a trous and mallat algorithms. IEEE Trans Signal Process 1992; 40: 2464–2482.CrossrefGoogle Scholar

  • [37]

    Sörnmo P, Laguna L. Bioelectrical signal processing in cardiac and neurological applications. Burlington, MA, USA; San Diego, CA, USA; London, UK; Elsevier Academic Press 2005.Google Scholar

  • [38]

    Stewart S, Murphy N, Walker A, McGuire A, McMurray JJV. Cost of an emerging epidemic: an economic analysis of atrial fibrillation in the uk. Heart 2004; 90: 286–292.CrossrefGoogle Scholar

  • [39]

    Vullings HJLM, Verhaegen MHG, Verbruggen H. Automated ECG segmentation with dynamic time warping. In: Proceedings of the 20th Annual International Conference of the IEEE. Engineering in Medicine and Biology Society 1998: 163–166.Google Scholar

About the article

Corresponding author: Gustavo Lenis, Institute of Biomedical Engineering, Karlsruhe Institute of Technology (KIT), Kaiserstrasse 12, 76131 Karlsruhe, Germany, Phone: +49-721-608-42650, Fax: +49-721-608-42789, E-mail: publications@kit.edu

aGustavo Lenis and Nicolas Pilia: These authors contributed equally to this work.


Received: 2014-11-11

Accepted: 2015-06-01

Published Online: 2015-07-02

Published in Print: 2016-02-01


Citation Information: Biomedical Engineering / Biomedizinische Technik, Volume 61, Issue 1, Pages 37–56, ISSN (Online) 1862-278X, ISSN (Print) 0013-5585, DOI: https://doi.org/10.1515/bmt-2014-0161.

Export Citation

©2016 by De Gruyter.Get Permission

Citing Articles

Here you can find all Crossref-listed publications in which this article is cited. If you would like to receive automatic email messages as soon as this article is cited in other publications, simply activate the “Citation Alert” on the top of this page.

[1]
Jens Haueisen and Tilmann Sander-Thömmes
Biomedical Engineering / Biomedizinische Technik, 2016, Volume 61, Number 1, Page 1
[2]
D. Panigrahy and P. K. Sahu
Australasian Physical & Engineering Sciences in Medicine, 2018
[3]
Gustavo Lenis, Nicolas Pilia, Axel Loewe, Walther H. W. Schulze, and Olaf Dössel
Computational and Mathematical Methods in Medicine, 2017, Volume 2017, Page 1
[4]
Tobias Heine, Gustavo Lenis, Patrick Reichensperger, Tobias Beran, Olaf Doessel, and Barbara Deml
Applied Ergonomics, 2017, Volume 61, Page 31
[5]
Tobias Oesterlein, Daniel Frisch, Axel Loewe, Gunnar Seemann, Claus Schmitt, Olaf Dössel, and Armin Luik
BioMed Research International, 2016, Volume 2016, Page 1
[6]
Salina Huck, Tobias Oesterlein, Armin Luik, Claus Schmitt, Reza Wakili, and Olaf Dössel
Current Directions in Biomedical Engineering, 2016, Volume 2, Number 1

Comments (0)

Please log in or register to comment.
Log in