heartbeats. This is typically achieved using an ECG
peak detection algorithm, because the ECG peak
morphology (see figure 1) makes it an easily
detectable feature in the ECG waveform.
The utilized peak detector was an adaptation of
the Pan and Tompkins algorithm (Pan and
Tompkins, 1985).
To apply an ECG peak detection algorithm over
a long duration record, as a whole, is unfeasible,
because of the amount of memory required to
perform the computation. The strategy employed to
solve this issue consisted in partitioning the record
into several equally sized portions, processing them
individually. This approach gives rise to possible
detection errors in the borders, which we overcame
considering a fixed number of overlapping samples
between consecutive portions. We used an overlap
of 400 ms, carefully chosen after analysing several
ECG records. The bigger the overlapping period, the
longer the processing will last. However, when
dealing with long duration records, the additional
processing time due to the overlapping size is
negligible (at worst a few seconds more in a record
with several hours).
The strategy that we undertook regarding double
peak detections (one of them in an overlapping
region and the other in the beginning of the
subsequent portion of the signal) has a physiological
basis, as following explained:
When a muscle contracts, an action potential is
generated. Then, there is a long absolute refractory
period, which, for the cardiac muscle, lasts about
250 ms. During this period, the cardiac muscle can’t
be re-excited, which results in an inability for heart
contraction (Widmaier, Raff and Strang, 2005).
Thus, we can theoretically consider a maximum
heart rate of about 4 beats per second, or 240 beats
per minute. Under this assumption, considering that
in a signal sampled at 1 kHz, 250 ms would be
represented by 250 samples, and after a thorough
observation of the behaviour of the peak detection
algorithm, we stated that if the same peak were
detected twice, the detection would never occur with
such deviation in samples. Therefore, we
considered that if two R peaks were detected and
separated by less than 50 ms, we were dealing with a
double detection and only considered one of them.
With a tolerance of 50 ms, we ensured that double
detections would not occur on the overlapping
regions, while not dismissing any occurrence of a
physiologically possible RR interval.
The amount of time it takes for the peak
detection to complete depends on several factors: the
sampling frequency at which the signals were
acquired, the signals’ duration, the peak detection
algorithm and the processing unit of the machine in
which the computations take place. It took us about
8 minutes to process a 7 hour long ECG, sampled at
1 kHz on a single 2.2 GHz processor.
The peak detection phase can be regarded as pre-
processing and only has to be done once. Its duration
may be easily decreased applying parallel
programming techniques, due to the embarrassingly
parallel nature of the problem.
The peak detection information was stored in a
.h5 file (HDF5 file extension) for fast and random
access, a necessary feature to make the analysis of
portions of the signal possible.
For analysing a specific part of the ECG, for
instance, between the first and second hour of the
recording, all that has to be done is accessing the
processing results in the .h5 file and select the
samples between the first and second hour. This
information is then analysed in just a few seconds.
The simultaneous visualization of the signal and the
processing results is an extremely important
capability allowing a more detailed and accurate
analysis by the clinician and the researcher.
2.4 Tool Features
The HRV analysis provided is composed of time and
frequency domain parameters and also of some
visual representations, which, allied to the biosignals
visualization tool allow a more detailed data
inspection.
The time and frequency domain parameters
provided are depicted in figure 2.
Figure 2: The most important HRV analysis parameters
provided by our tool.
Besides time and frequency domain parameters,
our tool includes several important visualization
features as well:
tachogram and instantaneous heart rate (figure
3). Since each point in these representations is
directly associated with a cardiac cycle, we included
a zooming feature, directly synchronized with the
ANewToolfortheAnalysisofHeartRateVariabilityofLongDurationRecords
217