Chapter 3 Integrated DOT/ECG/EEG Biomedical Multiprocessor for Portable Brain-Heart
3.2 Algorithm Discussion
3.2.2 Heart Rate Variability (HRV) Analysis
3.2.2.1 Background
Heart rate variability (HRV) is a normal physiological phenomenon where the interval between successive heart beats of an individual varies over time. The term “heart rate variability” has widely become the adopted term to describe the variations of both instantaneous heart rate and RR interval [33]. To understand the implications of HRV, the origins of the heart rate and HRV are first discussed.
In the human body, visceral functions are controlled by the autonomic nervous system (ANS). These functions include heart rate, digestion, perspiration, and respiration. While some actions such as breathing may be controlled through conscious thought, visceral functions are generally involuntary. This is in contrast to voluntary motor functions controlled by the somatic nervous system (SNS), which together with the ANS formulates the peripheral nervous system (PNS).
The ANS classically consists of two main systems: the parasympathetic nervous system and the sympathetic nervous system. The parasympathetic and sympathetic nervous systems can be seen as two opposing branches exerting opposite effects on various internal organs. The parasympathetic nervous system regulates a ‘resting’ mechanism and causes heart rate and blood pressure to decrease. The sympathetic nervous system, on the other hand, provides a ‘fighting’ mechanism which increases heart rate and blood flow to muscles. The complementary nature of the two nervous systems allows humans to rest when possible and to
24
react to mentally or physically stressful situations when required. The resulting state of the autonomic system due to influences of the sympathetic and parasympathetic nervous system has become known as the sympathovagal balance.
3.2.2.2 Motivation
As the heart rate is largely under the control of the ANS, variations in heart rhythm can reflect the influences of the parasympathetic and sympathetic nervous systems. Under resting conditions the level of activity of the parasympathetic nervous system, or vagal tone, prevails [34], and contributes to the high frequencies (HF) of HRV. Low frequencies (LF), on the other hand, can be associated with sympathetic activity which occurs in response to stress, exercise, and heart disease [21].
HRV has been shown to be an important indicator of cardiovascular health [33]. As the regulation mechanism of the heart is closely governed by the sympathetic and parasympathetic nervous systems, HRV is often used as a quantitative marker of the autonomic nervous system. Studies have shown that the HRV is an important indicator in many diseases and may contribute to a better treatment [21]. Applications of HRV have been applied to many forms of medical researches including studies in sleep apnea, patient monitoring after cardiac arrest [35], and use in intensive care units [36].
3.2.2.3 Discussion
In order to provide insight to the intrinsic periodicities of HRV, the use of spectral analysis is indicated since HRV is the result of super-imposed components relating to the ANS. Through spectral analysis the contributions of sympathetic and parasympathetic activity can be viewed in a much clearer perspective than time-domain analysis or geometrical methods. In this section, the algorithm employed to perform the HRV is presented in detail.
The HRV algorithm takes in raw ECG samples and outputs a time-frequency spectrum representing the heart rate variability, and comprises the following steps: 1) R-peak detection
based on Pan and Tompkins spectral analysis
3.2.2.3.1 R-peak
In consideration of architecture simplicity and real derivative-based QRS detection algorithm
Figure 3-4 summarizes the
differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
Differentiation is performed to identify the slope of the R wave in th the transfer function is
with the corresponding difference equation
After the derivative is calculated
of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS complex. The peak of the
Figure 3-5 shows the
3.2.2.3.2 RR i After the R between them. Figure
that the RR interval time series is formed as based on Pan and Tompkins
spectral analysis of the RR intervals peak detection
In consideration of architecture simplicity and real based QRS detection algorithm
summarizes the
differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
Differentiation is performed to identify the slope of the R wave in th the transfer function is
H
with the corresponding difference equation d;n= =1
8
After the derivative is calculated
of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS complex. The peak of the QRS complex
shows the progression of the algorithm towards detecting the R peak location
Figure interval calculation
After the R-peaks have been identified, the next step is to record the time intervals in Figure 3-6
that the RR interval time series is formed as based on Pan and Tompkins [37], 2) R
of the RR intervals using the Lomb periodogram etection
In consideration of architecture simplicity and real based QRS detection algorithm
summarizes the R-peak detection
differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
Differentiation is performed to identify the slope of the R wave in th
Hz =1 8 −
with the corresponding difference equation
2x;n= + x;
After the derivative is calculated
of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS QRS complex
progression of the algorithm towards detecting the R peak location
Figure 3-4 Flowchart for R alculation
peaks have been identified, the next step is to record the time intervals in illustrates t
that the RR interval time series is formed as AA = B,
25 , 2) R-peak to R
using the Lomb periodogram
In consideration of architecture simplicity and real based QRS detection algorithm based on
peak detection
differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
Differentiation is performed to identify the slope of the R wave in th
−2z !− z with the corresponding difference equation
;n − 1= − x After the derivative is calculated a squaring is
of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS QRS complex is identified as the R peak of the ECG data
progression of the algorithm towards detecting the R peak location
Flowchart for R
peaks have been identified, the next step is to record the time intervals in illustrates the time intervals between R
that the RR interval time series is formed as
, B!, BC, BD, BE
peak to R-peak (RR) interval calculation and 3) using the Lomb periodogram
In consideration of architecture simplicity and real based on Pan and Tom peak detection algorit
differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
Differentiation is performed to identify the slope of the R wave in th
+ z+ 2z
x;n − 3= − 2x squaring is performed
of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS is identified as the R peak of the ECG data
progression of the algorithm towards detecting the R peak location
Flowchart for R-peak detection
peaks have been identified, the next step is to record the time intervals in he time intervals between R
E, BG, … , BI
peak (RR) interval calculation and 3) using the Lomb periodogram [38].
In consideration of architecture simplicity and real-time properties, Pan and Tompkins
algorithm employed, comprising 1) differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
Differentiation is performed to identify the slope of the R wave in the QRS complex, of which
z!
2x;n − 4=
performed to enhance the characteristics of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS
is identified as the R peak of the ECG data progression of the algorithm towards detecting the R peak location
peak detection
peaks have been identified, the next step is to record the time intervals in he time intervals between R-peaks,
peak (RR) interval calculation and 3)
time properties,
pkins [37] is employed.
hm employed, comprising 1) differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
e QRS complex, of which
to enhance the characteristics of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS
is identified as the R peak of the ECG data progression of the algorithm towards detecting the R peak location
peaks have been identified, the next step is to record the time intervals in peaks, denoted by t
peak (RR) interval calculation and 3)
time properties, a classical is employed.
hm employed, comprising 1) differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
e QRS complex, of which
(3-6)
(3-7) to enhance the characteristics of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS is identified as the R peak of the ECG data segment.
progression of the algorithm towards detecting the R peak location.
peaks have been identified, the next step is to record the time intervals in oted by ti, such differentiation, 2) squaring, 3) threshold detection and finally 4) peak detection.
e QRS complex, of which
)
) to enhance the characteristics of the signal. Then a threshold is applied to the squared signal to detect the start of the QRS .
peaks have been identified, the next step is to record the time intervals in , such
)
Finding the variability of these values with respect to time in terms of frequency is our main ctive in HRV analysis.
spectral analysis.
3.2.2.3.3 Spectral analysis of RR intervals using the Lomb periodogram
Spectral analysis of time series signals is typically performed using transforms such as the Fast Fourier Transform (FFT). Howe
in time, thus, if FFT is to be used, the time. Unfortunately, studies have shown that
Finding the variability of these values with respect to time in terms of frequency is our main ctive in HRV analysis.
spectral analysis.
Figure
Figure
Spectral analysis of RR intervals using the Lomb periodogram
Spectral analysis of time series signals is typically performed using transforms such as the Fast Fourier Transform (FFT). Howe
in time, thus, if FFT is to be used, the time. Unfortunately, studies have shown that
Finding the variability of these values with respect to time in terms of frequency is our main These values are passed on to the Lomb periodogram algorithm for
Figure 3-5 Illustration of R
Figure 3-6 R-peak to R
Spectral analysis of RR intervals using the Lomb periodogram
Spectral analysis of time series signals is typically performed using transforms such as the Fast Fourier Transform (FFT). Howe
in time, thus, if FFT is to be used, the time. Unfortunately, studies have shown that
26
Finding the variability of these values with respect to time in terms of frequency is our main These values are passed on to the Lomb periodogram algorithm for
Illustration of R
peak to R-peak intervals of the ECG Spectral analysis of RR intervals using the Lomb periodogram
Spectral analysis of time series signals is typically performed using transforms such as the Fast Fourier Transform (FFT). However, the
in time, thus, if FFT is to be used, the data must be resampled into evenly time. Unfortunately, studies have shown that such
Finding the variability of these values with respect to time in terms of frequency is our main These values are passed on to the Lomb periodogram algorithm for
Illustration of R-peak detection
peak intervals of the ECG Spectral analysis of RR intervals using the Lomb periodogram
Spectral analysis of time series signals is typically performed using transforms such as the RR interval
must be resampled into evenly such resampling
Finding the variability of these values with respect to time in terms of frequency is our main These values are passed on to the Lomb periodogram algorithm for
peak detection
peak intervals of the ECG Spectral analysis of RR intervals using the Lomb periodogram
Spectral analysis of time series signals is typically performed using transforms such as RR interval time series is unevenly sampled must be resampled into evenly
resampling and the choice of
Finding the variability of these values with respect to time in terms of frequency is our main These values are passed on to the Lomb periodogram algorithm for
peak intervals of the ECG Spectral analysis of RR intervals using the Lomb periodogram
Spectral analysis of time series signals is typically performed using transforms such as time series is unevenly sampled must be resampled into evenly-spaced points in the choice of interpolation Finding the variability of these values with respect to time in terms of frequency is our main These values are passed on to the Lomb periodogram algorithm for
Spectral analysis of time series signals is typically performed using transforms such as time series is unevenly sampled spaced points in interpolation Finding the variability of these values with respect to time in terms of frequency is our main These values are passed on to the Lomb periodogram algorithm for
Spectral analysis of time series signals is typically performed using transforms such as time series is unevenly sampled spaced points in interpolation
27
scheme introduces inconsistencies in the final HRV analysis [39]. Thus, to address this issue while also maintaining an area-efficient portable solution, the Lomb periodogram [38], a spectral density tool specially designed for unevenly-spaced data sets, is chosen instead.
The Lomb method uses least squares fitting to estimate the amplitude of a given sinusoid with angular frequency ωj over non-uniformly sampled data. In other words, the power of the given sinusoid, PN(ωj), for a set of data points of length N is computed using a least-squares fit to the model
xt = AcosOωQtR + BsinOωQtR + nt (3-9) for i=0,1,…,N, where n(ti)nt is noise. The Lomb transform is based on the DFT for unevenly sampled signals given as
Xω ≡ xQe U/V
Q (3-10)
where tj corresponds to the time when xj is sampled. As the Lomb method weights the data on a “per point” basis rather than a “per time interval” basis, it is suitable for the analysis of non-uniform data.
Since the frequency range of interest in the analysis of HRV is between 0 to 0.4 Hz, the frequency range is normalized to 0 to 1Hz using N=256 points, yielding a frequency resolution of approximately 0.004 Hz per point. Setting ω to 2πk/N and substituting into (3-10), the Lomb transform is given as
XW!XY Z = xQe !XY /V
Q (3-11)
= xQcos2πk N tQ
Q
− i xQsin2πk N tQ
Q
where k = 0, 1, …, N-1, and xj are zero-mean data. The pseudo code of the final algorithm is given as
for n = 1 to (Number of RR intervals)
28 for k = 0 to 255
t = t + x[n];
x = x[n] ˗ µ;
X(k) = X(k) + x * [cos(k/N * t) - i * sin(k/N * t)] ; end
end