We consider the use of a running measure of power spectrum disorder to distinguish between the normal sinus rhythm of the heart and two forms of cardiac arrhythmia: atrial fibrillation and atrial flutter. This spectral entropy measure is motivated by characteristic differences in the power spectra of beat timings during the three rhythms. We plot patient data derived from tenbeat windows on a “disorder map” and identify rhythm-defining ranges in the level and variance of spectral entropy values. Employing the spectral entropy within an automatic arrhythmia detection algorithm enables the classification of periods of atrial fibrillation from the time series of patients’ beats.

When the algorithm is set to identify abnormal rhythms within 6 s it agrees with 85.7% of the annotations of professional rhythm assessors; for a response time of 30 s this becomes 89.5%, and with 60 s it is 90.3%. The algorithm provides a rapid way to detect atrial fibrillation, demonstrating usable response times as low as 6 s. Measures of disorder in the frequency domain have practical significance in a range of biological signals: the techniques described in this paper have potential application for the rapid identification of disorder in other rhythmic signals.

### 5.1 Introduction

Cardiovascular diseases are a group of disorders of the heart and blood vessels and are the largest cause of death globally (World Health Organization 2007). An arrhythmia is a disturbance in the normal rhythm of the heart and can be caused by a range of cardiovascular diseases. In particular, atrial fibrillation is a common arrhythmia affecting 0.4% of the population and 5%–10% of those over 60 years old (Kannel et al. 1982; Cairns & Connolly 1991); it can lead to a very high (up to 15-fold) risk of stroke (Bennett 2002).

Heart arrhythmias are thus a clinically significant domain in which to apply tools investigating the dynamics of complex biological systems (Wessel et al. 2007). Since the pioneering work of Akselrod et al. (1981) on spectral aspects of heart rate variability, such approaches have tended to focus on frequencies lower than the breathing rate. By contrast, we develop a spectral entropy measure to investigate heart rhythms at higher frequencies, similar to the heart rate itself, that can be meaningfully applied to short segments of data.

Conventional physiological measures of disorder, such as approximate entropy (ApEn) and sample entropy (SampEn), typically consider long time series as a whole and require many data points to give useful results (Grassberger & Procaccia 1983; Pincus 1991; Richman & Moorman 2000). With current implant technology and the increasing availability of portable electrocardiogram (ECG) devices (Bai et al. 1999; Anlike et al. 2004), a rapid approach to fibrillation detection is both possible and sought after. Though 114 numerous papers propose rapid methods for detecting atrial fibrillation using the ECG (Xu et al. 2002, 2007; Isa et al. 2007), less work has been done using only the time series of beats or intervals between beats (RR intervals). In one study, Tateno and Glass use a statistical method comparing standard density histograms of ∆RR intervals (Tateno & Glass 2000, 2001). The method requires around 100 intervals to detect a change in behavior and thus may not be a tool suitable for rapid response.

Measures of disorder in the frequency domain have practical significance in a range of biological signals. The irregularity of electroencephalography (EEG) measurements in brain activity, quantified using the entropy of the power spectrum, has been suggested to investigate localized desynchronization during some mental and motor tasks (Inouye et al. 1991; Rosso 2007). Thus, the techniques described here have potential application for the rapid identification of disorder in other rhythmic signals.

In this paper we present a technique for quickly quantifying disorder in high frequency event series: the spectral entropy is a measure of disorder applied to the power spectrum of periods of time series data. By plotting patient data on a disorder map, we observe distinct thresholds in the level and variance of spectral entropy values that distinguish normal sinus rhythm from two arrhythmias: atrial fibrillation and atrial flutter. We use these thresholds in an algorithm designed to automatically detect the presence of atrial fibrillation in patient data. When the algorithm is set to identify abnormal rhythms within 6 s it agrees with 85.7% of the annotations of professional rhythm assessors; for a response time of 30 s this becomes 89.5%, and with 60 s it is 90.3%. The algorithm provides a rapid way to detect fibrillation, demonstrating usable response times as low as 6 s and may complement other detection techniques.

The structure of the paper is as follows. Section 5.2 introduces the data analysis and methods employed in the arrhythmia detection algorithm, including a description of the spectral entropy and disorder map in the context of cardiac data. The algorithm itself is presented in Section 5.3, along with results for a range of detection response times. In Section 5.4, we discuss the results of the algorithm and sources of error, and compare our method to other fibrillation detection techniques. An outline of further work is presented in Section 5.5, with a summary of our conclusions closing the paper in Section 5.6.

### 5.2 Data Analysis

After explaining how we symbolize cardiac data in Section 5.2.1, the spectral entropy measure is introduced (Section 5.2.2) and appropriate parameters for cardiac data are selected (Section 5.2.3). We then show how the various rhythms of the heart can be identified by their position on a disorder map defined by the level and variance of spectral entropy values (Section 5.2.4).

Data were obtained from the MIT-BIH atrial fibrillation database (afdb), which is part of the physionet resource (Goldberger et al. 2000). This database contains 299 episodes of atrial fibrillation and 13 episodes of atrial flutter across 25 subjects (henceforth referred to as “patients”), where each patient’s Holter tape is sampled at 250 Hz for 10 h. The onset and end of atrial fibrillation and flutter were annotated by trained observers as part of the database. The timing of each QRS complex (denoting contraction of the 116 ventricles and hence a single, “normal”, beat of the heart) had previously been determined by an automatic detector (Laguna et al. 1997).

#### 5.2.1 Symbolizing cardiac data

We convert event data into a binary string, a form appropriate for use in the spectral entropy measure. The beat data is an event series: a sequence of pairs denoting the time of a beat event and its type. We categorize normal beats as N and discretize time into short intervals of length τ (for future reference, symbols are collected with summarizing descriptions in Table 5.1). Each interval is categorized as Ø or N depending on whether it contains no recorded event or a normal beat, respectively. This yields a symbolic string of the form ...ØØØN ØØN ØN ØØØN.... This symbolic string can be mapped to a binary sequence (N → 1, Ø → 0). This procedure is shown schematically in Figure 5.1. Naturally, this categorization can be extended to more than two states and applied to other systems. For example, ectopic beats (premature ventricular contractions) could be represented by V to yield a symbolic string drawn from the set {Ø,N,V }. An additional map could then be used to extract a binary string representing the dynamics of ectopic beats.

#### 5.2.2 Spectral entropy

We now present a physiological motivation for using a measure of disorder in the context of cardiac dynamics, followed by a description of the spectral entropy measure. Following Bennett (2002), atrial fibrillation is characterized by the physiological process of concealed conduction in which the initial

regular electrical impulses from the atria (upper chamber of the heart) are conducted intermittently by the atrioventricular node to the ventricles (lower chamber of the heart). This process is responsible for the irregular ventricular rhythm that is observed. Atrial flutter has similar causes to atrial fibrillation but is less common; incidences of flutter can degenerate into periods of fibrillation. Commonly, alternate electrical waves are conducted to the ventricles, maintaining the initial regular impulses originating from the atria. This results in a rhythm with pronounced regularity. Normal sinus rhythm can be characterized by a slightly less regular beating pattern occurring at a slower rate compared to atrial flutter. Example electrocardiograms for the three rhythms are shown in the boxed-out areas of Figure 5.3, below.

Given these physiological phenomena, the spectral entropy can be used as a natural measure of disorder, enabling one to distinguish between these three rhythms of the heart. Presented with a possibly very short period of heart activity one can create a length-L, duration-Lτ , binary string. One then obtains the corresponding power spectrum of this period of heart activity using the discrete Fourier transform (Cooley & Tukey 1965). Given a (discrete) power spectrum with the ith frequency having power Ci , one can define the “probability” of having power at this frequency as

When employing the discrete Fourier transform, the summation runs from i = 1 to i = L 2 . One can then find the entropy of this probability distribution [with i having the same summation limits as in Equation (5.1)]:

Breaking the time series into many such blocks of duration Lτ , each with its own spectral entropy, thus returns a time series of spectral entropies. Note that this measure is not cardiac specific and can be applied to any event series. For example, a sine wave having period an integer fraction of Lτ will be represented in Fourier space by a delta function (for Lτ → ∞) centered at its fundamental frequency; this gives the minimal value for the spectral entropy of zero. Other similar frequency profiles, with power located at very specific frequencies, will lead to correspondingly low values for the spectral entropy. By contrast, a true white noise signal will have power at all frequencies, leading to a flat power spectrum. This case results in the maximum value for the spectral entropy:

As will be discussed in the following section, H can be normalized by Hmax to give spectral entropy values in the range [0,1].

Note that analytical tools relying on various interbeat intervals have been devised in the past (e.g., Tateno & Glass 2000, 2001; Schulte-Frohlinde et al. 2002; Lerma et al. 2007). Here, we demonstrate how our measure relates to those studies. Any series of events can be represented by

where tk is the time when an event (beat) occurs. The corresponding power spectrum is, then,

The spectral entropy is, by definition,

where p(ω) = P(ω)/ R dω ′P(ω ′ ). We therefore see that Equation (5.6) depends on all of the intervals between any two events [c.f. Equation (5.5)]. This is in contrast to studies on the distribution of beat-next-beat intervals in Schulte-Frohlinde et al. 2002. We believe that this generalization enriches the structure captured in the short-time segments and thus allows for the shortening of the detection response time in our arrhythmia detection algorithm. We finally note that since the spectral entropy depends only on the shape of the power spectrum, it is relatively insensitive to small, global, shifts in the spectrum of the signal.

#### 5.2.3 Parameter selection

We now introduce parameters for the spectral entropy measure and select values appropriate for cardiac data. The sampling interval acts like a low pass-filter on the data since all details at frequencies above 1/(2τ ) Hz, the upper frequency limit, are discarded (de Boer et al. 1984). The sampling interval must be sufficiently small such that no useful high-frequency components are lost. We choose a sampling interval τ = 30 ms, since processes like the heart beat interval, breathing and blood pressure fluctuations occur at much lower frequencies. The upper frequency limit in the power spectrum is consistent with the inclusion of all dominant and subsidiary frequency peaks present during atrial fibrillation (Ng & Goldberger 2007).

We call the duration over which the power spectrum is found, and hence a single spectral entropy value is obtained, the spectral entropy window: α = Lτ (L is the number of sampling intervals required). With our value for τ , the shortest spectral entropy window giving sufficient resolution in the frequency domain for cardiac data is found for L around 200, α ∼ 6 s. This value for α is equivalent to approximately ten beats on average over the entire afdb. It is consistent with previous work on animal hearts looking at the minimum window length required to determine values for the dominant frequencies present during atrial fibrillation (Everett et al. 2001).

To take into account the heterogeneity of patients’ resting heart rates (HRs), we fix τ and use an L value for each patient such that there are on average 10 beats in each spectral entropy window. Thus, α = L(HR)τ = α(HR). All subsequent parameters that are determined by L will similarly be a function of the average heart rate; we will henceforth drop the HR notation for clarity, with the dependence on average heart rate understood implicitly.

Patients with higher average heart rate require smaller L, and therefore have a shorter spectral entropy window. By invoking individual values for L, the maximum spectral entropy for each patient is constrained to a particular value: Hmax [c.f. Equation (5.3)]. To make spectral entropy values comparable, we normalize the basic spectral entropy values for each patient [Equation (5.2)] by their theoretically maximal spectral entropy value. The spectral entropy can thus take values in the range [0,1]. In choosing L near its minimally usable value, we necessarily have a small number of beats compared to the window length α. In such cases, a window shape having a low value for the equivalent noise bandwidth (ENBW) is preferable (Harris 1978; Nuttall 1981).

The ENBW is a measure of the noise associated with a particular window shape: it is defined as the width of a fictitious rectangular filter such that power in that rectangular 123 band is equal to the actual power of the signal. The condition for low ENBW is satisfied by the rectangular window. To maximize the available data, a sequence of overlapping rectangular windows separated by a time a is used. This results in a series of spectral entropy values also separated by a. We follow the convention of using adjacent window overlap of 75% (Harris 1978), leading to a window separation time: a = Lτ/4. This gives a typical value for a of 1.5 s. A summary of window and overlap parameters is presented in Table 5.1.

Figure 5.2 illustrates the spectral entropy measure applied to patient 08378 from the afdb. We identify three distinct levels in the spectral entropy value corresponding to the three rhythms of the heart assessed in the annotations. Beating with a relatively regular pattern, which can be associated with normal sinus rhythm, sets a baseline for the spectral entropy. The irregularity associated with fibrillation causes an increase in the value, with the pronounced regularity of flutter identifiable as a decrease in the spectral entropy. We note that power spectrum profiles in frequency space should remain qualitatively similar for a given rhythm type, regardless of the underlying heart rate.

For example, periodic signals can be characterized by peaks at constituent frequencies, independent of the beat production rate; similarly, highly disordered signals can be consistently identifiable by their flat power spectra. This confers a significant advantage over methods relying solely on the heart rate. We find considering only the instantaneous heart rate and its derivatives to be insufficient in consistently distinguishing between sinus rhythm, fibrillation and flutter; this point is addressed further in the Discussion section (Section 5.4.1).

#### 5.2.4 Cardiac disorder map

Having identified differences in the level of the spectral entropy measure corresponding to different rhythms of the heart, we suggest that there should be a similar distinction in the variance of a series of spectral entropy values. We propose that the fibrillating state may represent an upper limit to the spectral entropy measure; once this state is reached, variations in the measure’s value are unlikely until a new rhythm is established. By contrast, the beating pattern of normal sinus rhythm is not as disordered as possible and can therefore show variation in the spectral entropy values taken. Inspecting the data, one frequently observes transitions between periods of very regular and more irregular (though still clearly sinus) beating.

Thus, normal sinus rhythm will naturally explore more of the spectral entropy value range than atrial fibrillation, which is consistently irregular in character (including some dominant frequencies, see Ng & Goldberger 2007). Furthermore, in defining the spectral entropy window to be constant for a given patient, some dependence on the heart rate is retained, despite accounting for each patient’s average heart rate. This dependence can cause additional harmonics to appear in the power spectrum, increasing the variation of spectral entropy values explored during normal sinus rhythm. Last, windows straddling transitional periods of the heart rate will also demonstrate atypical power spectra, further compounding the increase in the variance when comparing normal sinus rhythm to atrial fibrillation. We do not conjecture on (and do not observe) a characteristic difference in the variance of spectral entropy values for atrial flutter, relying on the spectral entropy level to distinguish

the arrhythmia from fibrillation and normal sinus rhythm.

In theory, the spectral entropy can take values in the range [0,1]. Possible variances in sequences of spectral entropy values then lie in the range [0, 1 4 ]. These two ranges determine the two-dimensional cardiac disorder map. In practice, we plot the standard deviation rather the variance for clarity, and so rhythm thresholds are given in terms of the standard deviation. Due to finite time and windowing considerations, the spectral entropy is restricted to a subset of values within its possible range. We attempt to find limits in the values that the spectral entropy can take by applying the measure to synthetic event series: a periodic series with constant inter-beat interval, and a random series drawn from a Poisson probability distribution with a mean firing rate.

For a heart rate range of 50 beats per minute (bpm) to 200 bpm in 1-bpm increments we obtain 150 synthetic time series for the periodic and Poisson cases, respectively. The average spectral entropy value over the 150 time series in the periodic case is 0.67±0.04; the average value in the Poisson case is 0.90±0.01. By assuming the maximum variance to occur in a rhythm that randomly changes between the periodic and Poisson cases with equal probability, an approximate upper bound for the standard deviation can be calculated: using the two average spectral entropy values in the definition of the standard deviation, we find the upper bound to be approximately 0.115.

Figure 5.3 illustrates the cardiac disorder map for all 25 patients comprising the afdb. The standard deviation is calculated from M adjacent spectral entropy values (separated by a), corresponding to a duration of β = Ma = MLτ/4; we call β the variance window. In this case, we have M equal to 20 and so β has a length of 30 s for a typical patient. We will see in the following section that β sets the response time of the arrhythmia detection algorithm.

The smallest useable number for M is 4, corresponding to the rapid response case where β is typically 6 s. We have M equal to 40 for the case where β is typically 60 s. In Figure 5.3, each value of the standard deviation is plotted against the average value of the spectral entropy within the variance window, and is colored according to the rhythm assessment provided in the annotations. As with spectral entropy windows, variance windows have an overlap, b. For simplicity, we set b = a, giving a typical value of 1.5 s. Note that b can take any integer multiple of a, though doing so does not alter the results substantially.

One observes atrial fibrillation to be situated in the upper left of the disorder map, consistent with having a high value for the spectral entropy and a low value for the variance. Atrial flutter has a lower average value for the spectral entropy, as expected. For the given case with β typically 30 s, we determine fibrillation to exhibit spectral entropy levels above Γf ib = 0.84, with flutter present below Γf l = 0.70. A standard deviation threshold can be inferred at around Φf ib = 0.018, with the majority of fibrillating points falling below that value. Although beyond the expository purpose of this paper, we note that these approximate thresholds can be further optimized using, for example, discriminant analysis (McLachlan 1992).

Disorder maps for the three detection response times (6 s, 30 s, 60 s) are qualitatively similar; increasing the length of the variance window improves the separation of rhythms in the disorder map at a cost of requiring more data per point. From these observations, we hypothesize threshold values in the spectral entropy level and variance that distinguish the two arrhythmias from normal sinus rhythm. In the following section, thresholds drawn from the disorder map are used in an arrhythmia detection algorithm.

**Next Page - Algorithm and Discussion**

**Previous Page - Discussion and Appendix**