Authors: Richard Singhathip, SiHui Yang, Maysam
Abbod, JiannShing Shieh (20090527);
recommended: JiannShing Shieh, YehLiang Hsu(20090708).
Extracting Respiration Rate from ECG Raw Signals
This paper
describes a method for extracting respiration rate from ECG raw signals. The
method has been tested on 26 voluntary subjects and the respiration times
obtained have been compared with the respiration rate acquired from Philips Physiological
Monitor (MP60). This technique is applicable to any type of automated ECG
analysis, in realtime and without the need of additional hardware.
1.
Introduction
The knowledge of
respiration associated to the electrocardiogram (ECG) can be useful health monitoring
in daily life. For example, it is used for differentiating obstructive from
central and complex sleep apnea [1] or assessing
cardiopulmonary coupling during sleep [2]. Moreover it is used for
understanding the clinical significance of certain cardiac arrhythmias.
There are many
respiration recording techniques and the choice is tied to the type of
pathology given to study. Devices such as spirometers [3] and nasal thermocouples
[4] measure air flow into and out of the lungs directly, carrying out
careful and accurate measures. However, the devices can interfere with
respiration. The breathing can also be recorded indirectly by measures of the
variation of body volume. For this purpose, the transthoracic inductance and
impedance plethysmographs [5], wholebody
plethysmographs [6], strain gauge measurement of
thoracic circumference and pneumatic respiration transducers are utilized. All
these methods require dedicated devices too.
ECGDerived
Respiration Monitoring Method [7] gives almost the same
results without the need of dedicated devices. This method only needs
threelead ECG. The method proposed here finds respiration rate from ordinary
ECGs. It is a technique of signal analyzing and it does not require any
dedicated devices. This method is particularly useful in situation where the
ECG is the only available data source.
2. Methods and Algorithms
Figure 1 shows
the sequential steps of the method. From ECG raw signals collected by the MP60,
we extract the RR maxima and the RR intervals. These data are saved in 2
vectors and plotted each vector. Then, the result of each curve with many
maxima can be calculated easily. By comparing with the respiration rate given
by the MP60, we can affirm that each maximum corresponds to a respiration
cycle. Details of these steps are described as follows.
Figure 1. Sequential steps of the method
2.1 The RR maxima and RR interval extraction from raw ECG signals
Nowadays, there
are many algorithms which have been implemented in order to detect the QRS
peaks in an ECG waveform (Figure 2) [8]. The concept for this
algorithm was taken from Gustafson [9]. The first derivative is
calculated at each point of the ECG:
_{} (1)
The first
derivative array is then searched for points which exceed a constant threshold _{}. Then the next three derivative values _{}, _{}, and _{} must also exceed
0.15. If the above conditions are met, point i can be classified as a QRS candidate if the next two sample points
have positive slope amplitude products, that is, both _{} and _{} are positive.
Fig. 2 Definition of RR Maxima (Rk) and RR
Interval (RRk) from ECG signal
After that we
obtain RR maxima, it is easy to calculate the RR intervals by subtracting the
corresponding time Tk of the RR maxima as shown in Figure 2.
2.2. Variation of RR maxima and RR intervals plots
After saving the
RR maxima and the RR intervals into two vectors, we plot them and count the
maxima of their variation with an algorithm (Figure 3). We can see the peaks
clearly so we do not need a very complicated algorithm to extract them. However,
although the plot of the RR maxima variation seems clear, the plot of RR
intervals variation gives better results particularly in apnea case. Actually,
we do not use RR maxima variation because we can not detect the apnea
condition and it is more sensitive to noise (Figure 4). Hence, in this paper, the
variation of RR intervals were used in the rest parts.
Figure 3. (a)Variation of RR
maxima; (b)Variation
of RR Intervals
Figure 4. Variation of RR maxima in apnea case
2.3. Three methods to filter curve in apnea case
In apnea case (Figure
4), particularly during the breath held, the curve needs to be filtered as
shown in the inside curve of rectangular shape in the Figure 5(a). For this
purpose, we propose three methods and have implemented the algorithms using RR
interval variation as follows:
Method 1:
In order
to reduce the sensitivity of the curve, we apply the principle of “moving
average” of every 5 values according to their standard deviation. We choose the
value close to 0.0025. Then, we extract the maxima (Figure 5(b)).
Method 2:
It
consists to extract from the variation of RR intervals plot, the significant
maxima according to a threshold value equal to 0.0020 (Fig. 5(c)).
Method 3:
It is a
mix of methods 1 and 2. First, we apply the principle of “moving average” of
every 5 values according to their standard deviation (0.0025) then we extract
the significant maxima according to a threshold value (0.0020) (Fig. 5(d)).
(a) (b)
(c) (d)
Figure 5. (a)Variation of RR intervals in apnea
case; (b)Variation of RR intervals with method 1; (c)Variation of RR
intervals with method 2; (d)Variation of RR intervals with method 3
3. Experiment Conditions
The method has
been tested on 26 voluntary subjects (16 men and 10 women, aged 19 to 28 years)
and the respiration times obtained have been compared with the respiration rate
acquired from Philips Physiological Monitor (MP60).
For short time
data recording, we collect ECG data and respiration times at the same time via
MP60. We can also check it with the waveform recorded by the MP60. For longer
data recording, the MP60 gives us the respiration rate average every 5 seconds.
With all this information gathered, we know the real respiration rate of the
subject and can compare them with our results.
For the first
experiment, we just collect ECG data from 10 volunteers during about 5 minutes.
The persons are awakened and sit on a chair. Our purpose is to find if there is
a relation between RR maxima and RR intervals extracted from ECG signal and
the respiration. Then we want to compare the variation of RR maxima and of RR
intervals results with the real respiration rate.
For the second
experiment, 6 volunteers are in the same conditions as the first experiment.
They breathe about 5 minutes but they stop breathing in the middle to simulate
apnea for 35 seconds to 1 minute. This experiment helps us to prove that the
respiration is linked to the variation of RR intervals. After filtering the
curve with three methods, we compare the results with the real respiration
rate.
For this
experiment, we collect ECG data from 5 men and 5 women during 30 to 80 minutes.
During this time, the subjects are asked to take a nap. Our purpose is to prove
that the method works for longer and stable data. We compare our results with
the respiration rate given the MP60.
4. Experiment Results
In this study,
the only data we need are ECG and respiration rate recorded by the MP60. At
first, we can check the first step of our method: the RR maxima and RR
intervals extraction. For an adult, the normal heart rate is between 60 and 100
beats per minute and a little less when the person is sleeping. The normal
respiration rate is between 12 and 20 times per minute. If all this information
is verified, we can compare our method results with the real respiration rate
given by the MP60.
The results of
this experiment (Table 1)
show that the number of the variation of RR intervals instead of RR maxima is
close to the number of the respirations counted from MP60. It means that the
variation of RR intervals can give us the real respiration rate. Furthermore,
the plot of the results on Figure 6 also shows us that the results are better if we use RR intervals instead of
RR maxima. That is why, for the next experiments, we will
only use the variation of RR intervals.
Moreover, the
method of variation of RR interval is quite accurate according to the Receiver
Operating Characteristic (ROC) curves [11]. We evaluate accuracy of our method
in experiment I as shown in Table 2. Both the sensitivity and specificity are
over 96%.
Table 1. Experiment I Results
No.

Gender / Age

Record time (min)

HR average (bpm)

No. of Resp. from MP60

Variation of RR maxima

Variation of RR interval

1

F / 20

3.5

84

76

91

73

2

M / 24

4.7

74

40

56

41

3

M / 24

5.0

78

43

92

54

4

M / 23

4.7

74

81

81

84

5

F / 20

4.8

86

60

117

60

6

M / 20

4.8

73

60

61

64

7

M / 20

4.8

55

75

77

74

8

F / 20

5.5

53

100

101

98

9

M / 23

5.2

74

116

110

111

10

M / 22

4.5

83

83

104

83


Average
± SD

73.7±22.5

89.0±19.2

74.2±19.8


p value


0.0479

0.5850

Table 2. Experiment I Method Accuracy
No.

Total HR No.

No. of Resp from MP60

Variation of RR interval

Sensitivity
(%)

Specificity
(%)

Accuracy
(%)

TP

FN

FP

TN

1

295

76

73

0

3

222

100

98.7

98.9

2

347

40

36

5

4

306

87.8

98.7

97.4

3

389

43

43

9

2

335

82.7

99.4

97.2

4

351

81

81

3

0

267

96.4

100

99.1

5

411

60

60

0

0

351

100

100

100

6

351

60

60

4

0

287

93.8

100

98.9

7

264

75

74

0

1

189

100

99.5

99.6

8

290

100

98

0

2

192

100

99.0

99.3

9

387

116

111

0

5

276

100

98.2

98.7

10

372

83

83

0

0

289

100

100

100


Average ± SD

96.1±5.9

99.4±0.6

98.9±0.9

Figure 6. Comparison of the filtering methods in
experiment l
4.2 Experiment II Results
The results of
this experiment with apnea (Table 3) are also close to the number of the
respirations counted whatever the filtering method utilized as it is shown in
Figure 7. The parameters of each method are the same in each case. We notice
that we could get better results by adjusting the parameters in method 3. The
variation of RR intervals plot and these results prove us that the respiration
is linked to the variation of RR intervals. The sensitivity, the specificity and
accuracy average in this case are between 88% and 100%. It is shown in Table 4.
Table 3. Experiment II Results
No.

Gender /Age

Record time (min)

HR avg (bpm)

Apnea time (s)

No. of Resp. from MP60

Variation of RR interval (method 1)

Variation of RR interval (method 2)

Variation of RR interval (method 3)

1

F / 20

4

81

35

45

54

48

46

2

F / 20

3.2

69

60

46

54

47

44

3

M / 22

3.7

75

48

64

66

70

58

4

M / 24

3

70

41

36

42

35

33

5

M / 23

2.8

71

32

36

42

37

34

6

M / 24

4.4

72

50

67

72

66

52


Average ± SD

49.0±12.3

55.0±11.2

50.5±13.3

44.5±9.0


p value


0.0018

0.2264

0.1067












Table 4(a). Experiment II Method 1 Accuracy
No.

Total HR No.

No. of Resp. counted from MP60

Variation of RR interval

Sensitivity
(%)

Specificity
(%)

Accuracy
(%)

TP

FN

FP

TN

1

325

45

45

9

0

271

83.3

100

97.2

2

220

46

46

8

0

166

85.1

100

96.4

3

278

64

64

2

0

212

96.9

100

99.3

4

210

36

36

6

0

168

85.7

100

97.1

5

199

36

36

6

0

157

85.7

100

97.0

6

316

67

67

5

0

244

93

100

98.4


Average ± SD

88.3±4.9

100±0.0

97.6±1.0

Table 4(b). Experiment II Method 2 Accuracy
No.

Total HR No.

No. of Resp. from MP60

Variation of RR interval

Sensitivity
(%)

Specificity
(%)

Accuracy
(%)

TP

FN

FP

TN

1

325

45

44

4

1

277

91.6

99.6

98.5

2

220

46

41

6

5

173

87.2

97.2

95.1

3

278

64

64

6

0

208

91.4

100

97.8

4

210

36

33

2

3

175

94.3

98.3

97.7

5

199

36

35

1

1

162

97.2

99.4

99.0

6

316

67

63

0

4

250

100

98.4

98.7


Average ± SD

93.6±4.2

98.8±1.0

97.8±1.3

Table 4(c). Experiment II
Method 3 Accuracy
No.

Total HR
No.

No. of
Resp. from MP60

Variation
of RR interval

Sensitivity
(%)

Specificity
(%)

Accuracy
(%)

TP

FN

FP

TN

1

325

45

44

2

1

279

95.6

99.6

99.1

2

220

46

42

2

4

176

95.4

97.8

97.3

3

278

64

58

0

6

220

100

97.3

97.9

4

210

36

31

0

5

177

100

97.2

97.7

5

199

36

34

0

2

165

100

98.8

99.0

6

316

67

52

0

15

264

100

94.6

95.5


Average ±
SD

98.5±2.1

97.6±1.6

97.8±1.2

Figure 7.
Comparison of the filtering methods
4.3. Experiment III
Results
The results of
this experiment (Table 5) confirm that the method definitively works at normal
persons no matter the ECG recording time. The respiration rate calculated by Experiment
I method is very close to the respiration rate average given by the MP60 as
shown in Figure 8. Therefore, the method from Experiment I still gives good
results for longer and stable normal person data.
Table 5. Experiment III Results
No.

Gender
/age

Record time (min)

HR average (bpm)

Resp. MP60

Resp. average (/min)

Avg. (/min)

Std. dev.

1

M / 22

66.4

55.7

15.8

1.5

16.0

2

M / 23

38.2

63.0

18.0

2.8

16.2

3

M / 24

46.4

56.4

17.3

1.9

16.8

4

M / 22

31.3

71.6

19.6

2.3

18.7

5

M / 23

77.0

60.0

16.0

1.6

15.8

6

F / 28

38.7

95.1

15.9

3.0

17.6

7

F / 22

50.4

85.6

14.5

1.8

15.2

8

F / 19

51.7

83.9

20.6

1.8

21.4

9

F / 20

35.1

67.6

12.5

1.7

13.1

10

F / 23

34.3

61.7

18.4

2.5

18.7


Average + SD

16.9±2.3


17.0±2.2


p value



0.7796










Figure 8.
Comparison of the respiration rate calculated by the method and given by the
MP60
5. Discussion and Conclusions
We discover
another method to find respiration rate from ECG raw signal. At the moment,
this method is limited to normal persons but we hope that it will works on
patients in surgery. The results obtained have been shown to be correlated with
respiration.
To summarize, we
have good results in this study concerning experiments at normal persons but not at
patients. In this research, we analyze the variation of RR intervals because
the results are better. Actually, the use of RR maxima or RR
intervals depends on the algorithm chosen for detecting QRS peaks in an ECG waveform. But normally, the RR maxima are more
sensitive to noise and we can see it in the apnea experiment. Therefore, 3
methods are utilized to filter the curve. The methods 1 and 2 have one
parameter and the method 3 has two parameters. For this experiment, we fix the
parameters value and we can get better results by analyzing each case. So, we
can improve the method concerning the detection of apnea especially that we
notice that the variation of RR intervals shows the respiration status.
Moreover, the experiment III results validate the method. The numbers shown in
the Table 5 are quite consistent. Indeed, the lower the standard deviation, the
more the subject is sleeping well during longer time and so the more results
are better. Furthermore, we notice that the more the volunteer does not move
the better the results are. So the method will not work on moving persons. Actually
in this case, even the commercial product of MP60 can not records data well
either.
On the other
hand, the method can not be applied to patients. The variation of RR intervals
is not clear enough to find respiration cycles with our algorithm due to noise.
For example, when the doctor used electric knife to stop bleeding, the patient’s
ECG signal will be affected by electric knife. So in a future work, we need to
design a smart and intelligent algorithm for detecting patients’ respiration
during surgical operation under artificial ventilation.
The advantages
of this method are to utilize the existing hardware to obtain additional
information without the need of extra devices. This method is particularly
useful in situation where the ECG is the only available information source
(like a Holter recording). To conclude, this method can really provide a basis
for estimating respiration rate and for detecting apneas.
6. References
[1] R. J. Thomas, J. E.
Mietus, C. K. Peng, G. Gilmartin, R. W. Daly, A. L. Goldberger, D.
J. Gottlieb, “Differentiating Obstructive from Central and Complex Sleep Apnea Using an
Automated ElectrocardiogramBased Method,” SLEEP, Vol. 30, No. 12, 2007.
[2] R. J. Thomas, J. E.
Mietus, C. K. Peng, A. L. Goldberger, “An ElectrocardiogramBased
Technique to Assess Cardiopulmonary Coupling During Sleep,” SLEEP, Vol. 28, No. 9, 2005.
[3] B. A. Ali., Y. M. Abro, N. H. Javed, M. S. Islam, “Standardization
of Different Spirometers,” Respiration ISSN 00257931
CODEN RESPBD, 2007.
[4] M. K. Marks, M. South, B. G. Carter, “Measurement of Respiratory
Rate and Timing Using a Nasal Thermocouple,” Journal of Clinical Monitoring and Computing, Vol. 11, No. 3, 1994.
[5] K. P. Cohen, J. G. Webster, J. Northem, Y. H. Hu, W. J.
Tompkins, “Breath Detection Using Fuzzy Sets and Sensor Fusion,” 0780320506/94 IEEE, 1994’
[6] M. D. Goldman, H. J. Smith, W. T. Ulmer, ”WholeBody Plethysmography,” Eur. Respir. Mon, 31, 15–43, 2005.
[7] B. Mazzanti, C. Lambertil, J. de Bie, “Validation of an
ECGDerived Respiration Monitoring Method,” Computers
in Cardiology, 2003.
[8] G. M. Friesen, T. C. Jannett, M. A.
Jadallah, S. L. Yates, S. R. Quint, H. T. Nagle, “A Comparison of the Noise
Sensitivity of Nine QRS Detection Algorithm,” IEEE Transactions on biomedical engineering, Vol.37, No.1, 1990.
[9] D. Gustafson, “Automated VCG
interpretation studies using signal analysis techniques,” R1044 Charles Stark
Draper Lab., Cambridge,
1977
[10] P. F. Shi, “HilbertHuang
Transform Analysis Applied to the patients’ Blood flow variability and Heart
rate variability during surgery,” MS Thesis from Dept. of Mechanical Engineering, Yuan Ze
University. July 2008.
[11] T. A. Lasko, J. G. Bhagwat, K. H. Zou, L. OhnoMachado, “The Use of
Receiver Operating Characteristic Curves in Biomedical Informatics,” A Journal of Biomedical Informatics 38,
404–415, 2005.