=Paper= {{Paper |id=Vol-1982/paper5 |storemode=property |title=Lightweight Signal Analysis for R-Peak Detection |pdfUrl=https://ceur-ws.org/Vol-1982/paper5.pdf |volume=Vol-1982 |authors=Maria Rizzi,Matteo D'Aloia,Ruggero Russo,Gianpaolo Cice,Sante Stanisci,Angela Montingelli,Annalisa Longo |dblpUrl=https://dblp.org/rec/conf/aiia/RizziDRCSML17 }} ==Lightweight Signal Analysis for R-Peak Detection== https://ceur-ws.org/Vol-1982/paper5.pdf
          Lightweight signal analysis for R-Peak detection

    Maria Rizzi1, Matteo Dโ€™Aloia2, Ruggero Russo2, Gianpaolo Cice2, Sante Stanisci2,
                       Angela Montingelli2 and Annalisa Longo2
    1Politecnico di Bari - Dipartimento di Ingegneria Elettrica e dellโ€™Informazione, Bari, Italy

                                            maria.rizzi@poliba.it

                                         2MASVIS SRL, Conversano, Italy

                                         matteo.daloia@masvis.com




Abstract. The electrocardiogram signal is considered very important in clinical practice in order
to assess the cardiac status of patients. In this paper, a computer aided detection system for R
peak localizations is indicated. A four stage architecture is implemented which is able to differ-
entiate R waves from peaked T and P waves with an high degree of accuracy. The performance
of the algorithm is tested using ECG waveform records from the MIT-BITH Arrhythmia database.
A sensitivity of 96 % and a positive prediction of 99% are achieved.


Keywords: ECG, QRS, Hilbert transform, wavelet transform, computer aided detection
(CADe), R-Peak


1         Introduction

    Signal processing technique has a large number of uses in medical environments
where it is a difficult task the differentiation between real pathological signs and false
alarms because of noise and imperfect signals [1]. Modern signal processing techniques
can improve existing investigation processes for diagnostic, treatment evaluation, and
research applications even in presence of corrupted and weak signals. Therefore, Com-
puter-aided detection (CADe) systems have become one of the major research subjects
in medical signal and imaging [2-5]. The fusion of technology and medical science thus
produces significant innovations that greatly contribute to human health and to people
quality of life. In particular CADe systems are important in detecting abnormalities
related to heart function in presence of signals corrupted by noise, artifacts and so on
[6]. The electrical activity of the heart is represented by the Electrocardiogram (ECG)
signal which shows the regular contraction and relaxation of heart muscle. It is a time-
varying signal reflecting the ionic current flow which causes the cardiac fibers to con-
tract and subsequently relax. Therefore its analysis is adopted to detect heart abnormal-
ities. The ECG is a non-invasive technique whose useful information are indicated by
the ECG shape such as intervals and amplitudes of the signal [7]. Due to the non-sta-
tionary behaviour of biological signals, disease indicators may be present all the time
or may occur at random during certain irregular intervals of the day. Therefore, the

D. Impedovo and G. Pirlo (Eds.), Workshop on Artificial Intelligence with Application in Health, Bari, Italy, November 14, 2017.
Copyright held by the authors.
study of ECG pattern by analysts may have to be carried out over several hours with an
high probability of missing vital information. The implementation of a procedure for
the detection of ECG key points (such as the P wave, the QRS complex and the T wave)
is a difficult task because of the time varying behaviour of human body and conse-
quently all processing methods should change their state during measurement. Moreo-
ver, noise contaminations, due to baseline drifts changes, motion artefacts and muscular
noise, is frequently encountered [7, 8]. The QRS detection is one of the most important
task in ECG signal analysis systems. In fact after the QRS identification, the heart rate
may be calculated and other parameters can be examined to avoid and to prevent serious
pathologies such as ischemia.
In this paper an improved signal processing technique able to detect R peaks in ECG
signals for heart rate evaluation, is presented. Its variability is linked to various disor-
ders such as obstructive sleep apnea syndrome, congestive heart failure [8, 9]. The im-
plemented method adopts the Hilbert transform envelope and a thresholding technique
for the detection of zones inside the ECG signal which could contain a peak. Experi-
mental results show the method validity and its high sensitivity and predictivity param-
eters. In section II a briefly description of ECG technique is presented while section III
describes the adopted methods. Section IV makes an in depth presentation of the im-
plemented CADe system and in section V the system performance are evaluated. More-
over, some conclusions are drawn out.


2      ECG technique

    ECG signal is the representation of the heart muscle electrical activity over time. It
supplies physicians with useful information and represents an important part of the car-
diac patient assessment.
A single normal cycle of ECG represents successive atrial depolarization/repolarization
and ventricular depolarization/repolarization which occur in every heartbeat. In fig.1
an example of the ECG shape is indicated [9].
The P wave is the first upward pulse of the ECG signal and is generated when the atria
contract to pump blood into the ventricles. The PR interval, which is a short period
where no electrical activity is seen, is due to a physiological delay; in fact the atrioven-
tricular node slows the electrical depolarization before it proceeds to ventricles. The
successive pulse, the QRS complex, is formed when ventricles contract to pump out
blood. The next S-T segment represents the early stage of ventricular repolarization and
under normal conditions is isoelectric (constant potential). A marked displacement of
the S-T segment signifies coronary artery disease. The ventricular repolarization forms
the T wave and the cardiac muscle is prepared for the next cycle of the ECG. Therefore,
the Q-T interval reflects the total duration of ventricular systole. A long QT interval
can be associated with heart failure, ischaemic heart disease, bradycardia, some elec-
trolyte disorders (i.e. hypocalcaemia) and can be consequence of different drugs taking.
                             Fig. 1 ECG characteristic shape


3      Proposed Method

3.1 Hilbert transform
The Hilbert transform xH(t) of a real function x(t) is defined as [10]:
                                    1 +โˆž         1              1
                        ๐‘ฅ๐ป (๐‘ก) = โˆซโˆ’โˆž ๐‘ฅ(๐œ)           ๐‘‘๐œ = ๐‘ฅ(๐‘ก) ร—                 (1)
                                    ๐œ‹           ๐‘กโˆ’๐œ             ๐œ‹๐‘ก
Therefore, xH(t) is both a time dependent function and a linear function of x(t). In fact,
it is obtained from x(t) applying the convolution with (๏ฐt)-1. Equation (1) shows that
xH(t) is obtained by filtering the signal x(t) through a linear time-invariant filter with
impulse response equal to (๏ฐt)-1. Because of the integrand has a singularity and the
limits of integration are finite, the Hilbert transform is properly defined as the Cauchy
principal value of the integral in (1), whenever this value exists.
Considering the frequency domain and applying the Fourier transform it results:
                               ๐น{๐‘ฅ๐ป (๐‘ก)} = โˆ’๐‘— ๐‘ ๐‘”๐‘› ๐น{๐‘ฅ(๐‘ก)}                           (2)
where
                                                +1        ๐‘“>0
                            ๐‘ ๐‘›๐‘” ๐น{๐‘ฅ(๐‘ก)} = { 0             ๐‘“=0
                                                โˆ’1        ๐‘“<0
Therefore, the Hilbert transform shifts all positive frequency components by -90ยฐ and
all negative frequency components by +90ยฐ while the amplitude of F[x(t)] remains con-
stant. Thus it is found that: x(t) and xH(t) are orthogonal and xH(t) represents the har-
monic conjugate of x(t). The function x(t) and its transform xH(t) are related to each
other and they together create an analytic signal that is expressed as:
                                   ๐‘ง(๐‘ก) = ๐‘ฅ(๐‘ก) + ๐‘—๐‘ฅ๐ป (๐‘ก)                            (3)
The envelope of z(t) is:
                                 B(t ) ๏€ฝ x 2 (t ) ๏€ซ xH2 (t )                        (4)
It is evident that B(t) and x(t) have common tangents and the same values in the points
where xH(t) is zero. Therefore, B(t) have the same slope and magnitude of x(t) at its
local maxima.
3.2 Wavelet transform
Wavelet transform is a suitable tool for studying non-stationary signals. In fact, both
the property of time-frequency localization (which allows us to obtain a signal at a
particular time and frequency or to extract features at various locations in space) and
the multirate filtering option (which permits the differentiation of signals with different
frequencies) make the wavelet transform an effective tool in signal processing analysis.
It decomposes the signal into several components with various scales or resolutions.
Therefore, it can identify useful information for R point detection and discard signal
bands which provide scant contribution to the study [11].
Since wavelet functions are compact, wavelet coefficients only measure the variations
around a small region of data array. This feature makes wavelet analysis particularly
useful for signal processing; the "localized" nature of the wavelet transform allows us
to pick out features in analyzed data with ease such as spikes (i.e. noise or discontinui-
ties), discrete objects, edges of objects, and so forth. Moreover, wavelet coefficients at
one location are not affected by coefficients at other locations in data under study. As
the aim of this paper is the implementation of a fast algorithm, a non-redundant wavelet
decomposition has been chosen. Moreover, as the temporal ECG shape is an important
parameter, the wavelet to be adopted should be a symmetrical function to avoid the
introduction of non-linear phase shift.
3.3 Block Diagram
The proposed system is composed of four stages (fig.2).




                    Fig.2 The block diagram of the implemented method

The first stage is the pre-processing phase in which the ECG signal is derived. This is
done for preparing the signal for Hilbert envelope computation. The second stage per-
forms the Hilbert transform envelope of the first derivative of ECG waveform. This
envelope represents an enhancement of the signal that can be used for the peak detection
[12] (fig.3,4).




                       Fig.3 Details of processed signal at stage 1, 2
     Fig.4 Overview of the signal at the output of stage 2 compared to the original signal


In order to guarantee an accurate detection of R peaks, a third stage is necessary. In this
step, the method decomposes the output signal of the second stage into six dyadic scales
(fig.5). After validation tests, wavelet bior 3.3 has been used. According to the power
spectra of the input signal of the third stage, the larger contribute of the signal is located
in scales 3 and 4. The implemented method adopts both an evolution of the classical
Mallat decomposition, called aโ€™ trous algorithm and equivalent parallel filter banks. A
hard threshold is adopted for singularity selection over the scales 3 and 4.




                 Fig.5 Decomposition of Hilbert signal over six dyadic scales
4      Simulation Results

    For the performance evaluation of the method, sensitivity and positive prediction
are taken into account. The Sensitivity (Se) is defined as the probability of detecting a
R point when a R point exists really; the positive prediction (+P) represents the proba-
bility of detecting a R point among the detected ECG peaks. They are computed adopt-
ing the following expressions:
                                              ๐‘‡๐‘ƒ
                Sensitivity:          ๐‘†๐‘’ =                                        (5)
                                             ๐‘‡๐‘ƒ+๐น๐‘

                                       +        ๐‘‡๐‘ƒ
              Positive Prediction:      ๐‘ƒ=                                        (6)
                                              ๐‘‡๐‘ƒ+๐น๐‘ƒ
where
  - TP (the number of true positives) is the number of correct identifications of R
      points present in the signal under test;
  - FN (the number of false negatives) is the number of R points present in the signal
      that the algorithm is not able to detect;
  - FP (the number of false positive) is the number of R points detected by the algo-
      rithm but actually in the signal.
   The proposed algorithm is tested on the ECG signals taken from the first channel of
the MIT-BIH arrhythmia database [13]
   In fig.6 are shown the system performance related to the threshold value adopted in
the last stage. The threshold value is a percentage of the peak maximum value in the
dyadic scales.

                  100

                   90

                   80

                   70
              %




                                                  Sensitivity
                   60
                                                  Positive Predictivity
                   50

                   40

                   30
                        30% 35% 40% 45% 50% 55% 60% 65% 70% 75% 80% 85%
                                          Threshold value

                             Fig.6 Se and P vs. threshold values

   The algorithm gives Se and +P parameters of about 96% and 99% for a threshold
value in the range [45% รท 70%] of R* denoting with R* the R point average value in
the related dyadic scales.
5      Conclusion

    Real time ECG signal processing is an important diagnostic procedure for the mon-
itoring of heart functional status. The proposed CADe system, makes the localization
of R peaks possible even if noisy signals and peaked T and P waves are present. The
Hilbert transform envelope and a multiscale analysis is performed for ECG enhance-
ment and R points localization. The parallel behavior of the implemented method opti-
mizes the procedure computational time and makes it suitable for a hardware imple-
mentation.

ACKNOWLEDGMENT
  The work has been developed within the framework of Masvisโ€™s Internal Research
Project, task titled: โ€œAnalisi di segnali mono e bidimensionaliโ€.

    References
 1. Rizzi M., Dโ€™Aloia M., Guaragnella C., Castagnolo B., Health Care Improvement: Compar-
    ative Analysis of Two CAD Systems in Mammographic Screening, IEEE Trans. Syst., Man,
    Cybern. A, Syst., Humans 42, 1385-1395 (2012)
 2. Pirlo G., Diaz M., Ferrer M.A., Impedovo D., Occhionero F., Zurlo U., Early Diagnosis of
    Neurodegenerative Diseases by Handwritten Signature Analysis, LNCS 9281, 290-297
    (2015)
 3. Rizzi M., Dโ€™Aloia M., Computer Aided System for Breast Cancer Diagnosis, Biomed. Eng-
    App. Bas C. 26,1450033 (2014)
 4. Impedovo D., Pirlo G., Mangini F.M., Barbuzzi D., Rollo A., Balestrucci A., Impedovo S.,
    Sarcinella L., Oโ€™Reilly C., Plamondon R., Writing Generation Model for Health Care Neu-
    romuscular System Investigation, Springer Int. Publishing, 137-148 (2014)
 5. Rizzi M., Dโ€™Aloia M., Cice G, Computer aided evaluation (CAE) of morphologic changes
    in pigmented skin lesions, Lect. Notes Comput. Sc. (including subseries Lecture Notes in
    Artificial Intelligence and Lecture Notes in Bioinformatics) 9281, 250-257 (2015)
 6. Rizzi M., Dโ€™Aloia M., Castagnolo B., Semiconductor detectors and principles of radiation-
    matter interaction. Journal of Applied Sciences 10, 3141-3155 (2010)
 7. Bohui Z., Yongsheng D., Kuangrong H, A novel automatic detection system for ECG ar-
    rhythmias using maximum margin clustering with immune evolutionary algorithm, Compu-
    tational and Mathematical Methods in Medicine 2013, 453402 (2013)
 8. Pentel T., ANS and heart rate variability in normal sleep and sleep disorders, Sleep Medicine
    8, 44-45 (2007)
 9. Rizzi M., Dโ€™Aloia M., Castagnolo B., ECG-QRS detection method adopting wavelet parallel
    filter banks, 7th WSEAS Int. Conf. on Wavelet Analysis & Multirate Systems
    (WAMUSโ€™07), Arcachon (France), Oct. 13-15, 2007, pp.158-163
10. Kschischang F.R., The Hilbert Transform, Department of Electrical and Computer Engi-
    neering, University of Toronto, http://www.comm.toronto.edu/frank/papers/hilbert.pdf
11. Rizzi M., Dโ€™Aloia M., Castagnolo B., A New Method for ICG Characteristic Point Detec-
    tion. 1st International Conference on Bio-inspired Systems and Signal Processing
    (BIOSIGNALS 2008), Funchal, Madeira (Portugal), 28-31 Jan., pp. 244- 249, (2008)
12. Wilson J.D., Govindan R.B., Hatton J.O., Lowery C.L, Preissl H., Integrated approach for
    fetal QRS detection, IEEE Trans. on Bio-Med. Eng., vol. 55, Sep. 2008, pp. 2190-7
13. MIT-BIH Arrhythmia Database https://www.physionet.org/physiobank/database/mitdb/