ISSN: 2641-3027

Research Article
Open Access Peer-Reviewed

Department of Biomedical Genius, Faculty of Technology, University Aboubekr-Belkaid, Algeria

**Cite this as**

The ECG signal is characterized by five peaks and valleys labelled by the letters P, Q, R, S, T as shown in figure 1.

The QRS complex is the most prominent wave component within the electrocardiogram. It reflects the electrical activity of heart during the ventricular contraction and the time of its occurrence.

A great number of methods were proposed for detection of the waves of ECG signal [1-7]. The majority of these methods are based on filtering or the thresholding adaptive, which shows the limitation of the application. Very few algorithms function well for the detection of all the landmarks such as the beginning and the end of the P wave, the T wave and QRS complex (also known under the name: extremes of the waves of ECG signal).

The principal disadvantage of filtering is that the variations of the frequency of the waves of ECG signal can influence its performance. This entrained being able a detection of false positions of the waves and consequently a bad detection of the QRS complex positions. In the same way the techniques of thresholding suffer their sensitivity to the noise which is high and a bad effectiveness in the treatment from odd morphologies (case of the R peaks reversed). Consequently, of the more elaborate techniques of treatment of the signals are necessary to facilitate the development of new algorithms of detection with a higher precision of detection.

Among these techniques the nonlinear filtering, which must be proven that the operators morphologies of dilation and erosion satisfy causality and the additive property of semi-group is required by the analysis of multi-scale [13-15] for signals of any dimension with local maxima and local minima which correspond to point singular.

The landmarks of ECG signal, such as the Q wave, the R peak, the S wave, the beginning and the end of the P wave and the T wave can be regarded as singular points [8].

Trahanias [9] use morphological mathematics for detecting RR peaks. Thus, a structuring element of similar triangular shape of the shape of the R wave and a fixed thresholding to extract the heart rhythm. In [10] present morphological filtering to suppress noise and baseline ECG signal. Sun et al. [11]. Use three steps to detect peak R: the morphological derivative called the gradient, the multi-scale morphological operations, and a thresholding that relies on the histogram.

The overall difference between our method and the method cited in [9] and [11] is the selection of the structuring element with respect to shape and size to extract information from the signal. Also, we did not use a thresholding but [9] and [11] uses thresholding to detect peak R. Thus, the morphological filtering algorithm remains fixed, to detect positive or negative peaks.

In our work, the algorithm developed for detection bench marks of the waves of ECG signal, based on Morphological Filtering (MF).

In morphological filtering [12], each signal is looked like a set, and the geometrical characteristics are modified by the morphological convolution of ECG signal with a structuring element, which is characterized by a simple form and the size. By varying the structuring element we can extract the various types of information starting from ECG signal. By the application of the mathematical morphology, defined in different operators morphology and the sensitivity of noise can be reduced by the method of the morphological filtering. Moreover, the problem of the deviation of position is existed in the techniques of the transformation of wavelets [6] but can be cancelled in the morphological transformation because of non-linearity.

A Morphological filtering is very widespread in the field of signal treatment and the image processing because of its robustness and its simple and fast calculation [8-12].

The mathematical morphology, based on operations of sets, provides an approach to the development of the nonlinear methods of treatment of the signals, in which the form of the information of a signal is, incorporated [14]. In these operations, the result of a whole of data transformed by another whole depends on the forms of the two implied sets. A structuring element must be designed according to the shape information of the signal which must be extracted.

There are two basic morphological operators: erosion $\left(\Theta \right)$ and dilation $(\oplus )$ .

The opening $(\circ )$ and closing $(\u2022)$ are the operators derived defined in terms from erosion and dilation [14,15].

These operators are described in detail in below with the corresponding mathematical expressions. In this article, *f (n)* indicates discrete ECG signal of N size points (Figure 1a), and symmetrical structuring element the M points.

The expression below definite the erosion of function *f (n)* (ECG) by a structuring element *B*:

$\left(f\text{\hspace{0.05em}}\Theta B\right)\left(n\right)={\mathrm{min}}_{m=0,\mathrm{.......},M-1}\left\{f\left(n-\frac{M-1}{2}+m\right)-B\left(m\right)\right\}$

Erosion is characterized by the reduction of the peaks of signal and widened transformation the valleys. This transformation $\left(\Theta \right)$
is an operator of shrinkage in which the values of $f\text{\hspace{0.05em}}\Theta B$
are always lower than *f*.

*Dilation*

The expression (2) below definite the dilation of the function *f* (noisy ECG) by a structuring element *B*:

$\left(f\text{\hspace{0.05em}}\oplus B\right)\left(n\right)={\mathrm{max}}_{m=0,\mathrm{.......},M-1}\left\{f\left(n-\frac{M-1}{2}+m\right)+B\left(m\right)\right\}$

This transformation with for properties in the morphological filtering of filled the valleys and to widen the peaks of ECG signal. The dilation $(\oplus )$ is an operation of expansion in which the values of $f\oplus B$ are increasingly larger than f.

The opening is the application of the operator erosion then of the operator dilation with the same structuring element:

$f\circ B=f\text{\hspace{0.05em}}\Theta B\oplus B\text{(3)}$

Closing is the “opposite” operation of the opening, i.e. which one applies first of all dilation then erosion (always by keeping the same structuring element):

$f\u2022B=f\oplus B\Theta B\text{(4)}$

$\left(f\u2022B\right)$
is also less rich in detail than the function initial *f*.

This transformation by closing fills the valleys, removes holes. In general, the starting whole is not found because part of the form eliminated by erosion cannot be recreates by a dilation. The transformation of opening $\left(f\circ B\right)$
is more regular (less details) than the original signal *f*.

The transformation by opening operator removes the peaks but preserves the valleys.

The two operations of opening and closing are idempotent, i.e. that the result is invariant after iterations:

$f\circ B=f\circ B\circ B\text{(5)}$

$f\u2022B=f\u2022B\u2022B\text{(6)}$

The operators “closing” and “opening” behave like filters; one will speak about “Morphological Filter”.

After the selection of the operator morphology, the structuring element (SE) is the next component of the morphological analysis to define. Generally, only when the form of the signal is matched with those of the structuring element that the signal can be preserved. Consequently, the form, length (domain) and size it (amplitude) structuring element should be selected according to the signal to be analyzed. The forms of the structuring element can vary regularly or irregularly, such as a triangle, line (flat), or a half-circle.

As that was described, the combination of the operator’s morphology «Closing + Ouverture» forms the morphological filter. The use of the operators’ morphology for the QRS complex detection was described [13]. Mathematical morphology is based on the limits of erosion and dilation.

To obtain the two functions eroded and dilated the *f (n)*

Whether, *f : F→ I* and *B → I *and *b: B I*, which are indicated the discrete functions, where the sets F and B are underlined by F = {0.1, …, N – 1} et B = {0.1, …., M - 1}. I is the sets of the integer.

The following formula illustrates the dilation of the function F (ECG filtered) by the structuring element B:

$\begin{array}{c}\left(f\ominus B\right)\left(m\right)=\underset{n=0,\dots .,M-1}{\mathrm{min}}f\left(m+n\right)-B\left(n\right)\\ forNMandm=0,\dots \dots \dots \mathrm{..},N-M\end{array}\text{(7)}$

The values of $\left(f\Theta B\right)$
are always lower the *f*.

The dilation of the function F (ECG filtered) by the structuring element B is given by:

$\begin{array}{c}\left(f\oplus B\right)\left(m\right)=\underset{n=0,\dots .,M-1}{\mathrm{max}}f\left(n\right)-B\left(m-n\right)\\ forNMandm=M-1,\dots \dots \dots \mathrm{..},N-1\end{array}\text{(8)}$

The values of $\left(f\oplus B\right)$ are always higher of f

Erosion and dilation are combined for additional operations.

The opening (o) is defined by the operation of erosion followed by dilation. Closing (•), is defined like a dilation followed by an erosion.

The two operators manipulate the signals in a comparable way. I.e., that the opening removes the peaks positive but preserves the valleys. For the closing of *f* with the same structuring element (flat) which must be removed all the valleys (peaks negative).

The detection of RR interval can be accomplished that after a good detection of R peak. This detection passes by three stages.

A stage which permit to locate the R peaks positive by the opened operation and another stage which allow to locate the R peaks negative by the application of the closed operation. The final stage to lead to these peaks and of the valleys is the subtraction of ECG signal filtered *f* with the two preceding operations.

The following formula illustrates the extraction of the R peaks positive:

Peaks (RR) = f – (f o B) (9)

And the following formula illustrates the extraction of the valleys or the R peaks negative:

Valleys (RR) = f – (f • B) (10)

The two preceding formulas are equivalent to:

(Peaks + valleys) (RR)= f – (f o B • B) (11)

The structuring element B is used to detect the peaks and the valleys. In this case is regarded as a geometrical form “segment horizontal various lengths”. The following formula shows the function of the structuring element B:

$b\left(t\right)=\{\begin{array}{c}1if\left|t\right|k\\ 0ifnot\end{array}$

Where K is constant

One of the problems of the morphological approach to determine the optimal value of K. If it is too small, the transformation will be sensitive to the high frequency noise, and the peaks are incorrectly given. However k which must be lower width of R peaks. The researchers are indicated excellent results by the use of the values between (55-60) ms [16].

The morphological approach is evaluated on some reference ECG signals, available from the universal MIT–BIH arrhythmia database [17]. This base contains 48 recordings with a sampling rate of 360 Hz.

For each input ECG signal (filtered), the following procedures were executed:

(i) a pretreatment of ECGs signals; (ii) the signal is operated by the opening for the detection of the peaks positive; (iii) followed by the operation of closing to detect the peaks negative; (iv) after a subtraction enters the filtered signal and the signal detected by opening followed by a closing in order to extract the peaks from QRS complex.

ECG Signal is contaminated by the noises in their recordings in particular the noise of 50-60 Hz and the base line of frequency between 0-1 HZ. The data base is filtered by a five-order pass band Butterworth filter. On figure 2 is respectively illustrated the stages of the QRS complex detection of ECG filtered (recording 100). This figure illustrates the performance of the algorithm: in the detection of RR rate/rhythm. In fact to generate a rate of heart beat RR, the stages of treatment realized and which constitute overall all the stages of morphological filter summarize as follows.

First of all, ECG signal is opened by an element structuring B, which means the application of two operators of morphologies “erosion + dilation”, to locate the peaks positive and to preserve the valleys. This operation “opening”, generates a signal constitute of the valleys (or peaks negative) which are located by the operation of closing “dilation + erosion”. The final stage to lead to the detection of peaks RR is the subtraction of ECG signal filtered with the signal generated by (f o B • B).

The structuring element B is used for the detection of RR peaks. In this case is regarded as a geometrical form “segment horizontal various lengths”. The figure 3a, represents a pathological signal of recording 107. We can notice that the amplitude of the T wave is almost half of R peak. In addition, we used the structuring element with sizes different in the operations morphologies from the opening and closing.

In the figure 3b, the size of the structuring element is lower 55 ms, which meant bad localization of the peak and valleys in the stage of opening and closing.

The figure 2c, illustrates a good performance of detection rate/rhythm RR by the use of the structuring element B with a variable size between (50-60) ms.

The results which one obtained show that the length of the structuring element in the operation of opening and closing plays a very significant role for the detection of RR peaks.

The application of the proposed method by the operators’ morphologies on the recordings (108-109-119-212), gives very satisfactory results as that is illustrated; in figures 4-7.

The selection of the structuring element is very important to follow the variation of RR wave morphology. The figures 4-7 show a variation of the morphology of each QRS complex cycle and the results present a good detection of the RR peaks.

More than 20000 beats of ECG signals are annotated from the database of arrhythmia MIT-BIH. It is employed to evaluate the detection proposed of the morphological filtering.

In order to quantify the performance of the QRS complex detection of ECG signal by the technique proposed, two parameters are used: the Predictivity *(P)* and sensitivity *(Se)*.

The sensibility (Se) is defined by the equation according to:

*Se = TP / (TP + FN)*

And the Positive Predictivity *(+P)* which is the fraction of detections that are real events and it is defined by,

+P = TP / (TP + FP)

Where FN (False Negatives) denotes the number of missed detections, FP (False Positives) represents the number of extra detections and TP (True Positives) is the number of the correctly detected QRS complexes.

The proposed method is compared with Christov’s method [18], Zero Crossing Counts Method (ZCCM) [19], and the Empirical Mode Decomposition (EMD) [2] as shown in table 1.

The experimental result shows that the proposed method performs better as compared to above four methods and allows a reliable and accurate detection of the QRS complexes.

New algorithm based on the mathematical morphology, named the filtering morphological, which was developed for the QRS complex detection of ECG signal. This algorithm is very robust vis-a-vis to the morphology variations of ECG signal and the speed of calculates.

However, the detection of QRS complex consisted three stages; the first is the positive peak detection used operators morphology (opening) followed by closing to detect the negative peaks. Finally, the subtraction of ECG filtered signal and the signal to detect by the operators of opening and closing in order to extract RR peaks. In addition, the structuring element is the key of this detection to extract the shape information from ECG signal. All ECGs from the MIT/BIH database have year evaluation set, show that more interesting performances compared to “Christov’ S”, Zero Crossing Counts Method and Empirical Mode Decomposition method, are obtained.

- Goldberger AL, Bhargava V (1982) QRS duration measurement using high-frequency electrocardiography: applications and limitations of a new technique. Comput.Biomed Res 15: 474-484. Link: https://goo.gl/dDts7t
- Taouli SA, Bereksi-Reguig F (1965) Detection of QRS Complexes in ECG Signals Based on Empirical Mode Decomposition. Global Journal of Computer Science and Technology 11: Version 1.0. Link: https://goo.gl/rRsDQR
- Hamilton PS, Tompkins WJ (1996) Quantitative investigation of QRS detection rules using the MIT-BIH arrhythmia database, IEEE Transactions on Biomedical Engineering. BME 33: 1157-1165. Link: https://goo.gl/mLe8mM
- Hadj Slimane ze (2006) Analyze and synthesis of methods of QRS detection detection of signal ECG. Thesis of doctorate. University Aboubekr Belkaid Tlemcen, ALGERIE, 2006.
- Laguna P, Jané R, Caminal P (1994) Automatic detection of wave boundaries in multilead ECG signals: validation with the CSE database. Comput Biomed Res 27: 45-60. Link: https://goo.gl/pbQ678
- Li C, Zheng C, Tai C (1995) Detection of ECG characteristic points using wavelet Transforms. IEEE Transactions on Biomedical Engineering 42: 21-29. Link: https://goo.gl/irDyTB
- Daskalov IK, Christov II (1999) Electrocardiogram signal reprocessing for automatic detection of QRS boundaries. Med Eng Phys 21: 37-44. Link: https://goo.gl/GHPWsz
- Mallat S, Zhong S (1992) Characterization of signals from multiscale edges. IEEE Transactions Pattern Analysis and Machine Intelligence 14: 710-732. Link: https://goo.gl/iebkbd
- Trahanias PE (1993) An approach to QRS complex detection using mathematical morphology. IEEE Trans Biomed Eng 40: 201-205. Link: https://goo.gl/GNPV6U
- Sun Y, Chan K, Krishnan SM (2002) ECG signal conditioning by morphological filtering. Comput Biol Med 32: 465-479. Link: https://goo.gl/QtzXP7
- Sun Y, Chan KL, Krishnan SM (2005) Characteristic wave detection in ECG signal using morphological transform. BMC Cardiovasc Disord 5: 28. Link: https://goo.gl/E9f44n
- Maragos P (2000) Morphological Signal and Image Processing. CRC Press LLC. Link: https://goo.gl/PZc9V6
- Taouli SA, Reguig FB (2006) Application of the operator’s morphology for the waves detection of the ECG signal. International conference on Electrical Engineering ICEE, Oran, Algeria 06 28-29.
- Serra J, Vincent L (1998) Analysis and Mathematical Morphology. II: Theoretical Advances. London: Academic Press.
- Serra J, Vincent L (1992) An overview of morphological filtering. Circuits, Systems and Signal Processing 11: 47–108. Link: https://goo.gl/T1Jjhf
- Köhler BU1, Hennig C, Orglmeister R (2002) The Principles of Software QRS Detection. IEEE Eng Med Biol Mag 21: 42-57. Link: https://goo.gl/MsTrgY
- MIT–BIH Arrhythmia Database Directory. (1992) Harvard University Massachusetts Institute of Technology, Division of Health Sciences and Technology.
- Christov II (2004) Real time electrocardiogram QRS detection using combined adaptive threshold. Biomed Eng Online 3:28. Link: https://goo.gl/LcayN8
- Köhler BU, Hennig C, Orglmeister R (2003) QRS detection using zero crossing counts. Progress in Biomedical Research 8: 138-145. Link: https://goo.gl/Dx8m16

© 2019 Taouli SA, et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

Subscribe to our articles alerts and stay tuned.

This work is licensed under a Creative Commons Attribution 4.0 International License.