1 Introduction

During atrial fibrillation (AF), atrial electrical activity is described as chaotic and random [15]. Frequency domain analysis can help to interpret such activity. Ablation at sites with dominant frequency (DF) resulted in a significant prolongation of AF cycle length (AFCL) compared with ablation of a site with nondominant frequencies [13, 19]. This result supports the use of DF mapping to identify suitable ablation targets. It is important to minimize the involvement of ventricular activity (QRS complexes) because the range of frequencies of interest associated with AF (from 5 to 12 Hz) overlaps with the frequency content of QRS complexes (mainly from 10 to 30 Hz). If QRS complex noise were not eliminated, the dominant frequencies present in the atrial electrogram of some sites might be ‘false’ in the sense that they do not indicate atrial activation frequencies but QRS contamination. The main purpose of this article is to demonstrate the effect that the removal of QRS-related activity from atrial electrograms has on the spectrum of these signals. The real importance of our results for clinical application is the enhanced reliability in the identification of atrial DF evidenced by the marked reduction in spectral power of atrial electrograms after 10 Hz resulting from the QRS subtraction.

A cancellation algorithm was presented by Slocum et al. [20] who proposed to average QRST complexes and subtract this averaged pattern from the electrogram. This worked well, but there were residuals due to minor changes in QRST morphology which were caused by movement of the heart with respiration.

Stridh et al. [21] proposed a modification of this technique aimed at reducing the effect of respiration and the improvement was most obvious in leads with weak AF (with low amplitude, in this study, leads V2 and V3). Castells et al. [6] proposed a method similar to that by Slocum et al. [20] where mean QRST complex was computed by principal component analysis (PCA) instead of averaging.

We aimed to evaluating the effects of cancellation on unipolar signals with minimal far field ventricular depolarization using three different approaches, flat, linear and spline interpolations rather than subtracting a pattern.

2 Methods

In this analysis, the algorithm detected ventricular activations from the QRS complexes of a surface ECG lead. The ECG represents the total of the potentials generated by the heart and contains information on all electrical events occurring in the heart [18]. The QRS complex is the dominant characteristic of the ECG signal [22], therefore, reliable QRS detection remains an important area of research. The ECG signal from lead V5 for a patient who has AF is shown in Fig. 1a.

Fig. 1
figure 1

a Surface ECG from patient in AF and b Intra-cardiac atrial electrograms

Figure 1b shows unipolar intra-cardiac atrial electrograms measured from inside the atrium. The noncontact mapping system used (Ensite, St. Jude Medical) records 2048 virtual unipolar electrograms from multiple sites simultaneously [11] sampled at 1200 Hz over 20 s. It consists of atrial signals sometimes contaminated with far-field ventricular activity. The patients underwent catheter ablation guided by contact mapping using Ensite, NavX 6.0, St. Jude Medical during electrophysiological procedures of AF.

There was approval from the Local Ethics Committee for mapping and ablation studies for patients undergoing AF ablation which include blood sampling and collection of electrical data during the procedures. Data collected for this study relate to patients who had consented to the above.

It is important to eliminate ventricular signals that contain relatively high frequency components compared with other waves [16]. Therefore, QRS subtraction is the first approach to be implemented for ‘cleaning’ atrial signals before performing spectrum analysis to locate dominant frequencies.

The sweeping of the 3D representation of the atrium of 2048 unipolar electrograms (Fig. 2) is a spiral along the 32 ‘parallels’ from pole to pole stepping down to the next parallel after one full turn (and there are 64 ‘meridians’).

Fig. 2
figure 2

3D representation of the atrium

2.1 QRS detection

Accurate QRS detection is important to recognize and classify atrial and ventricular signals. Ventricular component whilst present could not be accurately identified from the noncontact unipolar atrial electrograms. Therefore, we used signals from the surface ECG as a reference to identify ventricular activity. The data collected from surface ECG and the electrograms are sampled simultaneously. A technique based on Thakor et al. [22] was implemented to detect the QRS complexes of the ECG signals. The pass band frequencies, 8–20 Hz were determined based on the minimum and maximum duration of the QRS complex (50–125 ms).

The signal was then rectified and a low-pass filter at 6 Hz applied to the rectified signal. The cut-off frequency of this low-pass filter is determined by the shortest RR interval of the ECG signals (354 beats per minute). FIR filter design using the window method is used for the low pass.

An adaptive threshold technique was used for QRS detection. The adaptive threshold was adjusted and tended to 75% of the running average of the peak of magnitude of the QRS complexes [5]. The peaks were detected using this threshold and to avoid detecting the same beat twice, a refractory period (280 ms) was set, chosen to be a length of time short enough that another beat could not physically occur (214 bpm) [17].

The QRS was replaced by either flat, linear or spline interpolation before frequency analysis was performed. The subtracted points (110 points, with 50 points before and 60 points after the detection) are based on the length of typical QRS complex and the ratio 50/60 was selected because the fiducial point of the detector is the first point above the adaptive threshold.

Interpolation is the estimation of the unknown samples of a signal using a weighted average of a number of known samples by the neighbourhood [24].

2.2 Flat interpolation

In this approach, the subtracted QRS complexes were replaced by a baseline value (near to zero).

2.3 Linear interpolation

Linear interpolation is often used to fill the gaps in a signal. The interpolation consists of fitting a straight line between two data points and choosing interpolated values at the appropriate positions along that line [26]. If we have two known points that have coordinates \( \left( {x_{0} ,y_{0} } \right) \) and \( \left( {x_{1} ,y_{1} } \right) \) as shown in Fig. 3, the data series y along the straight line is obtained from the equation:

Fig. 3
figure 3

Linear interpolation between the points

$$ \frac{{y - y_{0} }}{{x - x_{0} }} = \frac{{y_{1} - y_{0} }}{{x_{1} - x_{0} }} $$
$$ y = \frac{{\left( {x_{1} - x} \right)y_{0} + \left( {x - x_{0} } \right)y_{1} }}{{x_{1} - x_{0} }} $$

where \( x_{0} \) and \( x_{1} \) are the times (positions) of the data collection at the beginning and end of the segment being interpolated and x represents the corresponding time (position) of the desired interpolated value within the interval \( \left[ {x_{0} ,x_{1} } \right]. \)

2.4 Spline interpolation

The term ‘spline’ derives from the flexible drafting tool used by architects to draw piecewise continuous curves [8, 23, 26]. Splines have interesting properties such as highly accurate derivative approximation, good convergence and good stability in the presence of round-off errors [26]. Splines represent a middle ground between a purely analytical description and numerical finite difference methods which break the domain into the smallest possible intervals. With spline interpolation, we approximate the interpolation function \( y\left( x \right) \) over the interval \( \left[ {x_{0} ,x_{1} } \right] \) by dividing the interval into sub regions with the requirement that there be continuity of the function at the joints. We can define a spline function, \( y\left( x \right), \) of degree N (with N = 3 for cubic splines) with values at the joints \( x_{0} = u_{0} \le u_{1} \le u_{2} \ldots \ldots \le u_{{N - x_{1} }} \) and having the properties:

  1. (1)

    In each interval \( u_{i - 1} \le x \le u_{i} \left( {i = 1,m} \right), \) the function y(x) is a polynomial of degree not greater than N.

  2. (2)

    At each interior point, \( y\left( x \right) \) and its first N − 1 derivatives are continuous.

Consider a data series with elements \( \left( {x_{i} ,y_{i} } \right),i = 1, \ldots ,N. \) The first two derivatives \( y^{\prime}\left( x \right) \) and \( y^{\prime\prime}\left( x \right) \) will be a constant for all x. Here, the prime symbol denotes differentiation with respect to the independent variable x. We write the spline function in the form

$$ y\left( x \right) = f_{i} \left( x \right);\,\,x_{i} \le x \le x_{i + 1} ,i = 1, \ldots ,N - 1 $$

And specify the following conditions at the junctions of the segments:

  1. (1)

    Continuity of the spline function:

    $$ f_{i} \left( {x_{i} } \right) = y\left( {x_{i} } \right) = y_{i} = i = 1,2, \ldots ,N - 1; $$
    $$ f_{i - 1} \left( {x_{i} } \right) = y\left( {x_{i} } \right) = y_{i} = i = 1,2, \ldots ,N; $$
  1. (2)

    Continuity of first derivative (slope):

    $$ f^{\prime}_{i - 1} \left( {x_{i} } \right) = f^{\prime}_{i} \left( {x_{i} } \right),i = 1,2, \ldots ,N - 1; $$
  1. (3)

    Continuity of second derivative:

    $$ f^{\prime\prime}_{i - 1} \left( {x_{i} } \right) = f^{\prime\prime}_{i} \left( {x_{i} } \right),i = 1,2, \ldots ,N - 1 $$

3 Results

3.1 QRS detection of intra-cardiac atrial electrograms

The band-pass filter used MATLAB filtfilt command to filter the reference signals. This eliminates group delay issues because it uses zero-phase forward and reverse digital filtering. Figure 4a shows the signal after the band-pass filter and rectification, and the signal after low-pass filtering is shown in Fig. 4b.

Fig. 4
figure 4

QRS detection a ECG after band-pass filter and rectification, b ECG after low-pass filter showing peaks of the signal and samples to be subtracted

The peaks of the QRS were detected and marked in red. 50 points to the left and 60 points to the right from the peak points are marked in green as shown in Fig. 4b.

3.2 QRS subtraction from atrial electrograms

In the three different approaches, we implemented the 110 subtracted points are replaced by flat, linear or cubic-spline interpolation, as shown in Fig. 5a–c. The flowchart of the QRS detection and subtraction is shown in Fig. 5d.

Fig. 5
figure 5

The reference signal with QRS complex (blue dotted line) and atrial electrogram after QRS subtraction (black line) using a flat, b linear and c spline interpolations. d Flowchart of the QRS detection and subtraction

The black line represents the atrial electrogram after QRS subtraction (using flat, linear or spline interpolation), while the blue dotted line represents the QRS complex before subtraction was done.

3.3 Time analysis

Time-domain methods have been successfully applied in the characterization of AF periods using ECG [25]. Anuradha et al. [2] use time-domain methods to classify the cardiac signals. They used adaptive neuro-fuzzy interface system (ANFIS) and compared their results with those obtained using the analytical method. As a result, they concluded that ANFIS is the better of the two methods for ECG classification. Husser et al. [9] use time–frequency analysis to monitor and predict atrial drug effects during AF. They showed that antiarrhythmic drugs (class I and III) can cause atrial cycle length increase (decrease fibrillatory rate) together with increased refractoriness and decreased conduction velocity. In time-domain analysis, complex fractionated atrial electrograms (CFAE) have been noticed to occur at areas of slowed conduction and pivot points of reentrant wavelets [14]. Their mapping provides evidence for the hypothesis that CFAE areas may be critical sites for AF perpetuation and can serve as target sites for AF ablation.

3.4 Spectral analysis

Spectral analysis allows us to investigate the dominant frequencies in a signal, as they are likely to be important to the physical process. Berenfeld et al. [3] investigated the mechanism that underlies arrhythmias and focussed on the analysis of human AF in the frequency domain. They reviewed the use of the Fourier power spectrum and its DF to study the AF mechanism in patients. In previous papers [4, 12], they introduced the method of frequency sampling to identify the spatial distribution of excitation frequencies during AF. Their technique provides accurate localized sites of periodic activity during AF and their results support the hypothesis that stable localized sources are responsible for AF maintenance in the isolated sheep heart.

DF analysis is a potential tool to analyse atrial rate in AF [15]. The frequency characteristics of different areas of the atria are not the same [4], hence DF analysis is used to detect the areas that have rapid activations [15]. DF, defined as the frequency with the highest power between 4 and 10 Hz, was obtained over 7 s-long segments. The DF estimation of atrial electrograms after QRS subtraction was determined after removing the direct current (DC) component to obtain a stationary time series. DC component is the mean value of the signals and it is important to remove it to avoid a strong power at frequency zero in the spectrum. The analysis was performed using FFT with frequency resolution 0.29 Hz and 50% overlap [7, 10]. The FFT approach is efficient in terms of computation time [1, 7] and produces reasonable results for a large class of signal processes.

4 Discussion

4.1 Effect of different QRS subtraction approaches on DF

Three different approaches of interpolation were tested to see the effect of the mean spectrum and illustrative results are shown in Fig. 6 (fifth patient).

Fig. 6
figure 6

Mean DF estimation of atrial electrogram using a flat, b linear and c spline interpolations

In Table 1, frequencies were the same value for flat, linear and spline interpolations in each patient except for patient 4. For patient 4, the DF for flat and linear interpolations is the same, but DF for spline is showing a slight reduction. Hence, we observed that the method of interpolation made little difference in the DF of the signals. However, the power amplitude at the DF is different, as shown in Table 1.

Table 1 DF and power for each interpolation

The mean power for flat and linear interpolations is lower than for spline interpolation. This is due to the nature of the graph for flat and linear approaches; the end power depends on the slope of the segment of signal to be interpolated. If the signal is on a positive slope, the power for linear approach is generally higher than that for flat interpolation, while if the signal is in on a negative slope the power is lower due to the reduction of area under the graph. Spline interpolation will normally result in higher power due to the increase of area under the curve.

Figure 7a shows the mean frequency for all patients (P1, P2, P3, P4 and P5) before and after QRS subtraction using flat interpolation. We observed that the power for mean frequency after QRS subtraction is reduced and this is most significant for frequencies above 10 Hz. The reduction of higher frequency power after QRS subtraction shows the effect of cancellation of the QRS influences on the atrial electrograms.

Fig. 7
figure 7

a Mean frequency, before and after QRS subtraction using flat interpolation (blue dotted line before subtraction, black line after subtraction) and b Power spectrum, before and after QRS subtraction using flat interpolation

The analysis for 2048 unipolar atrial electrograms of noncontact mapping shows that the power of the DF is reduced after QRS subtraction. Figure 7b shows the power spectrum before and after QRS subtraction in one patient. The shape of the figure represents the 3D sweeping of the atrium as explained in the Sect. 2.

In previous studies [20, 21], the QRS subtraction was based on the shape of the QRS signal. In those studies, the QRS complex is replaced with some pattern extracted from the signal. In this study, we use flat, linear and spline interpolations and we do not take the shape of the signal into consideration. As for QRS detection, the surface ECG is used as a reference while interpolation is done on the atrial electrograms. The advantages of this approach are that (i) it is not affected by changes in the shape of the QRS and (ii) the DF values are consistent, irrespective of the choice of the interpolation technique. The QRS subtraction using three different interpolations only affects the power of the signals but not the value of DF derived from the electrograms. Finally, mean frequency after QRS subtraction shows low power for frequencies above 10 Hz.

5 Limitation

In this study, the subtraction includes the QRS complex only (not the T wave). Some researchers argue that T waves might introduce spectral contamination at 3–4 Hz and that they should also be removed prior to estimation of DF. We shall investigate this in a future work.