Less computational approach to detect QRS complexes in ECG rhythms

ABSTRACT


INTRODUCTION
Nowadays, one of the most common methods for diagnosis and recognition of cardiovascular diseases is electrocardiography (ECG).The ECG signal is characterized by a set of peaks.In these peaks, the time and amplitude parameters are diagnosed [1].As a normal practice by cardiologists, the procedure of finding the characteristics of ECG peaks is performed using drawing accessories.Such a scheme is quite simple and reliable, but it is time-consuming and requires an expert.Due to the lack of alternative approaches, diagnosing ECG patterns using this method has been implemented for several decades [2].Most of the heart diseases are diagnosed using Electrocardiogram signals.The accurate analyses of these biologic signals make it extremely important in detecting heart rhythm irregularities and the diagnosis of heart rate variability (HRV).Extraction of the QRS complex and obtaining its characteristics is one of the most important parts in ECG signal processing and analysis, especially the wave known as R. Recent advances in electronic medical equipment made it possible for experimental, clinical, and preventive medicine to utilize engineering expertise in the design of complex control systems that are related to the diagnosis of the state of the human body [3].These technological developments allowed the automatic diagnosis of fetal heart rate using different methodological approaches [4].Investigating various diagnostic methods shows that the most useful information on the functioning of internal organs and physiological systems of human body is contained in bioelectric signals.These signals are taken from various areas parts, under the skin or from the surface of the body [5].This refers to the electrical activity of the heart, the electric field of the brain, and the electrical potentials of body muscles [6].In general, any electrophysiological study is represented by three successive stages: removal, registration and processing of bioelectric activity signals [7].The specific features inherited in a particular method of implementing each of these stages above determine the set of requirements and restrictions on the possible implementation of the other stages [8].For several decades, the reliability of bioelectric studies was limited by the technical capabilities of recording and displaying information.This hindered the development of methods for the automatic processing of electrocardiogram signals.During the last decade, development in microelectronics and computer technology allowed the elimination of instrumental distortions, and the application of digital signal processing methods, the implementation of which was previously impossible.A special point among electrophysiological diagnostic methods is measuring and processing of an electrocardiogram.Since the electrocardiogram is the main indicator that currently allows the prophylactic and therapeutic control of cardiovascular diseases; the effectiveness of electrocardiographic diagnostic methods can be facilitated by the well-established lead system and widespread use of quantitative ECG indicators.Detection and identification of QRS complexes are one of the main tasks in the analysis of a cardiogram [9].The separation of QRS complexes helps to solve problems such as analysis of the ECG rhythm, recognition of P, QRS, T features, and compression of the cardiogram.In order to complete the signal averaging process, reference points must be defined in each cycle.Peak locations of R waves are used as reference points.Figure 1a shows a part of a cardiogram with a normal heart rhythm.Figure 1b  Several approaches suggested algorithms as hidden Markov models [10] for online rhythm recording of an ECG signal.For such approaches, two leads of a cardiogram are used simultaneously, although this method provides some advantages, times of heartbeats given by these leads may not coincide [11].The algorithm using one ECG channel is particularly convenient for stand-alone monitors.It is also used in many other devices such as home appliances, defibrillators, and in telemetry for devices with limited bandwidth.Algorithms were employed to analyze ECG such as the Hamilton-Tompkins (H-T) algorithm as well as the Hilbert transform-based algorithms [12].Many other algorithms exist, and the combination of using two of them or more deemed to be beneficial in better pinpointing the location of Q, R, and S peaks [13].For example. the H-T algorithm accuracy was tested on generated MATLAB ECG signals and found a reliable accuracy even though moderate to high noises were present [14].These results were very encouraging to the use of handheld devices with mostly use this method.The Hilbert transform-based algorithms found better applications in transformed signals where it is used to suppress unwanted waveforms or signals [15].
Mathematical and statistical models [16] were used to help extract accurate results.Never the less, depending on the quality level of the database, the accuracy ranged from 78.99% to 99% [17].Besides the presence of fallacious signals and noise, the main problem in detecting QRS occurs for electrocardiograms with a variable rhythm, where P and T waves have significant values.The general structure of a QRS detector consists of two stages [18]: in stage one; the digitized cardiogram data is filtered to eliminate noise and to eliminate P and T waves.Further, in order to amplify the R wave, the output signal is processed by non-linear transformations, such as a quadratic function.Secondly, to obtain the boundary points of the QRS complex, an algorithm with a threshold function (Tompkins algorithm) is used.As an alternative to the Tompkins 'algorithm, Zigel's algorithm [18] can be utilized with some modification.Zigel's algorithm also Comput.Sci.Inf.Technol.


Less computational approach to detect QRS complexes in ECG rhythms (Tariq M. Younes) 115 consists of two stages, but it has a different approach in determining the refractory period (period of nonexcitability) in the signal.In the first stage, periods of non-excitability are determined where there is no QRS, and thus QRS complexes are approximately determined.

RESEARCH METHOD
The desired QRS waveforms are determined using a "low pass" filter (LPF), a difference filtering, and moving average filtering.This procedure, demonstrated in Figure 2, allows for the estimation of an approximate range of QRS complexes values.This filtering also discards fallacious signals caused by T waves and noise.A filter design constrains when using a constant threshold function is the procedure accuracy, especially with signals containing a large admixture of EMG noise or artifacts of motion [19].In the second stage, the threshold function is used.However, the algorithm fails when the signal contains a lot of high-frequency noise [20].This is because the threshold depends on the derivative values of the signal.In this paper, it is proposed that the threshold is set as a variable function that is adjusted each period until it reaches a parameter defined by the user.The proposed method includes signal pre-processing, filtration sequence, robust threshold analysis and subsequently, QRS detection for ECG is described in the below sections.

Applying low-pass filter to cardiogram signal
First, the cardiogram signal is fed through a low-pass FIR filter with passband upper frequency 1 Hz, stopband lower frequency 45 Hz.As stated in the literature, most cardiogram energy is in a range of 1 Hz-45 Hz [21].Therefore, the cutoff frequency for this filter is 45 Hz.The filtered signal keeps most of the energy for the original signal, restraining high-frequency noise [22].This includes the 50 Hz interference of the electrical network [23].In some cases, it may be possible to apply more thorough filtering to improve the result by using other types of filters as a notch filter or wavelet domain [24].However, the goal of this stage is to determine the approximate intervals of the QRS complexes.This process is barely dependent on the fallacious signal filtered by LPF. Figure 3 shows details of the used LPF.After filtering, the intervals became smoother.As in FIR filters, the difference filter amplifies R waves and reduces the P and T waves.It also reduces the background noise of the waveform.The difference filter has the form [25], [26]: where: x[n] is the output signal of the lowpass filter.d[n] is the output signal of the difference filter.Figure 5 shows the characteristics of the applied difference filter.


Less computational approach to detect QRS complexes in ECG rhythms (Tariq M. Younes) 117

Moving average filter
The difference filter was found to reduce the non-QRS features; however, it also increases the highfrequency noise that remains after the LPF.To reduce short-term interference, it is necessary to apply a moving average filter as in (2).The filter size is taken to match the approximate width of the QRS complexes [27], [28].

Threshold function
The approximate intervals of the QRS complexes can be determined using the threshold moving average value of the output filter: it is also possible to use an adaptive threshold function when the detection of lower intervals fails.This takes place when a large number of high-frequency noise or signal distortions are generated when the patient moves.

ALGORITHM VALIDATION
In Figure 6, a sample of boundary determination process using the threshold function is shown.As demonstration samples for different ECG retrieved with different conditions, the developed QRS algorithm was tested with three cardiogram signals (ECG3.dat,ECG4.dat, and ECG5.dat).In the ECG3 signal.dat,there is a moderate amount of nondeterministic ground noise that can be produced by the patient's breathing.Boundary of QRS was successful as shown in Figure 7.  Figure 9 shows signal (ECG5.dat)which is extremely distorted.Also, within 7 seconds, a sharped motion signal appears simulating the QRS complex.This fallacious motion signal makes the detection of QRS complex a challenging task.The proposed QRS detection algorithm is tested using three cardiograms' patterns, each consists of 20 samples as demonstrated in the previous section [29].The duration of the signals is 20 seconds and they are distorted by the noise of various types (FS = 200 Hz).Sensitivity (Se), the results are illustrated in Table 1, is calculated using (5): where: TP is the number of QRS complexes found, FNthe number of incorrectly defined QRS complexes.
If there was an error in the location of the strike even at one selected point, the FN increases.The results show satisfactory detection of QRS complexes for the proposed straightforward algorithm that does not require any reference signals.The sensitivity can be improved used a correction algorithm and comparative periodic procedure.

CONCLUSION
The development of advanced processing systems has resulted in realizing specific complexes in ECG rhythm that allows detecting heart diseases.Currently, instrumentations are used to record Cardiographs providing signal filtering, data analysis, and diagnosis based on ECG timing.In this paper, automatic detection and recognition of QRS complexes for ECG rhythm are proposed.The presented algorithm is structured based on a series of filters that composes LPF, difference and summation filters.Afterward, a threshold function is applied to detect QRS complexes.The algorithm has successfully located the QRS complexes.An approximate definition of boundaries can be challenging when these boundaries are distorted by high-frequency EMG noise and by the noise from patient movement.This leads to the omission of several beats.In such cases, instead of using a constant threshold function, it is necessary to use an adaptive threshold function, which can improve the operation of the algorithm using variable threshold variables.The results are found satisfactory for such a robust direct algorithm.

Figure 1 .
Figure 1.These figures are: (a) Sample of retrieved cardiogram signal with normal heart rhythm (ECG sample signal); (b) ECG main characteristics features, including P, T, and QRS complexes (ECG embedded complexes)

Figure 3 .Figure 4 .
Figure 3.The amplitude response of the LPF transfer function.x-axis in X/100 Hz

Figure 5 .
Figure 5.These figures are; (a) Amplitude (Difference filter dB) and (b) phase plots of difference filter (Difference filter Phase angle); x-axis in X/100 Hz

Figure 6 .Figure 7 .Figure 8
Figure 6.The result of the boundary determination process using the threshold function (x-axis is time samples)

Table 1 .
Sensitivity calculation Less computational approach to detect QRS complexes in ECG rhythms (Tariq M. Younes) 119