Chapter 7 NonlinearAnalysisfortheECG...

13
Chapter 7 Nonlinear Analysis for the ECG and Blood Pressure Signals Contents 7.1 Introduction: ............................ 65 7.2 Theory and Overview of the Method: ............. 65 7.3 Finding Peak Location: ...................... 68 7.4 Arranging the known Part of Each Signal in the Form of a Matrix: ............................... 70 7.5 Computing Generalized Inverse: ................ 72 7.6 Predicting the Unknown Parts of ECG and Blood Pressure Signals : ............................... 73 7.6.1 Predicting Blood Pressure Signal: ............... 73 7.6.2 Predicting ECG Signal: ..................... 75 7.7 Error Calculation: ......................... 76 7.8 Conclusion: ............................. 77 7.1 Introduction: The goal of this chapter is to formulate some equations that connect two data sets, namely, ECG and blood pressure. We have developed a non-linear model for ECG and blood pressure signals and used this model successfully to predict one from the other. Assuming that pumping of heart is a system and the blood pressure of human body is an output of the system, we have established a cause and effect relationship between these two systems.Pumping of the heart is the cause and blood pressure is its result. But what could be the exact relationship between the two? We have unambiguously explained how to show a relationship between ECG and blood pressure by introducing certain equations. 7.2 Theory and Overview of the Method: Suppose EC stands for the ECG signal and BP represents the blood pressure signal (fig 7.1, fig 7.2). Let us consider the area between the 100th and the 200th peak of the ECG signal. Let us call it A2. B2 covers the area between the 700th and the

Transcript of Chapter 7 NonlinearAnalysisfortheECG...

Page 1: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

Chapter 7

Nonlinear Analysis for the ECGand Blood Pressure Signals

Contents7.1 Introduction: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657.2 Theory and Overview of the Method: . . . . . . . . . . . . . 657.3 Finding Peak Location: . . . . . . . . . . . . . . . . . . . . . . 687.4 Arranging the known Part of Each Signal in the Form of a

Matrix: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707.5 Computing Generalized Inverse: . . . . . . . . . . . . . . . . 727.6 Predicting the Unknown Parts of ECG and Blood Pressure

Signals : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737.6.1 Predicting Blood Pressure Signal: . . . . . . . . . . . . . . . 737.6.2 Predicting ECG Signal: . . . . . . . . . . . . . . . . . . . . . 75

7.7 Error Calculation: . . . . . . . . . . . . . . . . . . . . . . . . . 767.8 Conclusion: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

7.1 Introduction:

The goal of this chapter is to formulate some equations that connect two data sets,namely, ECG and blood pressure. We have developed a non-linear model for ECGand blood pressure signals and used this model successfully to predict one fromthe other. Assuming that pumping of heart is a system and the blood pressureof human body is an output of the system, we have established a cause and effectrelationship between these two systems.Pumping of the heart is the cause and bloodpressure is its result. But what could be the exact relationship between the two?We have unambiguously explained how to show a relationship between ECG andblood pressure by introducing certain equations.

7.2 Theory and Overview of the Method:

Suppose EC stands for the ECG signal and BP represents the blood pressure signal(fig 7.1, fig 7.2). Let us consider the area between the 100th and the 200th peak ofthe ECG signal. Let us call it A2. B2 covers the area between the 700th and the

Page 2: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

66Chapter 7. Nonlinear Analysis for the ECG and Blood Pressure Signals

Figure 7.1: Predicting blood pressure from ECG: EC stands for the ECG signaland BP represents the blood pressure signal. A2 is the area between the 100th andthe 200th peak of the ECG signal. B2 covers the area between the 700th and the800th peak of the ECG signal. Similarly, the blood pressure signal A5 covers thearea between the 100th and the 200th peak. B5 covers the area between the 700thand the 800th peak. We want to predict B5 from A2, B2 and A5.

Page 3: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

7.2. Theory and Overview of the Method: 67

Figure 7.2: Predicting ECG from blood pressure: we want to predict B2 from A2,A5 and B5.

Page 4: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

68Chapter 7. Nonlinear Analysis for the ECG and Blood Pressure Signals

800th peak of the ECG signal. Similarly, for the blood pressure signal A5 coversthe area between the 100th and the 200th peak. B5 covers the area between the700th and the 800th peak. Physiologically, ECG and blood pressure are intertwined.So there exists a non-linear relationship between A2 and A5 and between B2 andB5 as well. By using Taylor’s theorem one can show that in a small neighbourhoodnonlinear functions lead to affine maps. Hence we find an affine relationship betweenA5 and B5 and between A2 and B2 as well. So if B5 is unknown we can predict itfrom A2, B2 and A5. Similarly if B2 is unknown we can predict it from A2, A5 andB5.

7.3 Finding Peak Location:

Our first step is to determine the location of the peaks in the ECG signal. Wefollow the same method that was discussed in 6.1. Figure 7.3 shows the time seriesof blood pressure and figure 7.4 shows the time series of ECG (channel 2). Bothof these signals are of an ICU patient (ref. Physionet challenge 2010). Figure 7.5

Figure 7.3: Time series of the blood signal signal

shows the ECG and BP signals together. The red one is the ECG signal and theblue one is the BP signal.

Page 5: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

7.3. Finding Peak Location: 69

Figure 7.4: Time series of the ECG(channel 2) signal

Figure 7.5: Plotting ECG and blood pressure signals simultaneously

We see that there is a correspondence between the peaks of the ECG and BPsignals. Between any two consecutive peaks of the BP signal, there is a peak of theECG signal.

We assume that we know the full data of ECG. Numerically we compute thelocation of the peaks of the ECG signal. Figure 7.6 shows the peaks of EC. Thedistance between any two consecutive peaks in EC is called the R-R interval. Infigure 7.7 we plot the nth R-R interval against the (n+1)th R-R interval.

Page 6: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

70Chapter 7. Nonlinear Analysis for the ECG and Blood Pressure Signals

Figure 7.6: Peaks of the ECG signal

Figure 7.7: nth R-R interval vs. (n+1)th R-R interval

7.4 Arranging the known Part of Each Signal in theForm of a Matrix:

We know the peak locations of the whole EC. First let us construct A2. We considerbetween the 100th peak and the 200th peak of the EC signal. We collect all the datapoints between 60 points before the 100th peak up to 60 points after the 200th peak(as shown in fig 7.8). Now we construct a matrix AA2 out of these data points.

We pick 60 points before the 100th peak and 60 points after the 100th peak andcreate the first column of AA2 (as shown in fig 7.8). Similarly we pick 60 pointsbefore the 101th peak and 60 points after the 101th peak to create the secondcolumn. We continue it up to the 200th peak. So each column in AA2 consists of60 points before and 60 points after a specific peak. Now we subtract the row meanfrom AA2 and create the A2 matrix.

Page 7: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

7.4. Arranging the known Part of Each Signal in the Form of a Matrix:71

Figure 7.8: Creating the matrix AA2: we collect all the data points between 60points before the 100th peak up to 60 points after the 200th peak for constructingthe matrix AA2. We pick 60 points before the 100th peak and 60 points after the100th peak and create the first column of AA2. Similarly we pick 60 points beforethe 101th peak and 60 points after the 101th peak to create the second column.

Page 8: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

72Chapter 7. Nonlinear Analysis for the ECG and Blood Pressure Signals

We continue it up to the 200th peak. Red, blue and green arrows indicate the first,second and third columns of AA2 respectively.

Following the same procedure we construct B2. For B2 we consider the peaksthat range from 700 to 800 and follow the same method as described above.

For constructing A5 and B5 we do not consider any peak location. We look atthe data points which belong to AA2. If the first column of AA2 consists of P1thto Q1th data points of the signal EC, then we take P1th to Q1th data points ofthe signal BP to construct the first column of AA5. Similarly, if the nth column ofAA2 consists of Pn th to Qn th data points of EC, then we take Pn th to Qn thdata points of BP to construct the nth column of AA5. Once AA5 is constructed,we subtract the row mean from AA5 and create A5.

In the same way we construct B5 by considering the data points of BB2.

7.5 Computing Generalized Inverse:

Here we calculate the generalized inverse of A2 and A5. The singular values of A2are quite small after 50. So we assign zero to the diagonal elements of WI after the50th column. For A5, we consider the first 15 singular values since the rest of themare nearly zero. In figure 7.9, S2 represents the singular values of A2 and in figure7.10, S5 represents the singular values of A5.

Figure 7.9: Singular values of A2

Page 9: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

7.6. Predicting the Unknown Parts of ECG and Blood Pressure Signals: 73

Figure 7.10: Singular values of A5

7.6 Predicting the Unknown Parts of ECG and BloodPressure Signals :

7.6.1 Predicting Blood Pressure Signal:

We use the formula A5 ∗ Inv(A2) ∗ B2 = B5 for predicting B5. We calculateA5 ∗ Inv(A2) ∗ B2 and denote the matrix as PredB5. We find that the first fewcolumns of PredB5 are nearly the same as the first few columns of B5. So we alignthe first few columns of PredB5 next to each other (as shown in fig 7.11) and thencompare it with the BP signal. We get the graph, shown in figure 7.12. In figure7.12, the red graph indicates the predicted blood pressure signal and the blue graphindicates the original blood pressure signal. In the same figure we note the differencebetween these two signals and conclude that the prediction is quite good.

Page 10: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

74Chapter 7. Nonlinear Analysis for the ECG and Blood Pressure Signals

Figure 7.11: Aligning first few columns of PredB5 next to each other

Page 11: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

7.6. Predicting the Unknown Parts of ECG and Blood Pressure Signals: 75

Figure 7.12: above: Plotting the predicted and the actual blood pressure signals;below: difference between predicted and actual blood pressure signals

7.6.2 Predicting ECG Signal:

For predicting B2, we use the formula A2 ∗ Inv(A5) ∗ B5 = B2. We denote A2 ∗Inv(A5) ∗ B5 as PredB2. We align the first few columns of PredB2 and compareit with the ECG signal. In figure 7.13, the red graph indicates the predicted ECGsignal and the blue graph indicates the original ECG signal. In the same figure wenote the difference between these two signals. We see that they almost agree witheach other.

Page 12: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

76Chapter 7. Nonlinear Analysis for the ECG and Blood Pressure Signals

Figure 7.13: above: Plotting the predicted and the actual ECG signals; below:difference between predicted and actual ECG signals

7.7 Error Calculation:

Let P be the prediction and T be the target signal. Let us define a function "Accu-racy" which determines how good our prediction is.

where N is the length of P and T . Residue is (P − T ).By using this formula we find that the accuracy of the ECG signal compared to

its prediction is 0.99263 and the accuracy of the BP signal compared to its predictionis 0.98846.

Page 13: Chapter 7 NonlinearAnalysisfortheECG andBloodPressureSignalsshodhganga.inflibnet.ac.in/bitstream/10603/7968/14/17_chapter7.pdf · Chapter7. NonlinearAnalysisfortheECGandBloodPressureSignals

7.8. Conclusion: 77

7.8 Conclusion:

We have come out with some equations by which one can establish an unambigu-ous relationship between the ECG and blood pressure signals. We have alreadyexplained that one can predict an unknown part of one signal from the other byusing these equations. Another important significance of this result is that it re-veals how this relationship between ECG and blood pressure varies from person toperson. One can make a detailed study of how ECG affects blood pressure basedon somebody’s physical activities and emotional state. For example, at the time ofheart attack blood pressure goes down. So this kind of analysis can predict someindication before heart attack.