Instruction FACTA UNIVERSITATIS Series: Electronics and Energetics Vol. 28, N o 4, December 2015, pp. 571 - 584 DOI: 10.2298/FUEE1504571J QRS COMPLEX DETECTION BASED ECG SIGNAL ARTEFACT DISCRIMINATION  Borisav Jovanović 1 , Vančo Litovski 1 , Milan Pavlović 2 1 University of Niš, The Faculty of Electronic Engineering, Niš, Serbia 2 University of Niš, The Faculty of Medicine, Niš, Serbia Abstract. A new algorithm dedicated to electrocardiograph telemetry devices is proposed which evaluates the quality of electrocardiogram signals acquired in unsupervised environments, raises the certainty of the produced diagnoses, and accelerates protective actions when necessary. The proposed algorithm is utilized in conditions when electrocardiogram signals are highly susceptible to artefacts. The algorithm is based on novel QRS detection method and is used in microprocessor-based telemetry devices with reduced computing power. The algorithm has been tuned on publicly available databases. The results of its exploitation are also presented. Key words: ECG telemetry systems, ECG recordings quality 1. INTRODUCTION The quality of electrocardiogram (ECG) data influences the diagnosis results [1, 2]. The same stands for data acquired by ECG telemetry devices [3]. The potential limitation of using telemetry devices is measurement artefact immunity and their ability to measure discernible QRS and P waveforms in the presence of noise [4]. The very notion that the patient executes measurement without supervision often has a detrimental impact on the quality of the acquired data, even though the patient will receive training in how to use the device [4]. The ECG telemetry device itself should be able to distinguish ECG signals from artefacts. Moreover, the device has to work autonomously and transmit data to doctors when a cardiac disorder happens. One approach fulfilling these requirements is proposed in this paper. It is our intention to emphasize a novel method for ECG signal quality assessment which is applied in the design of an ECG telemetry device. It prevents the transmission of ECG data with insufficient signal quality and also enhances detection of various cardiac disorders. The algorithm is tuned on publicly available ECG recording database [5] and validated on clinical ECG data.  Received September 15, 2014; received in revised form January 13, 2015 Corresponding author: Borisav Jovanović University of Niš, The Faculty of Electronic Engineering, Aleksandra Medvedeva 14, 18000 Niš, Serbia (e-mail: borisav.jovanovic@elfak.ni.ac.rs) 572 B. JOVANOVIĆ,V. LITOVSKI, M. PAVLOVIĆ 2. RELATED WORK The ECG signals acquired by ECG devices are not immune to noise contamination. Techniques used for noise elimination are numerous [6], [7], [8]. The technique proposed in [6] is considered to be inappropriate for implementation in telemetry devices, because it requires multiple ECG leads for noise discrimination. Specifically, the structure of commercial telemetry devices is simplified. In order to be wearable, many devices measure only single ECG lead. The other technique proposed in [7] finds the locations of QRS complex and other ECG signal waves to perform an adaptive signal filtering. The technique proposed in [8] uses a light-emitting-diode-based sensor to measure the amount of skin stretching, and based on sensor outputs, performs the filtering process. When ECG signals are contaminated by large artefacts filtering methods are not sufficiently successful in recovering the underlying ECG signals. For example, the body movement related artefacts are observed in the frequency range of the electrocardiogram, and often have similar shapes as QRS complexes. Therefore, the signal and noise components cannot be easily discerned [9]. The signal to noise ratio cannot be either calculated for ECG signals because the signal components interpreted as ECG signal in one application may be interpreted as noise in the other applications [9]. Additionally, as a consequence of aging, the amplitude of R wave can be decreased down to noise levels. Instead of suppressing artefacts it is preferable to quantify the quality of an ECG signal. The assessment of signal quality is not completely solved, especially when focusing on telemetry devices with limited processing power [9]. Some approaches use additional devices to identify the sections of ECG signal having artefacts. For example, the work in [10] proposes an accelerometer sensor for movement detection. The other methods rely exclusively on ECG recordings. The paper [11] presents a method which reduces the number of false alarms in coronary care units. The method for noise assessment presented in [12] requires two ECG leads. First, the algorithm calculates the locations of the QRS complexes in signal, and after using neural networks, determines whether the signal is a QRS complex or an artefact. In the algorithm described in [13], the researchers estimate the level of deviation of the suspected QRS complex compared to averaged QRS complex. Recently, several algorithms dedicated to smart phone platforms are proposed. Such method [14] is based on [13] and focuses on the assessment of ECG signal quality when the signal is measured in the unsupervised environments. After applying a filter to remove gross movement artefact, the signal quality is estimated in the remaining ECG signal [14]. The QRS complex detection is a basic step in almost every ECG analysis procedure. The performance of subsequent ECG analyses strongly depends on the robustness of the QRS detection [15]. Therefore, ECG quality assessment based on QRS detection seems to be a practical approach that is suitable for most subsequent ECG analysis algorithms [9] and therefore has been adopted also here. The QRS detectors have been thoroughly studied and many methods have been proposed. The QRS detection method is first described by Nygards and Sornmo [16] and is subsequently updated by Pan and Tompkins method [17]. An open-source code [18] has been taken as a starting point for a new method for identification of QRS waves, proposed in this paper. This algorithm is a modification of Pan and Tompkins method [17]; uses adaptive thresholds and has a scan-back procedure which looks back in time if no beats have been detected during a certain period. QRSComplex Detection Based ECG Signal Artefact Discrimination 573 3. THE OPERATION OF TELEMETRY DEVICES The telemetry devices have emerged as a technology with a great promise for identifying cardiac disorders that are not easily discernible by other ECG diagnostic devices. Compared to other ECG recorders, the ECG telemetry devices have the following advantages in:  using wireless communications for instantaneous reporting of cardiac disorders  having longer recording periods, long enough to capture the arrhythmic episodes and pauses in heart rhythm  having very small size in order to reduce the obtrusiveness of the recording process [4] A novel algorithm for ECG signal quality assessment has been implemented in an ECG telemetry device. The device uses five conductive electrodes (Fig. 1). The arm electrodes (R and L) are placed on spots near right and left shoulders (Fig. 1). The leg electrodes (F and N) are placed on abdomen bottom side in the legs direction. One additional precordial electrode [19] is placed at one of anatomically referenced landmarks on the anterior chest (V1–V6) given in Fig. 1. The precordial landmark V5 is mostly utilized since it provides best sensitivity for myocardial ischemia disease detection [1]. The following standard leads are acquired: I, II, III, aVR, aVL, aVF and one precordial - the lead V5. Fig. 1 The data processing chain in an ECG telemetry device The processing blocks of an ECG telemetry device are depicted in Fig. 1. The device receives analog ECG signals from electrodes through conductive patient cables. A brief description of similar amplifier circuits operating in electrocardiograph dedicated to stress testing is given in [20], [21]. The analog signals are converted into digital at data rate of 500 samples per second, and then processed by digital filters. After the filtering operation has been completed, the RR (R wave to R wave) intervals representing the time periods between two consecutive R waves are calculated for the detection of following cardiac disorders:  tachycardia (disorders having high heart-rate rhythm) [22],  bradycardia (low heart-rate rhythm heart condition),  pauses (abnormal delays between QRS waves),  arrhythmia (irregular changes in heart-rate rhythm) [23]. The algorithm for ECG signal noise level estimation which is implemented within a telemetry device determines if an ECG recording has acceptable quality for data transmission. The noise level estimation algorithm, in conjunction with QRS complex detection method, will be described in following sections in detail. 574 B. JOVANOVIĆ,V. LITOVSKI, M. PAVLOVIĆ 4. THE ALGORITHM FOR PEAK DETECTION AND NOISE LEVEL ESTIMATION 4.1. QRS detection algorithm The digital samples of ECG signal are processed at sampling frequency of 250 samples per second. The operations dedicated to heart beat detection and noise level estimation can be divided into following groups:  ECG signal pre-processing,  peak detection,  noise level estimation,  QRS waves detection The brief description of ECG pre-processing block operations is given in Figure 2. The pre-processing block starts with band-pass filtering. Two Finite Impulse Response (FIR) filters are used:  the low-pass with cut-off frequency of 15Hz  high-pass with cut-off frequency 1Hz. Fig. 2 QRS wave detection operations The absolute value of the signal's first derivative is calculated and the outcome signal is processed by moving the averaging filter. The average value of the input signal is found over a 96ms timing window. The duration of 96 ms is chosen after a thorough analysis was performed using ECG data from database [5]. We initially used the longer interval of 150 ms, which is used in [17]. Then, we had to change the value to 96ms because we found that 96ms timing window enables better detection of QRS complexes when ventricular tachycardia is present in an ECG signal. As a result of pre-processing operations each QRS complex produces a knoll at the output of moving the average block. The output is denoted with x[n] in Figure 2. The Peak detection and Noise level estimation blocks (Figure 2.) are novel and will be described in the following sections in detail. The block denoted as QRS detection rules in Fig. 2 is taken from [18]. The block classifies the peaks found by Peak detection block (Fig. 2.) as QRS complexes or noise, using peak height, location (relative to last found QRS complex) and adaptive thresholds. If peak is greater than threshold, it is considered as R wave, otherwise it is called noise. Besides, all peaks that precede or follow larger peaks by less than time period of 200ms are discarded. The outcome of Detection Rules block can be used further for beat classification such as detection of arrhythmias. QRSComplex Detection Based ECG Signal Artefact Discrimination 575 4.2. Peak detection algorithm The output signal of pre-processing block, the digital signal x[n], enters the next - Peak detection block, at data rate of 250 samples per second. The examples of ECG signal ecg[n] and corresponding x[n] are depicted on the top and the middle panels of Figure 3 respectively. As one can see from Fig. 3, the QRS complexes in ecg[n] produce knolls in signal x[n]. Also, the knolls produced by P and T waves are considerably smaller than those created by R waves, and therefore can be successfully distinguished. The peak detection algorithm generates at its output two different signals:  Peak[n] which is used by QRS detection rules block for the identification of R waves. Peak[n] is presented on the top panel of Fig.3.  Pulse[n] which is used by Noise level estimation block for artefact detection and is presented on the middle panel of Fig. 3. Fig. 3 Set of signals illustrating the peak detection and noise estimation algorithm. The top panel presents signals ecg[n] and Peak[n], the middle panel x[n], oldMin[n], oldMax[n], ave[n] and Pulse[n], the bottom panel signal state[n]. The algorithm for Peak detection uses adaptive thresholds which are adjusted depending on the local minimum and maximum values of signal x[n]. The local minimum and maximum values are named with oldMin and oldMax respectively. The variables oldMin, oldMax are presented in Fig. 3 on the middle panel. The oldMax is the most distinct value within the signal x[n], calculated during the last RR interval (Fig. 3). The oldMin represents the minimum value of x[n] found in the same interval. The algorithm calculates additional variable ave (given in Fig. 3 on middle panel), which represents the approximation of the mean value of signal x[n]. 576 B. JOVANOVIĆ,V. LITOVSKI, M. PAVLOVIĆ The operation of the peak detection algorithm can be described by a Finite state machine (FSM) which is comprised of three states denoted as S0, S1 and S2. The state transition diagram of FSM is illustrated in Figure 4. In the example of an ECG signal depicted in the Figure 3, the FSM states are included on the bottom panel by signal State. Fig. 4 The Finite state machine states for Peak detection A QRS complex is recognized (the pulse is generated on the signal Peak[n]) when a state transitions S1->S2 occurs (Fig. 4). During the isoelectric time interval of an ECG signal [1] which is positioned before the QRS complex, the FSM resides in state S0. The state is changed from S0 to S1 (Fig. 4) when the rising edge of signal x[n] is detected. This transition is possible when the condition, given by Eq. (1), is met. ((( [ ] [ 4]) ) (( [ 4] [ 8]) )) ( [ ] )x n x n x n x n x n D           (1) The condition given by Eq. (1) consists of two parts. The first part calculates the slope of the rising edge of the signal x[n] and checks if it is greater than constant value δ. The δ is determined as the slope of signal x[n], produced by an input ECG signal ecg[n] having the lowest slew rate. The lowest slew rate for an ECG is estimated by dividing the minimum R peak amplitude within the range of 0.5mV to 5mV and dividing it by maximum rise time of the QR interval within the range of 17.5 ms to 52.5 ms. [24] This gives a minimum slew rate of 0.5mV/52.5ms=0.0095V/s. The second part of Eq. (1) checks whether the amplitude of x[n] exceeds the threshold D. Note that R peaks should be greater than 0.15mV for a QRS detection. The threshold value D is defined as a function of variables ave, oldMin, oldMax and time interval measured after the QRS complex has been detected as described in Table 1. Motivated by physiological standpoint, the time interval after the QRS complex has been detected is referred to as refractory period. The refractory period is greater than 280ms [1] and consists of absolute and relative refractory periods. The interval measured from the beginning of the QRS complex to the apex of the T wave is referred to as the absolute refractory period. The last half of the T wave is referred to as the relative refractory period. The absolute refractory interval is started when FSM state is changed from S2 to S0 and it lasts for 200ms. During this period, the D value is set to the maximum value. The absolute refractory period is followed by a relative refractory period lasting at least for 80 ms, within which the next QRS complex is more possible to happen. The D value, used during the relative refractory period, is determined empirically after a thorough analysis was performed on ECG data from database [5] and depends on the value of variable ave. As relative refractory interval elapses, the D value is decreased according to the equations described in Table 1. Because the algorithm is computationally optimized to be executed by low-power microcontrollers the multiplicand constants from Table 1 are chosen to speed-up the multiplication operations which can be replaced by combination of more time efficient shift, add and subtract operations. QRSComplex Detection Based ECG Signal Artefact Discrimination 577 Table 1 The threshold D value, used in relation (1) for the transition from state S0 to S1 Timer value [ms] Threshold D [0-200) oldMax*0.75 [200, 240) ave*1.25+oldMin [240, 280) ave+oldMin [280, +∞) ave*0.875+oldMin The state S1 of FSM covers the rising edge and the peak of the knoll produced by QRS complex (Fig. 3). When the amplitude of x[n] becomes smaller than the threshold given by relation (2), the FSM changes its state from S1 to S2 (Fig. 4). [ ] 0.75(max )x n oldMin oldMin   (2) The variable Max found in Eq. (2) represents the local maximum of x[n], calculated during the state S1. Also, at the moment of transition from S1 to S2, the variable oldMax is updated with the Max (Fig. 3). The pulse on signal Peak[n] is generated when the FSM state is changed from S1 into S2 (Fig. 3). The Peak[n] is taken later as an input by Detection rules block which classifies detected peaks as either QRS waves or noise. During the state S2 the falling edge of x[n]occurs. The state is changed from S2 to S0 if the relation (3) is met: ( [ ] 0.25( )) ( [ ] 2 )x n oldMin oldMax oldMin x n oldMin      (3) The transition from S2 to S1 (Fig. 4) is possible and it is caused by artefacts in the ECG signal. The state S1 changes into S2 when relation (4) is fulfilled: ( [ ] 0.25( )) ( [ ] 10)x n Min oldMax oldMin x n Min      (4) The variable Min found in Eq. (4) stores the local minimum of signal x[n], calculated during the state S2. The ave is changed when the state is changed from S2 to S0 to track the signal x[n] maximum, obtained by signal oldMax: 125.0875.0  oldMaxaveave (5) When FSM is in S0, the value of ave is approximately decreased by half after every time period equal to 2 seconds. This is achieved by reducing the signal ave after every interval of 120 ms (30 ECG signal samples): 5 (1 2 ) 0.96875ave ave ave       (6) The multiplicand constant from equation (6) is chosen to speed-up the multiplication operations which can be replaced by shift, add and subtract operations. When FSM is changed from S2 to S0, the oldMin is initialized with x[n]; at the transition from S2 to S1 the variables oldMin and Max are initialized with content of variables Min and x[n] respectively (Fig. 3). 578 B. JOVANOVIĆ,V. LITOVSKI, M. PAVLOVIĆ 4.3. Noise level estimation algorithm The part of the algorithm dedicated to noise estimation is described as follows. The signal Pulse[n] which is used for ECG signal artefact detection is updated at FSM's state transitions and is depicted on the middle panel of Figure 3. The state transitions during which the non-zero values on Pulse [n] are generated and their amplitudes are defined in the Table 2. The Pulse[n] is set to the value of one of variables min, oldMin or ave. Table 2 The FSM state transitions at which the pulses are produced on Pulse[n] and corresponding values State transition Amplitude S0 -> S1 min S1 -> S2 ave S2 -> S1 oldMin, if (ave≤20) S2 -> S1 min, if (ave>20) The signal Pulse[n] has to be normalized. The algorithm is executed by a microcontroller with limited processing capabilities which does not calculate with fixed-point numbers and the value Pulse[n] is multiplied with constant of C=32, which is arbitrarily selected. After these numbers are multiplied, the result is divided by signal ave. Normalized signal Pulse2[n] is described by Eq. (7). 2[ ] 32 [ ] /Pulse n Pulse n ave  (7) The result of noise level estimation block is the signal noisy_interval[n] providing the information if the ECG signals quality is ‟acceptable‟ or ‟unacceptable‟. The block produces noisy_interval[n] equal to 1 when an interval is identified as noisy. The borders of noisy intervals are estimated considering amplitudes of non-zero values produced by Pulse2[n]. The interval denoted as noisy begins when two consecutive non-zero values are detected which are greater than threshold value TH. The noisy interval is finished if in the sequence of five adjacent non-zero values of Pulse2[n] there are not consecutive two which are greater than TH. The TH value is related to the value of constant C and it is determined after extensive analysis was performed on ECG data from the database [5].The threshold TH=12 is used for the identification of the noisy intervals in which the QRS complexes are often missed or false detected by QRS detector. The artefacts within the detected interval include motion and poor electrode contact related artefacts. Using lower value TH=6 the sensitivity of noise level estimation algorithm is increased and the intervals are classified as noisy even when artefacts do not influence a QRS detection, but may distort detection of P or T waves. The noise detected using TH=6 originate mostly from 50Hz-related artefacts and electromyography signals. An example of ECG signals containing noisy segments is given in Figure 5. The ECG signal ecg[n] is depicted on the top panel of Figure 5. The middle panel presents the signal Pulse2[n]. The signals noisy interval[n] and state[n] are depicted on the bottom panel of Figure 5. QRSComplex Detection Based ECG Signal Artefact Discrimination 579 Fig. 5 The identification of noisy segments in ECG signals. The top panel presents ecg[n], the middle panel Pulse2[n] and the bottom panel - state[n] and noisy_interval[n]. Fig. 6 Noisy segments of ECG signals having ectopic beats. The top panel presents ecg[n], the middle - Pulse2[n] and the bottom panel signals state[n] and noisy_interval[n]. 580 B. JOVANOVIĆ,V. LITOVSKI, M. PAVLOVIĆ Another example of ECG signals which are corrupted by patient's movement is depicted on the top panel in Figure 6. The example shows the strength of Peak processing algorithm. In the example, regular beats are mixed with ectopic beats having significantly larger and wider QRS waves than regular QRS complexes. The middle panel presents the signal Pulse2[n]. The noise_interval[n] is shown on the bottom panel. Despite of changes in signal morphology between normal and ectopic ECG beats, all QRS complexes are correctly identified. This can be observed by signal state[n] which is shown on the bottom panel. Besides, the baseline drift does not influence the detection of QRS complexes. 4. THE ALGORITHM VALIDATION ON PUBLIC ECG RECORD DATABASE The algorithm's performance was validated on PhysioNet Challenge database [5]. The database is comprised of one thousand 12-lead ECG recordings. The ECG signals are sampled at data rate of 500 Hz, with the resolution of 16-bit per sample and 5 μV per bit. The duration of each ECG record in database is 10 seconds. The ECGs were recorded by nurses, technicians and other volunteers with different amounts of training. After the ECG recordings had been recorded, they were interpreted by a group of people consisting of three cardiologists, five ECG analysts, ten people without prior ECG reading experience and five persons with some previous ECG reading experience [25]. In order to estimate the quality of all ECG recordings from set, each ECG recording was presented to annotators and all the recordings were scored. 775 of the records were considered as acceptable, 223 records as unacceptable and 2 records as undefined. It is worth mentioning that records with artefacts have been labelled as acceptable even if the annotators assumed that the record quality is satisfactory for medical personnel to make accurate diagnosis [25]. The described algorithm for QRS complex detection and noise quality estimation is implemented by the program code written in Matlab [26]. One thousand ECG recordings from the database [5] were analysed. The noisy signal segments, obtained using different thresholds values TH, are detected for all twelve standard leads of an ECG recording. The following seven measures are extracted for each ECG lead: 1. the portion of ‟weak‟ signals in an ECG recording which have the R wave amplitudes smaller than 0.15mV. The R waves having low amplitudes are assumed to be undetectable 2. the portion of flat line segments in an ECG recording 3. the portion of segments in a recording corrupted by high vertical spikes, disabling the QRS detection in intervals following spikes 4. the value obtained by dividing the duration of noisy segments and the duration of the ECG recording. The noisy segments, which include motion and poor electrode contact related artefacts, are determined by signal noise_interval[n]=1, calculated using the threshold value TH=12. 5. the value obtained by dividing the noisy segments duration and the duration of the ECG recording. The noisy segments are determined by noise_interval[n]=1, which is calculated using TH=6.The detected noise intervals include artefacts related to 50Hz interference and electromyography signals. The ECG signal segments considered by previous measure are excluded. 6. the portion of noisy segments of ECG signal caused by noise sources including previous two measures QRSComplex Detection Based ECG Signal Artefact Discrimination 581 7. the value of RR interval variability, where the square root of the mean of the sum of the squares of differences between adjacent RR intervals is calculated, divided by mean value of RR intervals, using the following formula: 2 1 1 variability 1 ( ) (%) ( ) N i i i N i i RR RR N RR RR N        (8) The artificial neural network is used to train the relationships between the calculated measures in the presence of ‟acceptable‟ and ‟unacceptable‟ ECG records. The total number of measures used in a training process for an ECG record is 84, consisting of seven distinct measures for each standard ECG lead. The calculated measures were fed into to a Multilayer Perceptron (MLP) artificial neural network. The back-propagation neural network (BPNN) was used with three-layer feed-forward structure. The first layer is the input layer that has 84 neurons as inputs (seven inputs per each of twelve standard ECG leads). The second layer, called the hidden layer, has 10 neurons. One hidden layer has been proven as sufficient [27]. The number of hidden neurons was obtained after the procedure was applied that is based on methods given in the literature [27], [28]. The output layer has only one neuron providing a quality estimate of the ECG record (‟acceptable‟ or ‟unacceptable‟). In this study, the logistic function is used as activation function for the hidden neurons. The weight and bias values in the BPNN are optimized using Levenberg- Marquardt algorithm [29]. After the training process of a neural network has been completed, we used the same training set to test neural network effectiveness. The neural network correctly identified 715 recordings of 1000 recordings as being ‟acceptable‟ and 208 recordings as being ‟unacceptable‟. Let TP, TN, FP and FN denote true positives, true negatives, false positives, and false negatives, respectively. TP counts correctly classified „unacceptable‟ records, TN - correctly classified ‟acceptable‟ records, FP - incorrectly classified ‟unacceptable‟ records) and FN - incorrectly classified ‟acceptable‟ records. The following results are obtained TP=208, TN=715, FP=17 and FN=58. The results are characterized with sensitivity, specificity and accuracy measures, described by following equations: (%) TP sensitivity TP FN   (9) (%) TNFP TN yspecificit   (10) (%) FNFPTNTP TNTP accuracy    (11) Sensitivity is equal to 78.19%, specificity is 96.31% and classification accuracy is 92.48%. 582 B. JOVANOVIĆ,V. LITOVSKI, M. PAVLOVIĆ 5. DISCUSSION The performances of several QRS detection algorithms including the method from [18] is evaluated in [30] and [31]. The method has been developed and improved over the period of roughly 15 years, and states that the performance of the classification software is as good as or better than the performance reported from other QRS detection algorithms [30]. Also, the same algorithm is used as the starting variant of QRS detector in [31], where the algorithm has been adapted to operate in high noise and frequent signal losses environments. The algorithm described in [18] was significantly improved by the proposed algorithm especially when it processes noisy ECG signals. The novel algorithm more efficiently identifies QRS waves then the algorithm described in [18], regardless of QRS complex amplitude level, width and morphology. For example, the algorithm described in [18] suffered from false QRS detections when QRS waves are wide, which was confirmed by simulations and also evaluated on real clinical data. The novel algorithm does not produce false detections for wide QRS complexes being present in ectopic beats. Furthermore, it discriminates well P and T waves of ECG signal, which may have amplitudes as high as R waves. The QRS detector [18] should be more robust when detecting signals with low amplitudes and frequent artefacts [31]; for a highly noisy signal it fails to detect the peak location accurately [30]. One of the contributions of the proposed method is that it recognizes QRS complexes better than the algorithm presented in [18], particularly when QRS complexes have small amplitudes in the range from 0.15mV to 0.5mV. The algorithm can operate at rates up to 250 heart beats per minute. Moreover, the ECG signal segments with large amount of artefacts are clearly identified by Noise level estimation block, rejecting possible false arrhythmia and tachycardia detections. One of the results of the evaluation of proposed algorithm on clinical ECG data is presented in Figure 7. The figure shows the detection of QRS complexes in the presence of ventricular tachycardia. The ECG signal, presented on the top panel, is acquired by ECG telemetry device implementing the algorithm we propose. The QRS complexes are indicated by signal State, shown on the bottom panel of Figure 7. The signal noise_interval[n] is equal to zero. Fig. 7 The detection of ventricular tachycardia (VT). The top panel presents signal ecg[n], the bottom panel state[n] indicating QRS detections and noise_interval[n] QRSComplex Detection Based ECG Signal Artefact Discrimination 583 Several studies were reported on the topic of ECG signal quality assessment [32], [33], [25]. The studies returned a simple binary score for an ECG record, which does not quantify the amount of artefacts, but just decides if an ECG record is of acceptable quality. These ECG signal quality algorithms were validated on PhysioNet Challenge database [6] comprised of one thousand 12-lead ECG recordings. We have obtained the value of accuracy of 92.48% which is comparable to those found in [32], [33] and [25]. These accuracy values are obtained for the same input ECG dataset. For example, the method from [32] was has the accuracy of 93.2%. The [33] is a variant of [22] and has accuracy equal to 92.6%. The other studies reported accuracy measures from 83.3 to 92.5% [25]. We want to emphasize the potential role of the proposed quality assessment algorithm in utility of future ECG diagnostic devices. In particular, we assume that the algorithms we propose could improve the performance of ECG telemetry devices. Additionally, the quality assessment method could be used in every other kind of ECG recorders to, for example, help inexperienced nurses and technicians to record high quality ECG records. Besides, in contrast to the algorithms [32], [33] that are computationally demanding and were conceived in their original design for smart phone applications, the method that we propose is computationally optimized for embedding in low-power microprocessor-based ECG diagnostic devices. 6. CONCLUSION The work presented in this paper demonstrates a framework for combining both QRS detection and ECG signal quality assessment. Such approach exploits the covariant information of the noise and relevant ECG data measured in unsupervised ECG signal acquisition environments. A more accurate false alarm reduction system has been developed, which is a must in novel wearable ECG telemetry devices. The results from this work clearly indicate that the ECG record signal quality can be estimated using QRS complex detection method, which is based on the detection of heart refractory time intervals and additionally supported by utilization of artificial neural network techniques. It is shown that the algorithm has almost the same performance as the known state-of-the-art algorithms with a considerable reduction in computational complexity. The ECG telemetry devices can be therefore greatly improved with the use of proposed ECG signal analysis routines. REFERENCES [1] R. M. Rangayyan, Biomedical Signal Analysis – A Case-Study Approach, Wiley-IEEE Press, New York, 2002. [2] G. Clifford, F. Azuaje and P. McSharry, Advanced Methods and Tools for ECG Data Analysis, Artech House, Inc. Norwood, MA, 2006. [3] A. Müller, W. Scharner, T. Borchardt, W. Och and H. Korb, "Reliability of an external loop recorder for automatic recognition and transtelephonic ECG transmission of atrial fibrillation", Journal of telemedicine and telecare, vol. 15, no. 8, pp. 391-391, 2009. [4] S. Lobodzinski and M. Laks, "New devices for very long-term ECG monitoring", Cardiology Journal, vol. 19, no. 2, pp. 210–214, 2012. [5] PhysioNet 2011 PhysioNet/Computing in Cardiology Challenge 2011 http://www.physionet.org/ challenge/2011 [6] F. La Foresta, N. Mammone and F. Morabito, "Neural Nets", Lecture Notes in Computer Science, Vol. 3931, pp. 78–82, Berlin: Springer, 2006. [7] N. V. Thakor and Y. S. Zhu, "Applications of adaptive filtering to ECG analysis: noise cancellation and arrhythmia detection", IEEE Trans. Biomed. Eng., vol. 38, Issue 8, pp. 785–794, 1991. 584 B. JOVANOVIĆ,V. LITOVSKI, M. PAVLOVIĆ [8] Y. Liu and M. G. Pecht, "Reduction of skin stretch induced motion artefacts in electrocardiogram monitoring using adaptive filtering", In Proceedings of 28th Annu. Int. Conf. of the IEEE Engineering in Medicine and Biology Conf., pp. 6045–6048, New York City, USA, 2006. [9] D. Hayn, B. Jammerbund and G. Schreier," QRS detection based ECG quality assessment", Physiol. Meas., vol. 33, no. 9 pp. 1449–1461, IOP Publishing, September 2012. [10] Y. Kishimoto, Y. Kutsuna and K. Oguri 2007, "Detecting motion artefact ECG noise during sleeping by means of a tri-axis accelerometer", In Proceedings of 29 th Annu. Int. Conf. of the IEEE Engineering in Medicine and Biology Society, pp. 2669–2672, 2007. [11] J. Allen and A. Murray, "Assessing ECG signal quality on a coronary care unit", Physiol. Meas., vol. 17 Issue 4, 249–258, 1996. [12] Y. Kigawa and K. Oguri 2005 "Support vector machine based error filtering for Holter electrocardiogram analysis", In Proceedings of 27 th Annu. Int. Conf. of the IEEE Engineering in Medicine and Biology Society, pp. 3872–3875, 2005. [13] Q. Li, R. G. Mark and G. D. Clifford 2008 "Robust heart rate estimation from multiple asynchronous noisy sources", Physiol. Meas., vol. 29, no.1, 15–32, 2008. [14] S. J. Redmond, Y. Xie, D. Chang, J. Basilakis and N. H. Lovell, "Electrocardiogram Signal Quality Measures for Unsupervised Telehealth Environments", Physiol. Meas., Vol. 33, No. 9 pp. 1517-1533, IOP Publishing, September 2012. [15] L. Sornmo and P. Laguna, Bioelectrical Signal Processing in Cardiac and Neurological Applications, Academic Press Series in Biomedical Engineering, New York: Academic, 2005. [16] M. E. Nygårds, L. Sörnmo, "Delineation of the QRS complex using the envelope of the ECG", Journal of Medical and Biological Engineering and Computing, vol. 21, Issue 5 , pp 538-547, 1983. [17] J. Pan and W. J. Tompkins 1985 "A real-time QRS detection algorithm", IEEE Trans. Biomed. Eng. vol. 32, pp. 30–36, 1985 [18] P. S. Hamilton, "Open source ECG analysis", In Proceedings of Computers in Cardiology Conf., Sept. 2002, pp. 101 – 104. [19] D. Dubin, "Rapid interpretation of EKG‟s" Hong Kong: Cover, 2000. [20] B. Jovanović, M. Damnjanović and M. Pavlović,"12-Channel PC-Based Electrocardiograph", Electronics, vol. 10, no.2, University of Banja Luka, December, 2006, pp.44-48. [21] B. Jovanović, M. Damnjanović, "Novel PC-based cardiac stress test system", In Proceedings of LV Conf. ETRAN, BanjaVrućica, Bosnia and Herzegovina, 06.06.-09.06., 2011, EL 2.4. [22] Q. Li, C. Rajagopalan C and G. D. Clifford, "Ventricular fibrillation and tachycardia classification using a machine learning approach". IEEE Trans on Biomed Eng., 2013. [23] V. Fuster, L. E. Ryden, D. S. Cannom, H. J. Crijns, A. B. Curtis, K. A. Ellenbogen, J. L. Halperin, J. Y. Le Heuze, G. N. Kay, J. E. Lowe, S. Bertil Olsson, E. N. Prystowsky, J. L.Tamargo, S. Wann "ACC/AHA/ESC 2006 guidelines for the management of patients with atrial fibrillation", Circulation, Vol.8, No. 9, pp. 651-745, 2006. [24] D. Prutchi and M. Norris, Design and Development of Medical Electronic Instrumentation: A Practical Perspective of the Design, Construction, and Test of Medical Devices, John Wiley & Sons, Inc., Hoboken, New Jersey, 2004. [25] I. Silva, G. Moody and L. Celi, "Improving the quality of ECGs collected using mobile phones: The PhysioNet/Computing in Cardiology Challenge 2011" Int. Conf. on Computing in Cardiology, pp. 273– 276, 2011. [26] MATLAB version 7.6.0.324 Natick, Massachusetts: The MathWorks Inc., 2008. [27] T. Masters, Practical Neural Network Recipes in C++, Academic Press, San Diego, 1993. [28] G.-B. Huang and H. A. Babri, “Upper bound on the number of hidden neurons in feed-forward networks with arbitrary bounded nonlinear activation function”, IEEE Trans. on Neural Networks, Vol. 9, pp. 224- 228, 1998. [29] Litovski, V., Zwolinski, M., "VLSI Circuit Simulation and Optimization", Chapman and Hall, London, 1997. [30] S. Mohan, G.V. Kadambi, V.K. Reddy, M.D. Deshpande, "Development of an Industry Standard QRS Detection Algorithm for Automated ECG Analysis", SASTECH Journal, vol. 7, no. 1, April 2008. [31] J. Oster, J. Behar, R. Calloca, Q. Li, Q, Li and G. Clifford, "Open source Java-based ECG analysis software and Android app for Atrial Fibrillation Screening", In Proc. of Int. Conf. on Computing in Cardiology, vol. 40, pp. 731-734, 2013. [32] H. Xia, G. Garcia, J. McBride, A. Sullivan, T. De Bock, J. Bains, D.Wortham and X. Zhao 2011 "Computer algorithms for evaluating the quality of ECGs in real time", In Proc. of Int. Conf. on Computing in Cardiology, pp. 369–72, 2011. [33] G. Clifford, D. Lopez D, Q. Li and I. Rezek, "Signal quality indices and data fusion for determining acceptability of electrocardiograms collected in noisy ambulatory environments", In Proc. of Int. Conf. on Computing in Cardiology, pp. 285–288, 2011.