Introduction: Heart rate turbulence (HRT) is a promising noninvasive risk stratified for mortality after myocardial infarction. On the basis of a study of ventricular premature complex coupling interval and sympathetic nerve burst amplitude, we hypothesized that measures of HRT would increase with increased prematurity of the coupling interval. The changes in quasi-stationary of the sinus rhythm due to the biphasic physiological change in SA node activity from PVCs are known as heart rate turbulence (HRT). In HRV analysis, this disturbance is removed from the RR tachogram, and an assumption is made that the phase of the RR tachogram is unchanged after the signal returns to the “undisturbed rhythm.” In HRT, the changes in the “disturbed” section are analyzed to extract metrics to quantify the changes. Method of Implementation: In general, HRT manifests as a short initial acceleration of the heart rate for a few beats, followed by a deceleration back to the basal value from before the PVC. HRT is usually quantified by two numerical parameters: turbulence onset (TO) and turbulence slope (TS). TO is defined as the percentage difference between the average value of the first two normal RR intervals following the PVC (RRn, n = 2, 3) and of the last two normal intervals preceding the PVC (RR−n, n = 2, 1) and is given by :

where RR−2 and RR−1 are the first two normal intervals preceding the PVC and RR+2 and RR+3 the first two normal intervals following the PVC. (Note that there are two intervals associated with the PVC; the normal-PVC interval, RR0, and the following PVC-normal interval RR+1.) Therefore, positive TO values indicate deceleration and negative TO values indicate acceleration of the post ectopic sinus rhythm. Although the TO can be determined for each individual PVC (and should be if performed online), TO has shown to be more (clinically) predictive if the average value of all individual measurements is calculated. TS is calculated by constructing an average ectopy-centered time series32 and determining the steepest (linearly regressed) slope each possible sequence of five consecutive normal intervals in the post-PVC “disturbed” tachogram (usually taken to be up to RR+16; the first 15 normal RR intervals). That is, all possible slopes from the set {RR+2,+3,...,+6, . . . , RR+17,+18,...,+16} are calculated, and the maximum of the 13 possible slopes is taken to be the TS. These values are usually averaged over all acceptable candidates, and can run into the tens of thousands for 24hour Holter recordings. Figure 3.11 illustrates the calculation of TS after the disturbance

Here to find out TS , The linear least squares fitting technique is the simplest and most commonly applied form of linear regression and provides a solution to the problem of finding the best fitting straight line through a set of points. In fact, if the functional relationship between the two quantities being graphed is known to within additive or multiplicative constants, it is common practice to transform the data in such a way that the resulting line is a straight line, say by plotting vs. instead of vs. in the case of analyzing the period of a pendulum as a function of its length . For this reason, standard forms for exponential, logarithmic, and power laws are often explicitly computed. The formulas for linear least squares fitting were independently derived by Gauss and Legendre. In the RR tachogram due to a PVC. Note that the following beat after the PVC (RR+1) has an associated elongated RR interval, the compensatory pause after the early (premature) preceding beat. Although slopes are calculated for each following set of five consecutive beats, only the third and sixth slopes are illustrated for clarity. The criteria for excluding PVCs must be stringent, since HRT quantification can only deliver usable results if the triggering event was a true PVC (and not an artifact, T wave or similar non-PVC event). In addition, the sinus rhythm immediately preceding and following the PVC must be checked to ensure that it is free from arrhythmia, artifacts, and false beat classifications due to artifact. TO values below 0 and TS values above 2.5 are considered normal, and abnormal otherwise (i.e., a healthy response to PVCs is a strong sinus acceleration followed by a rapid deceleration). Although the exact mechanism that leads toHRT is unknown, it is thought to be an autonomous baroreflex whereby the PVC causes a brief disturbance of the arterial blood pressure. Therefore, HRT can be measured around the point of atrial ectopy as well as ventricular ectopy. When the autonomic control system is healthy, this rapid change causes an instantaneous response in the following RR intervals. If the autonomic control system is impaired, the magnitude of this

response is either diminished or possibly completely absent. From a clinical perspective, HRT metrics have been shown to be predictive of mortality and possibly cardiac arrest. Furthermore, HRT metrics have been shown to be particularly useful when the patients are taking beta-blockers. In one study, combined TO and TS was found to be the only independent predictor of mortality compared to otherwise predictive markers such as mean HR, previous myocardial infarction, and a low Ejection fraction. Program_1: Here Program Project.m is tested on MIT arrhythmias database with patient no. 102 this will be a final program for measurement of Heart Rate Turbulence. This program takes average of 17 beats after detecting of PVC. And then measure the HRT. load pvcecg ecg = pvcecg(:,1); figure; plot(ecg) fs = 200; % sampling rate N = length (ecg ); t = [0:N-1]/fs; n2 = 1:N; 1.5

1

0.5

0

-0.5

0.5

1

1.5

2

2.5

3

3.5

4 4

x 10

% 'k' is a vector of indices into the vector 'ecg ' k = BeatDetection(ecg ); k=find(k); % Calculate beat detection results Number_beats_detected = length(k); QRS_Locations = t(k); Average_interbeat_interval = mean ( diff ( QRS_Locations )); % in Seconds Heart_rate = 60/ Average_interbeat_interval ; % in Beats per minute fprintf ('\n ECG BEAT DETECTION RESULTS \n') fprintf ('\n%d beats detected.\n\n', Number_beats_detected ) fprintf ('Averate interbeat interval = %f seconds.\n\n', Average_interbeat_interval ) fprintf ('Heart rate = %f beats per minute.\n',Heart_rate ) figure plot (t(n2),ecg (n2), QRS_Locations ,min (ecg ),'r.');

% axis ([t((1)) t(N) 1000 max(ecg(n2))]) axis tight xlabel ('TIME ( SECONDS )'); box off figure; RR = diff(QRS_Locations )*1000; clf pp = plot (t(n2),ecg (n2), QRS_Locations ,min(ecg )*( ones (1, Number_beats_detected )), 'r^'); % set (pp (2) , 'MarkerSize ' ,5,' MarkerFaceColor ','r') % axis ([t(n2(1)) t(n2(end )) 1000 max(ecg (n2 ))]) xlabel ('TIME ( SECONDS )'); box off i = ( find (( n2(1) <= k) & (k <= n2(end )))); for m = 1:length(i)-1 tt = text ((t(k(i(m )))+ t(k(i(m +1))))/2 , min(ecg ), num2str( round(RR(i(m ))))); % set(tt ,' HorizontalAlignment ','Center ') end

1.5

1

0.5

0

-0.5

1275

1315

875

1815

1325

1275

1240

1255

1235

1315

1350

1330

1295

-1 24

26

28

% find PVC beat from ECG for i=1:1:length(RR)-1 Ratio(i) =RR(i+1)/RR(i); if Ratio(i)>1.5 PVC(i)=(i); end end pvc=find(PVC)+1 start=pvc-3; for i=1:1:length(start) sq=RR(start(i):start(i)+15); if i <=1 avg1=sq; end

30

32 TIME ( SECONDS )

34

36

38

40

avg1 =(avg1+sq)/2; end figure; t=1:1:length(avg1); plot(t,avg1,t,avg1(t),'r.') axis tight %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation of all R-R interval %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% R_p1=4; R_p2=R_p1+1; R_p3=R_p2+1; R_n1=4-2; R_n2=R_n1-1; R_n3=R_n2-1; RR_p1=avg1(R_p1) ; RR_p2=avg1(R_p2); RR_p3=avg1(R_p3); RR_n1=avg1(R_n1); RR_n2=avg1(R_n2); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation for Turbulance Onset %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TO_p=(RR_p2+RR_p3); TO_n= (RR_n1+RR_n2); TO= ((TO_p-TO_n)/TO_n)*100; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation for Turbulance Slope %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% mslope=0; for j=5:1:11; p=polyfit(t(j:j+5),avg1(j:j+5),1); Yev=polyval(p,t(j:j+5)); hold on plot( t(j:j+5),Yev,'g') slope(j)=(Yev(end)-Yev(1))/(t(j+5)-t(j)); if slope(j)>mslope mslope=slope(j); loc=j; end

end maxslope=max(slope); hold on p=polyfit(t(loc:loc+5),avg1(loc:loc+5),1); Yev=polyval(p,t(loc:loc+5)); plot( t(loc:loc+5),Yev,'k') hold on tt = text(4,1.2*min(RR),num2str(TO)); set(tt,'VerticalAlignment',' top') tt = text(4,1.2*min(RR),num2str(mslope)); set(tt, 'verticalAlignment','bottom ','color','red') fprintf(' TO : %f \n ' ,TO) fprintf('Maximum TS :%f \n',mslope) 1800

1700

1600

1500

1400

1300

1200

1100

1000 9.4308 5.5126

900

2

4

6

8

10

12

14

16

1400

1350

1300

1250

2

4

6

>> ECG BEAT DETECTION RESULTS 166 beats detected. Averate interbeat interval = 1.301818 seconds. Heart rate = 46.089385 beats per minute. pvc = 4

22 55

69

91 124 138

TO: 5.512614 Maximum TS: 9.430804

8

10

12

14

16

Program_2: Here this data from patient no.109 with only 2 PVC beat. Here instead of doing average of RR after PVC count HRT. For each RR at PVC so at least we can see the different TO and TS. clc clear all close all load pvc_109 ecg = pvc_109(:,1); figure; plot(ecg) fs = 200; % sampling rate N = length (ecg ); t = [0:N-1]/fs; n2 = 1:N; 1.5

1

0.5

0

-0.5

-1

-1.5

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

% 'k' is a vector of indices into the vector 'ecg ' k = BeatDetection(ecg ); k=find(k); % Calculate beat detection results Number_beats_detected = length(k); QRS_Locations = t(k); Average_interbeat_interval = mean ( diff ( QRS_Locations )); % in Seconds Heart_rate = 60/ Average_interbeat_interval ; % in Beats per minute fprintf ('\n ECG BEAT DETECTION RESULTS \n') fprintf ('\n%d beats detected.\n\n', Number_beats_detected ) fprintf ('Averate interbeat interval = %f seconds.\n\n', Average_interbeat_interval ) fprintf ('Heart rate = %f beats per minute.\n',Heart_rate ) figure plot (t(n2),ecg (n2), QRS_Locations ,min (ecg ),'r.'); % axis ([t((1)) t(N) 1000 max(ecg(n2))]) axis tight xlabel ('TIME ( SECONDS )');

2

box off figure; RR = diff(QRS_Locations ); clf pp = plot (t(n2),ecg (n2), QRS_Locations ,min(ecg )*( ones (1, Number_beats_detected )), 'r^'); % set (pp (2) , 'MarkerSize ' ,5,' MarkerFaceColor ','r') % axis ([t(n2(1)) t(n2(end )) 1000 max(ecg (n2 ))]) xlabel ('TIME ( SECONDS )'); box off i = ( find (( n2(1) <= k) & (k <= n2(end )))); for m = 1:length(i)-1 tt = text ((t(k(i(m )))+ t(k(i(m +1))))/2 , min(ecg ), num2str( round(1000*RR(i(m ))))); % set(tt ,' HorizontalAlignment ','Center ') end 1.5

1

0.5

0

-0.5

-1

-1.5 1270 3

1035 4

1520 5

6

1200 7

1235 8

1235 9

1305 10

11

% find PVC beat from ECG for i=1:1:length(RR)-1 Ratio(i) =RR(i+1)/RR(i); if Ratio(i)>1.3 PVC(i)=(i); end end pvc=find(PVC)+1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation of all R-R interval %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for i=1:1:length(pvc) R_p1(i)=pvc(i); R_p2(i)=R_p1(i)+1; R_p3(i)=R_p2(i)+1; R_n1(i)=pvc(i)-2; R_n2(i)=R_n1(i)-1;

R_n3(i)=R_n2(i)-1; RR_p1(i)=RR(R_p1(i)) ; RR_p2(i)=RR(R_p2(i)); RR_p3(i)=RR(R_p3(i)); RR_n1(i)=RR(R_n1(i)); RR_n2(i)=RR(R_n2(i)); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation for Turbulance Onset %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for i=1:1:length(pvc) TO_p(i)=(RR_p2(i)+RR_p3(i)); TO_n(i)= (RR_n1(i)+RR_n2(i)); TO(i)= ((TO_p(i)-TO_n(i))/TO_n(i))*100; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation for Turbulance Slope %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RR=RR*1000; Rd=diff(RR); figure; t=1:1:length(RR); plot(t,RR,t,RR(t),'r.') axis tight for i=1:1:length(pvc) ; for j=pvc(i)+1 :1:pvc(i )+18 RD(i,j)=Rd(j); end end for i=1:1:length(pvc) ; % mslope=0; for j=pvc(i)+1 :1:pvc(i )+13 p=polyfit(t(j:j+5),RR(j:j+5),1); Yev(i,:)=polyval(p,t(j:j+5)); hold on plot( t(j:j+5),Yev(i,:),'g') slope(j)=(Yev(i,end)-Yev(i,1))/(t(j+5)-t(j)); end mslope(i)=0;

k=pvc(i)+1; for l=1:1:12 p=k+l; if slope(p)>mslope(i) mslope(i)=slope(p); loc=p; end end maxslope=max(slope); hold on p=polyfit(t(loc:loc+5),RR(loc:loc+5),1); Yev=polyval(p,t(loc:loc+5)); plot( t(loc:loc+5),Yev,'k') end for m = 1:length(pvc) tt = text(pvc(m), 1.1* min(RR),num2str(TO(m))); set(tt,'VerticalAlignment',' top') end for m = 1:length(pvc) tt = text(pvc(m) ,1.1*min(RR),num2str(mslope(m) )); set(tt, 'verticalAlignment','bottom ','color','red') end % close all fprintf(' TO : %f \n ' ,TO) fprintf('Maximum TS :%f \n',mslope) 1550

1500

1450

1400

1350

1300

1250

1200

1150 25.2857 -5.2529

17.8571 6.6937

1100

1050 5

10

15

20

25

30

35

40

45

1360

1340

1320

1300

1280

1260

1240

1220

1200

1180 5

10

15

20

>> ECG BEAT DETECTION RESULTS 85 beats detected. Averate interbeat interval = 1.271726 seconds. Heart rate = 47.179967 beats per minute. pvc = 5

27

TO : -5.252918 TO : 6.693712 Maximum TS :25.285714 Maximum TS :17.857143

25

30

35

40

45

Conclusion: Here the algorithm Heart rate turbulence measurement works well after taking average of RR or without taking average. As well it is easily detected difference in TO and TS in second program. And it will work well after averaging higher amount of data.

Reference: 1. Clifford, G.D., ECG Data Analysis. Vol. Chapter-3:ECG Statistics, Noise, Artifacts, and Missing Data 2. Georg Schmidt, R.S.a.P.B., Heart Rate Turbulence. Cardiac Electrophysiology Review 1999;3:297–301. CEPR 1999; Vol. 3, No. 4. 3. Mari A. Watanabe, J.E.M., Robert Sheldon and Mark E. Josephson, Effects of Ventricular Premature Stimulus Coupling Interval on Blood Pressure and Heart Rate Turbulence. Circulation is published by the American Heart Association. 4. Mari A. Watanabe, M., PhD, Review Article:Heart Rate Turbulence: a Review. 5. Nathan M. Segerson, M., Stephen L. Wasmund, PhD., Moeen Abedin, MD., Rakesh K. Pai, MD., Marcos Daccarett, MD., Nazem Akoum, MD., T. Scott Wall, MD., Richard C. Klein, MD., Roger A. Freedman, MD., and Mohamed H. Hamdan, MD., Heart Rate Turbulence Parameters Correlate with Post-PVC Changes in Muscle Sympathetic Activity. Heart Rhythm. 2007 March ; 4(3): 284–289. 6. Nathan M. Segerson, M., Stephen L. Wasmund, PhD.,(E. Staff), Heart Rate Turbulence Parameters Correlate with Post-PVC Changes in Muscle Sympathetic Activity. Heart Rhythm. 2007 March ; 4(3): 284–289. 7. R Mrowka', P.P., H Theres2, A Patzak, Mechanism of Heart-Rate Turbulence. IEEE Computers in Cardiology 2000. 8. http://www.pubmedcentral.nih.gov/picrender.fcgi?artid=1865126&blobtype=pdf 9. http://mathworld.wolfram.com/LeastSquaresFitting.html 10. http://oregonstate.edu/~peterseb/mth351/docs/351u2002_matlab_least_squares.html