Visualizing intracardiac atrial fibrillation electrograms using spectral analysis

Atrial fibrillation is the most common cardiac arrhythmia, and it is associated with increased risk of stroke, heart failure, and mortality. This work describes spectral analysis techniques that are being used in conjunction with visualization algorithms to help guide catheter ablation procedures that aim at treating patients with arrhythmia.

A trial fibrillation (AF) is a serious problem that can lead to stroke and heart failure, with increased mortality. The precise electrical mechanisms underlying AF aren't well understood. One effective treatment for AF is catheter ablation, whereby areas in the atria and/or nearby locations are targeted and ablated (or "burned"). However, results vary, with a large number of patients requiring repeated procedures if AF recurs in the short term. Long term results are even less encouraging.
One of the main issues with ablation is the decision on where to ablate that gives the maximum efficacy and safety. Improving our understanding of the precise electrical mechanisms underlying AF is key to minimizing the amount of "burning" with ablation and maximizing the gain. It's important that information is available to aid an ablation decision and strategy either before or during the ablation procedure. Hence, techniques and technologies to characterize and map candidate locations for ablation must be implemented in real-time.
In this article, we describe a technique for mapping the dominant frequency (DF) of atrial electrograms and explore, implement, and measure the processing time for several approaches. Our solution leverages the parallel processing computation offered by multiple CPU cores, but more importantly, the massive parallel computational power available in current GPUs. We also describe techniques for visualizing the behavior of the DF of intracardiac atrial electrograms. The visualization allows the mapping of the DFs using a color scale and isolating the main DF areas. We conclude that, with current technology and using an off-the-shelf, modern PC with a graphics card and costing about US$1,000, it is possible to implement real-time DF mapping with a loading as low as 6.75 percent (up to 50 percent, depending of the implementation strategy and the level of detail required). This changes the perspective of the problem from pure, basic research to translational, applied research, and we propose an exciting new step forward in this important area.

Atrial Fibrillation
Measuring and modeling the genesis and propagation of the electrical activity in the heart in quantitative terms is an important area of research that will help understand and treat heart arrhythmias. AF is a heart rhythm disturbance characterized by uncoordinated and rapid electrical atrial activation that takes over from normal sinus rhythm, with consequent deterioration of the mechanical ability of the atria to pump blood effectively. The ventricles will beat irregularly and rapidly during AF when conduction is intact. On the ECG, the wave of depolarization that spreads throughout the atria, called P waves, are replaced by rapid, small amplitude oscillations that vary in amplitude, shape, and timing between QRS complexes, 1 which corresponds to the three graphical deflections (Q, R, and S waves) seen on a typical electrocardiogram.
AF is the most common cardiac arrhythmia encountered in clinical practice, with a prevalence of 1 to 2 percent of the general population. 2 The symptoms of AF include palpitations, tiredness, shortness of breath, dizziness, and chest pain. As the mechanical pumping ability of the atria is compromised, the resulting pooling of blood in the atria increases the long-term risk of stroke fivefold. 3 AF is a public health problem with approximately €3,700/year per patient being spent in Europe. 1 The cost of Atrial fibrillation is the most common cardiac arrhythmia, and it is associated with increased risk of stroke, heart failure, and mortality. This work describes spectral analysis techniques that are being used in conjunction with visualization algorithms to help guide catheter ablation procedures that aim at treating patients with arrhythmia.
a catheter-based ablation procedure is about €12,500. Any advances in the understanding of this condition, especially advances that might lead to more effective treatment are, therefore, of great importance.
An affordable and recently popular approach is to take advantage of the computational power of GPUs to speed up scientific computational codes. The parallel processing of GPUs, with hundreds of cores, allow considerable performance speedups. In this work, we use GPUs to implement realistic models of electrical activity in cardiac muscle. We implemented a multichannel signal analysis approach, which computes and display results over the 3D surface of the heart chamber under study in real time.

Dominant Frequency in Atrial Fibrillation
In 1913, George Ralph Mines studied the vulnerability of an excitable circle of cells in the heart. 4 It follows from that original idea that if the concept of reentry is to be applied to atrial fibrillation, there would be a preferred range of DFs associated with the circuits. The problem is simply explained using the diagram in Figure 1. If reentry circuits are formed-knowing the velocity of propagation of the electrical activation (typically slower than 20 centimeters per second), the size of the atrium (up to 6 cm) and, most importantly, the duration of the refractory period (about 200-240 ms in normal cardiac cells, but reduced down to about 80-85 ms in AF 5 )-then the DF range associated with AF would be between 4.2 Hz and 12.5 Hz. Figure 1 also helps understand why small hearts (such as a rat's heart) are less capable of sustained fibrillation: a certain minimum critical mass is required for reentry circuits, otherwise the excitation wave front will hit refractory tissues when they get back to the origin.
We have been measuring and characterizing the behavior of DF in persistent atrial fibrillation (persAF) for the last 3 years, using up to 2,048 channels of atrial electrogram signals collected at 1,200 Hz using a noncontact mapping system (such as St. Jude Medical's EnSite Array [6][7][8][9][10][11][12] ) and performing analysis of the electrical activation in the frequency domain (FD). The spectral analysis of all the 2,048 channels must be implemented in real time, if such analysis is to be used as a tool (which would be complementary to the current time domain-based approaches) to help decide where to ablate. Also, this approach must include the identification and characterization of the DF in each of the 2,048 spectral estimations, followed by a 3D representation on a screen in such a way that the clinician can manipulate (and rotate) the 3D maps representing the DF values.
Here, we explore visualization techniques that help characterize the DF, and different ways of using current technology to implement the spectral analysis and 3D mapping. The tools are based on the representation of the DF as color maps onto a 3D anatomically accurate representation of the atrium. The alternatives explored and described in this article to implement the signal processing involved using a single Pentium core under 64-bit Matlab, using multiple Pentium cores under 64-bit Matlab and its Parallel Toolbox, and using 480 GPU processors on an Nvidia GeForce GTX 570 card in C++ prototype.

Material and Methods
In recent years, a noncontact multielectrode array catheter (St. Jude Medical's EnSite Array) has been developed 13-15 to assist with the mapping of intracardiac electrical signals in complex arrhythmia cases. This innovation lets us recreate the 3D geometry of the heart's chambers, and then we can project recorded electrical activity onto the geometry of the heart's endocardial surface as simultaneous high density of virtual unipolar electrograms.
The balloon-mounted catheter with 64 electrodes arranged in an array fashion is placed within the blood pool of the cavity of interest, and the electrograms from the chamber's endocardial surface are collected using inverse solution mathematics and interpolation in an inside-out fashion. Up to 3,600 points of electrical signals can be reconstructed by the EnSite 3000 system, mapped onto the atrium's 3D representation (see Figure 2). For the offline analysis, the EnSite 3000 system can export up to 7-second segments of data with up to 2,048 points (a matrix of 32 × 64 spatial points) along the geometric coordinates (x, y, z) of the atrium's shape. The balloon wasn't moved after geometry creation, to avoid distortion of the signals and isopotential maps. [16][17][18][19] We sampled atrial unipolar electrograms at 1,200 Hz, and applied a high-pass filter embedded in the system with a cut-off frequency of 1 Hz. No further filtering was applied to the electrogram signals to preserve their low frequency components. 20 We have exported several such segments and carefully merged them to compose longer data segments of 1 minute in duration for each patient for the studies described in this article.
After data collection, we followed the clinical electrophysiological (EP) mapping procedure by ablation around the four pulmonary veins ostia aiming at electrical isolation of potential firing triggers localized in the pulmonary veins from the left atrium. 19 We performed this either using point-by-point ablation guided by EnSite NavX or with a multielectrode pulmonary vein ablation catheter (Medtronic's PVAC) aimed at electrical isolation of conduction between the left atrium and pulmonary veins, which are important locations for firing triggers that initiate and perpetuate AF. 19 This study was performed with informed consent from the patients undergoing AF ablation for the use of electrical data acquired.

Dominant Frequency Visualization Using Spectral Analysis
For further investigation, the tool allows clinicians to isolate the highest DF area believed to be a key point on the maintenance of this arrhythmia and track this area along time as illustrated in Figure 6. With current state-of-the art bedside equipment, cardiologists who perform catheterization and ablation of AF use and manipulate 3D representations of the time domain analysis of the electrical activation (voltages) of any part of the heart. Figure 3 shows the visualization within the commercial system of noncontact intracardiac mapping using the intracardiac balloon technology of the EnSite array. We used a Fourier-based spectral analysis of the atrial electrograms for studying the behavior of the 3D DF maps, and determination of DF at each of the 2,048 points was given by the EnSite 3000 system. Figure 4 illustrates the whole spectral analysis procedure for each individual spatial point-the identification of the DF and color coding according to the frequency of the DF for the 3D representation of DFs, with purple-blue representing the lower frequencies and red-dark red corresponding to higher frequencies. We defined the DF at each of the 2,048 points as the frequency with highest amplitude within the physiological relevant range (4 to 12 Hz).
In Fourier-based spectral analysis, when N points of a signal x(t) are This process is referred to as zero-padding. Although the spectral resolution doesn't improve with zero-padding, the resulting spectral estimations will have a finer representation in the frequency domain at k/2NT or k/5NT, where the extra values are interpolations of the original X (k/NT ) and the interpolator is a sin( f )/f kernel, producing the smoothest series that contains the original samples. In our case, when the zero-padding factor is 2, the resulting frequency samples will be at ∆f 2 = 0.125 Hz, and for zeropadding factor of 5, ∆f 5 = 0.05 Hz.
We've chosen to use 4-second-long segments for a good compromise between frequency and time resolution, with a Hamming antileakage window. We obtained consecutive DF maps that are 2 seconds apart (with 50 percent overlap) after cancellation of the ventricular far field (QRS-T segments) on each of the 2,048 unipolar atrial electrograms, using an algorithm described elsewhere. 12 Then, we generated a 3D DF frame of the left atrium using the anatomic coordinates exported. Figure 5a shows an example displayed with two different viewpoints. Figure 5b shows a time sequence of four consecutive frames that are 2 seconds apart, highlighting that the DF activity is dynamic.
With the advances in computing power and possibility of implementing more demanding mathematical manipulations of complex data, and the ability for producing and manipulating 3D imaging in real time as described here, it's now possible to implement a system that measures the DF over say 2,048 points and produces a 3D representation of the DF map in real time just as easily as the time domain voltage maps of Figure 3, which are currently used to guide ablation. In Figure 6, we illustrate how the visualization of only the DF region can help doctors to identify the potential  locations where ablation might take place. For this purpose, our tool needs to both identify the areas of highest DF, as well as use specific color scales in the visualization to clearly identify these areas. Our tool also allows monitoring the impact of the ablation procedure in the frequency domain by comparing the 3D DF maps before and after ablation. This helps verify the effectiveness of the procedure. Figure 7 shows that a substantial reduction of both the DF frequency and the areas with high frequency occur after a successful ablation procedure. The lower part of Figure 7 shows the DF maps reproduced on the flat 32 × 64 matrix, while the top part shows them as a more useful 3D representation that takes the atrial geometry into consideration.

Parallel Processing Implementations
DF maps were created wit h t he Matlab 64-bit R2012a software and its corresponding Parallel Processing Toolbox (version 6.0). This software allows processing in double precision.
The GPU implementation powered a C++ prototype that created each DF map by computing the 2,048 FFTs in parallel in the GPUs with the Nvidia CUDA Fast Fourier Transform library (CUFFT). The program then identifies the frequency with highest amplitude for each FFT result, also in parallel, but now using CPU threads with OpenMP. Even though the CUFFT library allows doubleprecision computation, we calculated the FFTs with single precision to reduce time spent sending the input data to GPU memory and the output data back to RAM. Also, using double precision, depending on the window size, can require more memory than the graphics card has available, so the computation of the 2,048 FFTs would have to be divided into multiple, smaller batches. With single precision, we can compute 2,048 FFTs in a single batch, which means a single pair of input-in and output-out data transfers and faster computation. Aware that this could possibly decrease precision and lead to errors, we evaluated the difference between the single-precision GPU-computed FFT results and the double-precision Matlab ones, and found the average mean squared-error values to be negligible when compared to the root mean square (RMS) level of the resulting signal.

Results
We used a 3.4-GHz Pentium i7 quadcore desktop to determine the processing time for DF mapping with different numbers of CPU cores. For comparison of processing times between single and multiple CPU cores and the GPU cores, a 1-minute data segment was analyzed using 4-second windows with 50 percent overlap. The zero-padding factor was set to 2 for allowing the visualization of frequency powers at every 0.125 Hz.
Using a single CPU core (under Matlab), DF maps could be generated within 2.46 ± 0.05 seconds. The processing time decreases to 2.03 ± 0.03 seconds when using four Pentium cores (under Matlab). This means that the loading is about 50 percent. A real-time DF mapping implementation would therefore be possible by  using just the CPU (Pentium) cores. Using the GPUs for FFT calculation decreases processing time to 0.27 ± 0.01 seconds. This is 14.8 times faster than real time (a load of only 6.75 percent). Even when the zeropadding factor was increased to 5 (allowing visualization of frequency powers at every 0.05 Hz), the data processing using the GPUs under C++ was still 3.5 times faster than using 4 CPU cores under Matlab. These results therefore suggest that, where possible, using GPU cores for independent calculations on large amounts of data is preferable. This would allow the use of the CPU Pentium cores to run other tasks concurrentlyfor example, controlling data acquisition and storage. The timings consider different choices of zero-padding and Figure 8 shows the different approaches.
The C++ visualization displays the 3D DFs as you would see them in electrograms, the difference being that each vertex color represents the DF instead of the electric potential. The fast rendering lets us perform rotation on the atrium surface, and we can modify the use of an interactive color scale at any time to help visually isolate regions where the DFs are above a given threshold.
Leveraging the speedup obtained in the creation of the 3D DFs resulting from the use of GPUs, we also added two parameters that we can change to make a trade-off between processing time and smoothness in consecutive DF maps: the zero-padding factor, and the percentage of overlapping between input signal windows. Increasing the zero-padding factor will lead to a finer representation of the resulting frequencies of the FFTs, and also higher memory requirements, as well as processing time (see Figure 8). When windows overlap, more DFs are created, thus reducing the time difference between consecutive ones. The result is a smoother animation of the DF maps, which helps to track the movement of several frequency zones in the atrium. Figure 9 shows an example of such smooth animation, where the window length was 4 seconds, with an overlap of 92 percent. The same configuration but with an overlap of half a window would display only the first and sixth frames. T he approaches we described allow the same current state-of-the art bedside equipment used by clinicians nowadays to be easily modified to perform FD analysis of the electrical activation of any chamber of the heart and generation of DF maps in real time. These 3D representations can be displayed with the same equipment and manipulated in exactly the same way as they are by cardiologists who perform the catheterization, and ablation procedures are used for manipulating the timedomain based images. With current technology and using a standard off-the-shelf PC with a modern graphics card, all of the approaches described here can be implemented in real time and can help the cardiologist performing ablation in the theatre by displaying FD-based information in real time. Clearly, using GPUs represents a tremendous advance, as the CPU cores can perform other jobs, such as controlling data acquisition and data transfer, or even displaying the results in more informative ways.
Furthermore, we would like to stress the importance of having research groups with different expertise involved in this project. The use of scientific visualization techniques and parallel programming using GPUs in this clinical project have helped us develop a solution that isn't currently available in real time with any existing equipment. We're currently exploring other avenues on how this prolific collaboration can continue for this and other clinical projects, and we hope this work can serve as an example for other collaborations in interdisciplinary fields. 476685/2012-5). Frederique Jos Vanheusden, Ghulam André Ng, and Fernando Soares Schlindwein wish to