X-ray PIV Measurements of Velocty Feld of Blood Flows Volume 5, umber 2: 46-52, October 2007 Internatonal Journal of Vascular Bomedcal Engneerng Heart Rate Varablty Analyss Dagnosng Atral Fbrllaton Jnho Par &2, Hyung Mn Cho 2, Wuon-Sh Km &2 Medcal Physcs, Unversty of Scence & Technology, Korea 2 Korea Research Insttute of Standards and Scence, Korea Abstract In ths paper, dscrete wavelet transform was used to fnd the tme postons of QRS complexes. Any specfc numercal threshold was not used so that the algorthm of ths paper could be applcable to varous shapes of electrocardogram (ECG) waveform as much as possble. Flterng was not used because t could modfy the ECG waveform. The pont-connected Poncaré plots of nter-pea ntervals provded the dfferentatng crtera between the normal ECG and the atral fbrllaton ECG. Poncaré plot of each person shows the tme-nvarant pecular pattern under condtons of normal snus rhythm. In ths case, the patterns of Poncaré plot can be assembled wth three basc patterns n general. Atral fbrllaton maes the Poncaré plot change rregularly n the tme course and removes the pecular pattern. Keywords: Atral fbrllaton, Poncaré plot, QRS complex detecton, Wavelet transform. Introducton Atral fbrllaton s the most common arrhythma n clncal practce. It s the rs factor of thromboembolsm and deeply related to the qualty of lfe. In ths paper the beat rhythms of ventrcles were detected to dagnose atral fbrllaton. Atral fbrllaton nfluences the ventrcular actvty by changng the conducton velocty of sgnals,2 and QRS complexes are less lely to be nfluenced by the baselne-wanderng and nose. If ECG s contamnated wth nose, t s dffcult to dscrmnate the fbrllatory wave from nose. And t s dffcult to determne the cutoff frequency dvdng them. Therefore not atral actvty but ventrcular actvty of heart was focused n ths paper. Because the change of electrcty conducton speed s related to atral fbrllaton, the dynamcs of nter-pea ntervals come to change before the paroxysm of atral fbrllaton. 2 From the onset to the offset of atral Bo-sgnal Research Center, Korea Research Insttute of Standards and Scence, Yuseong-Gu, Daejeon 305-340, Korea. Tel: +82-42-868-547, Fax: +82-42-868-5487 Moble: +82--9405-547, E-mal: wsm@rss.re.r fbrllaton, the varablty of nter-pea ntervals ncreases. 3 Moreover an earler wor nssted that the power spectral densty of nter-pea ntervals s mportant when we study the atral fbrllaton. 2 It was used the Daubeches 8 wavelet (flter length 8) whch has the smlar shape to QRS complexes. Ths smlarty to the shape of QRS complexes helps achevng the better result. 4 Removng QRS complexes n ECG plays an mportant role n atral fbrllaton study. 3 Because the spectral components of ventrcular and atral actvtes are overlapped, lnear flterng s not usable to dscrmnate them. 5 Mahmoodabad et al. detected QRS peas by usng Daubeches wavelet transform. They used the wavelets of fxed scales (2 3 ~ 2 5 ) and the numercal threshold (0.25 s) to weed out wrong detectons from results. 4 And Senhadj et al. tred to extract atral actvtes from ECG by usng the temporal matchng between the data contanng manly ventrcular actvtes and the data contanng both the atral and ventrcular actvtes. 6 On the other hand, Watson et al. presented an dea to remove QRS-T complexes from ECG by applyng modulus maxma threshold to the result of contnuous wavelet transform. 7 Ths paper tred not to use any specfc numercal threshold but to employ general method as much as 46
J Par, HM Cho, WS Km possble. Based on the result of ths QRS detector, the features of normal and atral fbrllaton ECG were studed. Materals Data used n ths paper came from the database of Computer n Cardology Challenge 200 of Physonet. 8 Each record conssts of two smultaneous ECG data. Fles begnnng wth n contan normal ECGs. Even numbered fles begnnng wth p and endng wth c contan ECGs descrbng atral fbrllaton. For example a quadruplet of n0, n0c, n02 and n02c are the data come from the same person n the order of tme. And p0, p0c, p02 and p02c come form the person wth paroxysmal atral fbrllaton. p02 ndcates the data just before the paroxysm of atral fbrllaton. The tool that was used n data analyss s the open source software Sclab 9 (verson 4..) under the Fedora 7 lnux envronment. Dscrete Wavelet Transform Data When the sgnal f (t) s gven, we can obtan the followng lnear composton wth the scalng functon ϕ and correspondng wavelet ψ. Dscrete wavelet transform can be mplemented wth flter bans. In Fgure the sgnal f (t) can be represented as A D or A2 D2 D or A 3 D3 D2 D. Algorthm Descrpton Removng the baselne-wanderng Assume that we made a dscrete wavelet transform on the ECG waveform to fnd the transform coeffcents sets A, D, D,..., D2, D ( A : approxmaton coeffcents set, D : detal coeffcents set). After choosng one detal coeffcents set D and settng all components of D, D 2,..., D as 0, calculate nverse transform of these coeffcents sets (Fgure 2(b)). And subtract the above result (Fgure 2(b)) from the ECG waveform of Fgure 2(a). Then fnd the threshold of ts frequency dstrbuton by the Otsu s method 0, whch s used to dvde the subject nto two. If we refer to the lower sde of the threshold as bacground and to the upper sde as object, we can fnd the followng value for each. frequency sum (bacground) {mean value (object) } standarddevaton (bacground) If we select that gves maxmum, we can obtan Fgure 2. Fgure 2(a) shows the orgnal ECG, Fgure 2(b) shows the ECG baselne that comes from the nverse wavelet transform of A D, D,..., D,0,0,...,0 and Fgure 2(c), Fgure. Dscrete wavelet transform by flter bans (A, A2, A3: approxmaton coeffcents, D, D2, D3: detal coeffcents, LPF : Low Pass Flter, HPF: Hgh Pass Flter). shows the subtracton result of Fgure 2(b) from Fgure 2(a). Defne the Fgure 2(c) waveform as the new ECG that wll be analyzed from now on. f ( t) = ( ψ j, = 2 a ϕ( t ) + j j / 2 ψ (2 j / 2 t )) d j, ψ j, 47
Heart Rate Varablty Analyss Dagnosng Atral Fbrllaton Fgure 2. (a) Orgnal ECG waveform. (b) Inverse transform of A D, D,..., D,0,0,..., 0, wavelet coeffcents sets of ECG waveform. (c) Subtracton result of the waveform of (b) from the waveform of (a). Choosng the most approprate scale to QRS complexes To prevent the wavelets from detectng the T wave of ECG, mae a temporarly deformed ECG waveform. To show QRS pea components to advantage, mae the followng treatments. Descrbng the ECG waveform whose baselne-wanderng has been removed as functon ecg (n), defne the sets P _ ecg as { y y = ecg( n) > 0} and _ ecg as { y y = ecg( n) < 0}. Remove the elements of P _ ecg lesser than the mean value of repeat n the same manner for new mean value of the larger one. If the mean value of than that of P _ ecg, and _ ecg. Compare the P _ ecg and _ ecg, and tae P _ ecg was greater _ ecg, remove the negatve sde from the functon ecg (n). In other case, do n the same manner. The result s Fgure 3. Ths deformed ECG s used only n calculatng Pearson correlaton coeffcents. Fgure 3. Waveform whch shows the QRS complexes to advantage from the ECG of Fgure 2(c). Assume that we made a dscrete wavelet transform on the ECG waveform ecg (n) to fnd the transform coeffcents sets A', D', D',..., D' 2, D'. After choosng one detal coeffcents set ' ( ), all D components D' j ( j ) and A' are set as 0. Defne D' as a set composed of the absolute values of all components of D'. And defne a new set D' ˆ as ˆ y = x( f x mean( D' )) D' = { y x D', }. y = 0( f x < mean( D' )) Fgure 4(b) shows the waveform from the nverse wavelet transform of,...,0, D ˆ ',0,..., 0. And then fnd the 0 Pearson correlaton coeffcent between the absolute values of Fgure 4(b) and waveform of Fgure 3 for each. Fnd the frst that the absolute value of Pearson correlaton coeffcent becomes smaller than the prevous value. Then the scale s that we tred to fnd. Assgnng the left end pont and rght end pont of each QRS group If we compare Fgure 4(a) wth Fgure 4(b), waveform of Fgure 4(b) ndcates the postons of QRS complexes well. Defne g (n) as the waveform composed of absolute values of Fgure 4(b). And fnd 48
J Par, HM Cho, WS Km nverse transform of these coeffcents sets A,0,..., M 0. Ths represents the trend of all QRS pea magntudes. Fgure 4. (a) ECG waveform whose baselne-wanderng has been removed. (b) Inverse transform of 0,..., 0, D ˆ ',0,..., 0 wavelet coeffcents sets of the waveform of (a). D ˆ ' s coeffcents set such that ts nose s removed. the ndces such that g ( n) mean( g ). Then ndces n we found mae clusters. Each cluster becomes each QRS group. Each QRS pea pont s selected as a pont Second weedng out wrong detectons Fnd the mean value μ and standard devaton σ of the all nter-pea ntervals. From them, fnd the X such σ that X μ or σ X μ +. And select the QRS 2 2 group whch has the smaller QRS pea magntude between two QRS groups around X. If the pea magntude of selected QRS group s lesser than the half of the result of secton (5), dscard ths group. Repeat ths procedure untl σ / μ converge. QRS cancellaton Implement the QRS cancellaton by jonng lnearly the left end pont and rght end pont of each QRS group survved so far. Fgure 5 shows comparatvely the orgnal ECG and the QRS canceled waveform after all process were executed. whch maes the absolute value of functon ecg(n) maxmum n each QRS group. It maes sense because the baselne-wanderng of ECG was removed. From ths pea pont, left end pont and rght end pont of each QRS group are found traversng left and rght respectvely untl g ( n) = mean( g ). Assgnng the left end pont and rght end pont of each QRS group For each group, f the pea pont s dentcal wth left end pont or rght end pont of that group, remove the group from the selecton. Mang a guess about the trend of all QRS pea magntudes Mae a dscrete wavelet transform on the set of all QRS pea magntudes to fnd the transform coeffcents sets A, D, D,..., D2, D. Except the M M M approxmaton coeffcents set A M, let all detal coeffcents sets ( M ) be 0. Then calculate D Fgure 5. Above two waveforms are dentcal except QRS complexes. (a) ECG waveform whose baselne-wanderng has been removed. (b) QRS canceled waveform of (a). Results and Dscusson If we mae the pont-connected Poncaré plots of nterpea ntervals for the normal ECG and the atral fbrllaton ECG, we can fnd the nature dstngushng between them. If these nter-pea ntervals are represented as the sequence I I, I,..., Poncaré plot, 2 3 I 4 49
Heart Rate Varablty Analyss Dagnosng Atral Fbrllaton conssts of the ponts I, I ),( I, I ),( I, ).... Ths ( 2 2 3 3 I 4 plot applcable for dscrete data s closely related to conventonal phase-space plot for contnuous data. Pont-connected Poncaré plots of nter-pea ntervals for the normal ECG Under condtons of normal snus rhythm, pontconnected Poncaré plot shows the tme-nvarant pecular pattern for each person. Fgures 6-8 show the typcal patterns of ths case. Fgure 6 shows the pattern gatherng y = x around the lne, and t stands for almost same nter-pea ntervals between the former and latter beats. Fgure 7 shows the regular pattern of polygons (mostly trangle) around the center ponts. Fgure 8 shows the wedge-shaped regular pattern. Fgure 7 and Fgure 8 show certan regularty. If the ponts gather around y = x lne closely n the case of normal ECG, rregularty wthn the cluster s allowed. These Fgures 6-8 behave le buldng blocs. Almost the whole patterns for the normal cases can be obtaned by assemblng these. The Poncaré plot of each person shows pecular pattern and that seems to be tme-nvarant under condtons of normal snus rhythm. Fgures 0(a)-(e) show the patterns for each one mnute consecutvely. They show the tmendependent features. Fgure 6. The frst typcal pattern of pont-connected Poncaré plot for the normal ECG. The ponts gather around the y = x lne. Ths means the tme ntervals between heart beats are almost same. Pont-connected Poncaré plots of nter-pea ntervals for the atral fbrllaton ECG Atral fbrllaton removes the pecular pattern from the Poncaré plot n Fgure 9. And t maes Poncaré plot rregular and vary wth tme n Fgures 0(f)-(j). Ths conforms to the observaton that nter-pea ntervals durng atral fbrllaton are statstcally ndependent of each other, except for a slght correlaton between the mmedate subsequent beats. Fgure 7. The second typcal pattern of pont-connected Poncaré plot for the normal ECG. At tmes only one wng appears n the plot. Sometmes several wngs more than two confront ther sdes one another. Quantfyng the regular pattern In Fgures 6-8 the each pont n the pont-connected Poncaré plot seems to return to ts orgnal poston n a few turns. Therefore to quantfy ths nature, the number of tmes to return to the orgnal poston was counted for each pont. Fgure 8. The thrd typcal pattern of pont-connected Poncaré plot of the normal ECG. 50
J Par, HM Cho, WS Km Table Mean numbers for the ponts of Poncaré plot to return to ther orgnal postons and the ndcator n proporton to the normalty of ECG. Crculaton Indcator numbers* ormal (n02c,n04c,,n50c) AF (p02c,p04c,,p50c) 2.73±6.9 (=25) 58.66±3.67 (=25) 0.56±0.24 (=25) 0.32±0.4 (=25) * Mean numbers requred to return to the orgnal poston. Mean value of ndcator ncreasng n proporton to the Fgure 9. Pont-connected Poncaré plot of the atral fbrllaton ECG. Ths has no regular pattern. normalty of ECG. of normal ECG. And n the case of atral fbrllaton, any pont must go for a long tme to reach ts orgnal poston. The ndcator whch becomes larger n proporton to the normalty of ECG s modeled as followng. If the number of tmes to return to the orgnal poston s relatvely low, the ndcator we try to defne must become larger. Therefore let s calculate the mean value of c = number of tmes to return to the orgnal poston Fgure 0. (a)-(e): Pont-connected Poncaré plot of the normal ECG for each one mnute consecutvely. The pattern s tme-ndependent and regular. (f)-(j): Pontconnected Poncaré plot of the atral fbrllaton ECG for each one mnute consecutvely. It has no regular pattern and vares wth tme. Threshold to judge whether each pont was returned to the neghborhood of ts orgnal poston was bult as followng. Frst let a the mean value of the mnmum dstances from each pont to all other ponts. And let b the standard devaton of dstances from each pont to a y = x dagonal lne. Here the threshold ( + ) a 2b a was used. Ths term s to account for the normal 2 b case (Fgure 6) dfferentatng the case of atral fbrllaton (Fgure 9). Ths means that threshold becomes larger by 50% when a gets larger than b from a b (Fgure 6 case). If any pont s concluded not to return to ts orgnal poston wthn the fnte data, the pont was excluded from the study. In Table, the mean number of tmes to return to the orgnal poston s relatvely low n the case, ( 0 < c ) for all ponts n the Poncaré plot. Because the man polygon of Poncaré plots s trangle, square root was used wth = 0. 5 n mnd. 4 Lmtatons In ths paper, only 25 cases of ECG for normal and atral fbrllaton respectvely were consdered. And predctng atral fbrllaton before ts paroxysm was not studed. It seems hard to use the method descrbed n secton (3) of the Results and Dscusson to predct the paroxysm of atral fbrllaton. In future research, t s requred to verfy usng the Poncaré plot of ths paper to predct the paroxysm of atral fbrllaton. Conclusons Ths study tred to buld the exact QRS detector and to perform QRS cancellaton by guessng the onset and offset of QRS complex usng the wavelet nformaton. From ths QRS detector, the pont-connected Poncaré plots of nter-pea ntervals were made. Under condtons of normal snus rhythm, pont-connected Poncaré plot shows the tme-nvarant pecular pattern for each person. And ths pattern can be assembled wth three basc patterns n Fgures 6-8. However, ths 5
Heart Rate Varablty Analyss Dagnosng Atral Fbrllaton regularty collapses durng atral fbrllaton. The pecular pattern s removed from the pont-connected Poncaré plot. That shows the rregularty whch vares wth tme.. Kasmacher H, Wese S, Lahl M., Montorng the complexty of ventrcular response n atral fbrllaton., Dscrete Dynamcs In ature And Socety. 2000;4():63-75. Acnowledgements Ths wor was supported by the bo-sgnal research center n Korea Research Insttute of Standards and Scence. References. Bollmann A, Lombard F., Electrocardology of Atral Fbrllaton: Current Knowledge and Future Challenges., IEEE Eng Med Bol Mag. 2006 ov- Dec;25(6):5-23. 2. de Chazal P, Heneghan C., Automated Assessment of Atral Fbrllaton., Computers n Cardology. 200;28:7-20. 3. Petrutu S, g J, jm GM, Al-Angar H, Swryn S, Sahaan AV., Atral Fbrllaton and Waveform Characterzaton: a Tme Doman Perspectve n the Surface ECG., IEEE Eng Med Bol Mag. 2006 ov-dec;25(6):24-30. 4. Mahmoodabad SZ, Ahmadan A, Abolhasan MD., ECG Feature Extracton usng Daubeches Wavelets., Vsualzaton, Imagng, and Image Processng. 2005;Proceedng(480):86. 5. Husser D, Strdh M, Sornmo L, Olsson SB, Bollmann A., Frequency Analyss of Atral Fbrllaton From the Surface Electrocardogram., Indan Pacng Electrophysol J. 2004 Jul ;4(3):22-36. 6. Senhadj L, Wang F, Hernandez AI, Carrault G., Wavelets extrema representaton for QRS-T cancellaton and P wave detecton., Computers n Cardology. 2002;37-40. 7. Watson J, Addson PS, Grubb, Clegg GR, Robertson CE, Fox KAA., Wavelet-based flterng for the clncal evaluaton of atral fbrllaton., IEEE Engneerng n Medcne and Bology Socety Proceedngs. 200;:302. 8. The Paroxysmal Atral Fbrllaton Predcton Challenge Database, http://www.physonet.org/physoban/database/afpdb. 9. The open source platform for numercal computaton Sclab. http://www.sclab.org. 0. Otsu,., A threshold selecton method from graylevel hstograms., IEEE Trans. Systems, Man, and Cybernetcs. 979;9():62-66. 52