sensors Article

A QRS Detection and R Point Recognition Method for Wearable Single-Lead ECG Devices Chieh-Li Chen 1 and Chun-Te Chuang 1,2, * 1 2

*

ID

Department of Aeronautics and Astronautics, National Cheng-Kung University, Tainan 70101, Taiwan; [email protected] Industrial Technology Research Institute, Tainan 70101, Taiwan Correspondence: [email protected]; Tel.: +886-918-180-076

Received: 28 July 2017; Accepted: 24 August 2017; Published: 26 August 2017

Abstract: In the new-generation wearable Electrocardiogram (ECG) system, signal processing with low power consumption is required to transmit data when detecting dangerous rhythms and to record signals when detecting abnormal rhythms. The QRS complex is a combination of three of the graphic deflection seen on a typical ECG. This study proposes a real-time QRS detection and R point recognition method with low computational complexity while maintaining a high accuracy. The enhancement of QRS segments and restraining of P and T waves are carried out by the proposed ECG signal transformation, which also leads to the elimination of baseline wandering. In this study, the QRS fiducial point is determined based on the detected crests and troughs of the transformed signal. Subsequently, the R point can be recognized based on four QRS waveform templates and preliminary heart rhythm classification can be also achieved at the same time. The performance of the proposed approach is demonstrated using the benchmark of the MIT-BIH Arrhythmia Database, where the QRS detected sensitivity (Se) and positive prediction (+P) are 99.82% and 99.81%, respectively. The result reveals the approach’s advantage of low computational complexity, as well as the feasibility of the real-time application on a mobile phone and an embedded system. Keywords: ECG; QRS detection; heartbeat detection; mobile healthcare; IoT; wearable device; edge computing

1. Introduction A mobile healthcare system, as shown in Figure 1, has been one popular application of the internet of things (IoT) in recent years. Different from the traditional measurement devices, wearable devices can monitor long-term physiological signals and upload data to the cloud via a wireless communication system [1–3]. Therefore, low computation complexity and high efficiency algorithms become important issues in mobile healthcare systems. For a remote electrocardiogram (ECG) monitoring application, QRS detection is a preliminary step for detecting the heartbeat for the subsequent rhythm classification, so a high QRS detection rate method is the most significant part of the ECG analysis algorithm. Figure 2 shows the feature points (P, Q, R, S, and T) of a typical ECG waveform of a cardiac cycle in lead II. However, the measured ECG waveforms are usually different from one another due to motion artifact effects or abnormal rhythms [4], which leads to difficulty in detecting QRS. In the literature, there were numerous QRS detection methods proposed based on quadratic energy [5–8], the Shannon energy envelope [9,10], wavelet transform [11–13], adaptive threshold [14,15], and adaptive filter [16]. Based on a two-stage median filter and independent component analysis (ICA), approaches [17–19] were utilized in the signal pre-processing stage to eliminate the baseline wandering and waveform distortion caused by motion artifacts. Besides, recognizing Q, R, and S feature points for both typical and atypical QRS

Sensors 2017, 17, 1969; doi:10.3390/s17091969

www.mdpi.com/journal/sensors

Sensors 2017, 17, 1969

2 of 19

Sensors 2017, 17, 1969 Sensors 2017, 17, 1969

2 of 19 2 of 19

waveforms is also an important issue for implications. are nine categories of of QRS waveforms [20] applied toclinical recognize reasonableThere R points. In pre-specified addition, an adaptive of QRS waveforms [20] applied to recognize reasonable R points. In addition, an adaptive mathematical morphology was proposed to R points Generally, most QRS waveforms [20] applied toapproach recognize reasonable R extract points.the In real addition, an[21]. adaptive mathematical mathematical morphology approach was proposed to extract the real R points [21]. Generally, most of the foregoing methods exhibited a good performance in QRS detection; however, issues relating morphology approach was proposed to extract the real R points [21]. Generally, most of the foregoing of the foregoing methods exhibited a good performance in QRS detection; however, issues relating to power efficiency andperformance implementation simplicity are thehowever, main concerns embedded systemefficiency and methods exhibited a good in QRS detection; issuesfor relating to power to power efficiency and implementation simplicity are the main concerns for embedded system and mobile applications. and implementation simplicity are the main concerns for embedded system and mobile applications. mobile applications.

Figure 1.1.Mobile system. Figure Mobilehealthcare healthcare system. Figure 1. Mobile healthcare system.

Figure 2. Typical ECG waveform of a cardia cycle (normal sinus rhythm in Lead II).

Figure 2. Typical ECG waveform (normalsinus sinusrhythm rhythm Lead Figure 2. Typical ECG waveformofofaacardia cardia cycle cycle (normal in in Lead II). II).

This study proposes a real-time QRS detection and R point recognition method with a high This study proposes a real-time QRS detection and R point recognition method with a high

accuracy butproposes very low computational complexity. It is achieved by therecognition enhancementmethod of QRS segments This study a real-time QRS detection and R point with a high accuracy but very low computational complexity. It is achieved by the enhancement of QRS segments withbut the very restraining of P and T waves. The QRS recognition is carried out based on four typical QRS accuracy low computational complexity. It is achieved by the enhancement of QRS segments with the restraining of P and T waves. The QRS recognition is carried out based on four typical QRS waveform templates. The performance of the proposed method is verified using the MIT-BIH with the restraining of P and T waves. The QRSproposed recognition is carried out using basedthe on MIT-BIH four typical waveform templates. The performance of the method is verified Arrhythmia Database and was implemented in a mobile phone and an embedded system (ARM QRS waveform Thewas performance of in thea proposed method is verified using the(ARM MIT-BIH Arrhythmiatemplates. Database and implemented mobile phone and an embedded system Cortex M3), respectively, to demonstrate the real-time performance. Arrhythmia Database and was implemented in a mobile phone and an embedded system (ARM Cortex Cortex M3), respectively, to demonstrate the real-time performance. The paper is organized as follows. Section 2 presents the proposed methodology. The detected The paper organized as the follows. Section 2 presents the proposed methodology. The detected M3), respectively, toisdemonstrate real-time performance. result according to the MIT-BIH Arrhythmia Database using the proposed method is demonstrated result according to the MIT-BIH Arrhythmia Database using proposedmethodology. method is demonstrated The paper is organized as follows. Section 2 presents thethe proposed The detected in Section 3. Section 4 presents the implementation of the proposed method on a mobile phone and in Section 3. to Section 4 presentsArrhythmia the implementation of the proposed method on a mobile phone and resultan according the MIT-BIH Database using the proposed method is demonstrated embedded system, as well as the comparison with a heart rate sensor product. Section 5 is the an embedded system, as well as the comparison with a heart rate sensor product. Section 5 is the in Section 3. Section 4 presents the implementation of the proposed method on a mobile phone conclusion. conclusion. and an embedded system, as well as the comparison with a heart rate sensor product. Section 5 is 2. Methodology the conclusion. 2. Methodology The procedure of the proposed QRS detection and R point recognition method can be divided

The procedure of the proposed QRS detection and R point recognition method can be divided 2. Methodology into four steps, as shown in Figure 3. The detailed process for each step is as follows. into four steps, as shown in Figure 3. The detailed process for each step is as follows.

The procedure of the proposed QRS detection and R point recognition method can be divided into four steps, as shown in Figure 3. The detailed process for each step is as follows.

Sensors Sensors 2017, 2017, 17, 17, 1969 1969

33 of of 19 19

Refreshment of the ECG signal interval, which includes at least a complete cardiac cycle

Sensors 2017, 17, 1969 Sensors 2017, 17, 1969

3 of 19 3 of 19

Refreshment of the ECG signal interval, which includes at least a complete cardiac Refreshment of the ECG signal interval, cycle Enhancement segments and which includesof at the leastQRS a complete cardiac restrainingcycle P and T waves Enhancement of the QRS segments and restraining P and T waves Enhancement of the QRS segments and restraining and fiducial T waves point Detection of the PQRS

according to the detected crests and troughs Detection of the QRS fiducial point according to the detected crests and troughs Detection of the QRS fiducial point according to the detected crests and troughs

Recognition of the reasonable R point based on 4 QRS waveform templates

Figure 3. The procedures of

Recognition of the reasonable R point based on 4 QRS waveform templates Recognition of the reasonable R point based and R R point point recognition recognition method. method. the proposed real-time QRS detection and on 4 QRS waveform templates

Figure 3. The procedures of the proposed real-time QRS detection and R point recognition method.

2.1. Refreshment Refreshment ofThe the procedures ECG Signal Signal Figure 3. of the proposed real-time QRS detection and R point recognition method. 2.1. of the ECG 2.1. Refreshment of the ECG Signal

In most most ECG ECG devices, devices, the the monitoring monitoring heart rate range is from 240 beats per minute (bpm); In from3030 30toto to 240 beats minute (bpm); 2.1. Refreshment of the ECG Signal In most ECG devices, the monitoringheart heartrate rate range range isisfrom 240 beats perper minute (bpm); therefore, there is at least one complete cardiac cycle within a two-second time interval. For this therefore, there there is at least cardiac cyclecycle within a two-second timetime interval. ForFor thisthis reason, therefore, isdevices, at one leastcomplete onemonitoring complete cardiac within a two-second interval. In most ECG the heart rate range is from 30 to 240 beatsand per minute (bpm); reason, a sliding window of two seconds is used to capture the ECG signal the obtained ECG a sliding window of two seconds is seconds used toiscapture ECG signal theand obtained ECG ECG signal is reason, a sliding two usedcycle to the capture ECG and signal obtained therefore, there iswindow at least of one complete cardiac withinthe a two-second time the interval. For this signalsignal is refreshed every second, as shown is refreshed every second, shownin Figure 4. 4. refreshed every second, as shown inas Figure 4.inFigure reason, a sliding window of two seconds is used to capture the ECG signal and the obtained ECG signal is refreshed every second, as shown in Figure 4. Signalwindow window at Signal at time timet t Signal window at time t

t-3

t-3

t-2

t-1

t

Signal Sequence

t-3 t-2 t-1 Signal window at time t-1

t

Signal Sequence

t-2

t-1

t

Signal Sequence

Signal window at time t-1 Signal window t-1signal refreshment. Figureat4.time ECG

Figure 4. ECG signal refreshment. Figure 4. ECG signal refreshment.

2.2. Signal Enhancement

Figure 4. ECG signal refreshment.

2.2. Signal Enhancement 2.2. Signal Enhancement 2.2. Signal Enhancement In a normal sinus rhythm (NSR), the QRS wave usually has a sharp shape in lead II, as shown In a normal sinus rhythm (NSR), the QRS wave usuallyECG has recorder a sharp shape inmotion lead II, as shown in a Figure 2. However, for a wearable such as a usually 24-hour (holter), artifacts In normal sinus rhythm (NSR), the wave usuallyhas hasa asharp sharp shape in lead as shown In a normal sinus rhythm (NSR),device theQRS QRS wave shape in lead II, asII, shown in Figure 2. However, for a wearable device such as a 24-h ECG recorder (holter), motion artifacts and abnormal rhythms bring about baseline wandering, amplitude variation, and atypical in Figure 2. However, a wearabledevice devicesuch such as aa 24-hour recorder (holter), motion artifacts in Figure 2. However, forfor a wearable 24-hourECG ECG recorder (holter), motion artifacts and abnormal rhythms bringproposed about baseline wandering, amplitude variation, and atypical waveforms. waveforms. Thisrhythms study a signal transformation procedure, as shown inand Figure 5, to abnormal bringabout about baseline wandering, atypical and and abnormal rhythms bring baseline wandering, amplitude amplitudevariation, variation, and atypical eliminate motion artifact effects, and enhance the QRS segments, as well as shown restrain Peliminate and T waves. This study proposed astudy signal transformation procedure, as shown in Figure 5, toin waveforms. proposed signal transformation transformation procedure, as Figure 5, motion to 5, to waveforms. ThisThis study proposed a asignal procedure, as shown in Figure The refreshed signalthe is filtered using a band-pass filter withasPa well bandwidth between 0.5 and 17ECG artifact effects, andECG enhance QRS segments, as well as restrain and T waves. The refreshed eliminate motion artifact effects, and enhance the QRS segments, as restrain P and T waves. eliminate motion artifact effects, andartifacts. enhance the QRS segments, as well as restrain P and T waves. Hz to eliminate noise and motion signalThe is filtered using asignal band-pass filter witha aband-pass bandwidth 0.5 and 17between Hz to eliminate refreshed ECG is filtered using filterbetween with a bandwidth 0.5 and 17noise The refreshed ECG signal is filtered using a band-pass filter with a bandwidth between 0.5 and 17 Hz to eliminate and motion artifacts.noise and motion artifacts. Hz to eliminate noise and motion artifacts. Filtering the refreshed ECG signal

Filtering the refreshed ECG signal

Filtering the refreshed ECG signal

Applying an enhancement mask to the filtered signal Applying an enhancement mask to theenhancement filtered signal mask to Applying an

the filtered signal Normalizing the masked ECG signal Normalizing the masked ECG signal Figure 5. Signal transform procedure.

Normalizing the masked ECG signal

Figure5.5.Signal Signal transform transform procedure. Figure procedure.

Figure 5. Signal transform procedure.

Sensors 2017, 17, 1969

4 of 19

Then, the 17, enhancement of the QRS segment whilst restraining P and T waves is achieved by Sensors 2017, 1969 4 of 19 applying the following mask: k Then, the enhancement of the QRS segment whilst restraining P and T waves is achieved by S(n) = ∑ M(k + j) E(n + j) applying the following mask:

(1)

j=−k k



(n)  and:M (k  j ) E (n  j ) where M represents the enhancementSmask

(1)

j  k



 n) =and: −1, n = 0 ∼ k − 1 where M represents the enhancement  M(mask

(2) M(n) = 2 ∗ k, n = k  (n)  1, n  0 ~ k  1  M(M  n) = −1, n = k + 1 ∼ 2k (2)  M ( n)  2 * k , n  k M (n)  1, n  k  1 ~ 2k E represents the filtered ECG signal and S represents the masked ECG signal. The zero sum of M’s entries will eliminate baseline wandering. Subsequently, the QRS amplitude variation is eliminated by E represents the filtered ECG signal and S represents the masked ECG signal. The zero sum of normalizing the masked ECG signal to 1. M’s entries will eliminate baseline wandering. Subsequently, the QRS amplitude variation is Figure 6 demonstrates three examples of different ECG rhythms provided by the MIT-BIH eliminated by normalizing the masked ECG signal to 1. arrhythmia database using k = 1, where the annotation N represents normal sinus (NSR), Figure 6 demonstrates three examples of different ECG rhythmsaprovided by therhythm MIT-BIH arrhythmia database using k=1, where the annotation represents sinus a rhythm (NSR),branch V V represents a premature ventricular contract rhythmN(PVC), andaLnormal represents left bundle a premature ventricular contract rhythm (PVC),ECG and Lsignal represents a left bundle branch blockrepresents rhythm (LBBB). Figure 6a,c,e illustrate the filtered of Record 114, 108, and 111 block respectively, rhythm (LBBB). Figure 6a, pass 6c and 6e illustrate signal of Record 114,114 108, and segments, using a low filter with a 40the Hzfiltered cutoff ECG frequency. The Record segment is 111 segments, respectively, using a low pass filter with a 40 Hz cutoff frequency. The Record of NSR and PVC rhythms. The transform result shown in Figure 6b illustrates a restraining of 114 P and T segment is of NSR and PVC rhythms. The transform result shown in Figure 6b illustrates a restraining waves and an enhancement of QRS complexes. The Record 108 segment is of an atypical NSR rhythm, of P and T waves and an enhancement of QRS complexes. The Record 108 segment is of an atypical which contains bigger P waves and inverse QRS complexes. The transformed result demonstrates NSR rhythm, which contains bigger P waves and inverse QRS complexes. The transformed result that the T waves are bigger Pwhile waves andPQRS segments enhanced, as shown in demonstrates thatrestrained, the T waveswhile are restrained, bigger waves and QRS are segments are enhanced, Figure 6d. The Record 111 segment is of an LBBB rhythm, which contains fork-like QRS complexes as shown in Figure 6d. The Record 111 segment is of an LBBB rhythm, which contains fork-like QRS and relatively waves. Figure 6e shows that6e theshows fork-like complexes enhanced complexes tall andTrelatively tall T waves. Figure that QRS the fork-like QRSare complexes arewhile enhanced retaining P and T waves. retaining P andwhile T waves. Inabove the above examples, mostofofPPand andTTwaves waves are QRS segments are enhanced In the examples, most are restrained restrainedand and QRS segments are enhanced by the proposed signal transformation. Besides, the amplitudes in the transformed signal are also by the proposed signal transformation. Besides, the amplitudes in the transformed signal are also normalized to 1 to eliminate the amplitude difference from person to person. As a result, the crests normalized to 1 to eliminate the amplitude difference from person to person. As a result, the crests and troughs can be detected using static thresholds. and troughs can be detected using static thresholds.

(a)

(b)

(c)

(d) Figure 6. Cont.

SensorsSensors 2017, 2017, 17, 1969 17, 1969

5 of 19

5 of 19

(e)

(f)

Figure 6. Signal enhancementusing usingthe theproposed proposed transformation. Filtered ECGECG signal of theof the Figure 6. Signal enhancement transformation.(a)(a) Filtered signal Record 114 segment; (b) Transformed signal of the 114 Record 114 by segment by thetransformation; proposed Record 114 segment; (b) Transformed signal of the Record segment the proposed transformation; (c) Filtered ECG signal of the Record 108 segment; (d) Transformed signal of the (c) Filtered ECG signal of the Record 108 segment; (d) Transformed signal of the Record 108 segment Record 108 segment by the proposed transformation; (e) Filtered ECG signal of the Record 111 by the proposed transformation; (e) Filtered ECG signal of the Record 111 segment; (f) Transformed segment; (f) Transformed signal of the Record 111 segment by the proposed transformation. signal of the Record 111 segment by the proposed transformation.

2.3. The QRS Fiducial Point Detection

2.3. The QRS Fiducial Point Detection

For a typical lead II ECG waveform as shown in Figure 2, the feature intervals, such as the PR interval, QRS lead duration, QRS amplitude, QT ininterval, Therefore, For a typical II ECG waveform as and shown Figure have 2, thenormal featureranges. intervals, such asthe the PR searching range is defined as 0.3 seconds and the minimum amplitude detecting the QRS the complex interval, QRS duration, QRS amplitude, and QT interval, have normalfor ranges. Therefore, searching as 0.5 this the study. rangeisisdefined defined as mV 0.3 sinand minimum amplitude for detecting the QRS complex is defined as If the magnitude range of the refreshed ECG signal segment is higher than 0.5 mV, the procedure 0.5 mV in this study. shown in Figure 7 will activate to detect the QRS fiducial point. Due to the transformed signal being If the magnitude range of the refreshed ECG signal segment is higher than 0.5 mV, the procedure normalized to 1, a positive threshold of 0.22 is used to detect the crests, and a negative threshold of shown will activate to detect the QRSThe fiducial point. Due to the transformed signal 0.2inis Figure used to7detect the troughs, respectively. first instance of a transformed ECG signal of abeing normalized to 1, a positive threshold of 0.22 is used to detect the crests, and a negative threshold of value higher than the positive threshold is marked as the starting point for QRS detection.

−0.2 is used to detect the troughs, respectively. The first instance of a transformed ECG signal of a  Case I: value higher than the positive threshold is marked as the starting point for QRS detection. •







If only one crest and only one trough exist within the specified searching range (0.3 s), the corresponding to the crest is defined as the QRS fiducial point and search for the next Caseinstance I: starting point after the detected trough. If only one crest and only one trough exist within the specified searching range (0.3 s), the instance  Case II: corresponding to the crest is defined as the QRS fiducial point and search for the next starting If two crests are within the searching range and one trough exists between the crests, then the pointtrough after the detected trough. is defined as the QRS fiducial point and search for the next starting point from 0.12 s after Casethe II: detected trough is for. It is noted that a normal QRS waveform has a duration of 0.12 s. If crests  two Case III: are within the searching range and one trough exists between the crests, then the If there is onlyas one crest with a valuepoint higher than another of 0.52 within searching trough is defined the QRS fiducial and search forthreshold the next starting pointthe from 0.12 s after range, then the crest is defined as the QRS fiducial QRS pointwaveform and search has for the next starting point the detected trough is for. It is noted that a normal a duration of 0.12 s. from 0.12 s after the detected crest. This case is a special case which can be referred to the MITCase III: BIH arrhythmia database Record 104 and 107. If there is only one crest with a value higher than another threshold of 0.52 within the searching  Case IV (Case otherwise): range, then the crest is defined as the QRS fiducial point and search for the next starting point If it is not case I, case II, or case III, then search for the next starting point corresponding to the fromnext 0.12crest. s after the detected crest. This case is a special case which can be referred to the MIT-BIH

arrhythmia database Record 104 and 107. Figure 8 demonstrates the detailed detection procedures of the example shown in Figure 6b. For Case IV (Case otherwise): the starting point at 338.1 s, there is only one crest and only one trough within the searching range, If is not I, caseas II,aor case III, then search for next the next starting corresponding soitthe crestcase is defined QRS fiducial point. For the starting point point at 339.5 s, there are twoto the next crestscrest. within the searching range and one trough exists between the crests, so the trough is defined as the QRS fiducial point.

Figure 8 demonstrates the detailed detection procedures of the example shown in Figure 6b. Figure 9 demonstrates the detailed detection procedures of the example shown in Figure 6d. For For the at 1338.1 s, there only one crestand andtwo only one trough the searching thestarting starting point point at second, thereisare three crests troughs within within the searching range, sorange, so thethat crest defined as aisQRS fiducial point. For point the next starting point at detection 339.5 s, there are two crests theisstarting point redefined as the starting of the next crest. The corresponding within searching range and one trough exists crests, so the trough is defined to the the starting point of the next crest is similar to between that of thethe starting point at 2.1 s. In this example,as the QRS fiducial point. Figure 9 demonstrates the detailed detection procedures of the example shown in Figure 6d. For the starting point at 1 s, there are three crests and two troughs within the searching range, so that the starting point is redefined as the starting point of the next crest. The detection corresponding to

Sensors 2017, 17, 1969

6 of 19

Sensors 2017, 17, 1969

6 of 19

Sensors 2017, 17, 1969

6 of 19

theQRS starting point of the crest is similar to that of the point 2.1 s. the In this example, QRS points arenext determined effectively in the QRSstarting segment, evenatunder influence of Sensorsfiducial 2017, 17, 1969 6 ofbig 19 fiducial points are determined effectively in the QRS segment, even under the influence of big P waves. P waves. QRS fiducial points are determined effectively in the QRS segment, even under the influence of big QRS fiducial points are determined effectively in the QRS segment, even under the influence of big P waves. Refresh transformed signal P waves. Y

(2 s) Refresh transformed signal (2 s) Refresh transformed signal

N

(2 s)

Y ? Signal end Y Signal end ?

N N

N

Starting point ?

Signal end ?

N

Starting point ? Y Starting point ?

N

Y of crests Detect the numbers and troughs Y Detect the numbers of crests and troughsof crests Detect the numbers and troughs Case I ?

Y

Assign the crest as a QRS fiducial Point Assign the crest as a QRS Point Assignfiducial the crest as a QRS

Y

Case I ? N Case I ? N Case II ? N Case N II ?

Y

fiducial Pointexists Assign the trough between the crests as a Assign trough exists QRS the fiducial Point between crestsexists as a Assign thethe trough QRS fiducial Point between the crests as a

Y Y Y

Case II ? N

QRSthe fiducial Point Assign crest as a QRS fiducial Point Assign the crest as a QRS Point Assignfiducial the crest as a QRS

Y

Case III N ?

Y Case III ? N (Case IV)Y Case III ? N (Case IV)

fiducial Point

Figure of detecting detectingthe theQRS QRSfiducial fiducialpoint. point. Figure7.7.The Theproposed proposed procedure of N (Caseprocedure IV) Figure 7. The proposed procedure of detecting the QRS fiducial point. Record114 Segment Figure 7. The proposed procedure of detecting the QRS fiducial point.

mV mV mV

1

1 0.5 1 0.5 0 0.5 0 -0.5 0 -0.5 -1 -0.5 -1 -1.5 -1337

Positive threshold Positive threshold Positive Negative threshold threshold Negative threshold Negative threshold

-1.5 337 -1.5 Figure 337 8. The

C1 Record114 Segment Starting Point Searching C1 (Case I) Record114 Segment Range Starting Point C1 Searching (Case I) Range Starting Point Searching (Case I) Range T1

Starting Point (Case I ) Starting Point (Case I ) Starting Point (Case I )

N

337.5 337.5 demonstration of

C1 C2 T1

T1

T1

V T1

T1 339 V T1 339 V

V T1 339.5 V 339.5

V

T1

337.5

C1 Starting Point (Case II) C1 Starting Point C1 C2 (Case II) C1 Starting Point C1 C2 (Case II)

N 338 N 338

338.5 sec 338.5 sec 338 fiducial 338.5 QRS point sec

N N

340

N 340

339for the Record 339.5 114 segment. 340 detection

Figure8.8.The Thedemonstration demonstration of of QRS QRS fiducial 114 segment. Figure fiducial point pointdetection detectionfor forthe theRecord Record 114 segment. Record108 Segment Figure 8. The demonstration of QRS fiducial point detection for the Record 114 segment. 1

mV mV mV

0 1 0.5 -0.5 0 0.5 -1 0 -0.5 -1.5 -0.5 -1 -2 -1 -1.5

-2.5

0

0

T1

N

N

-2.5 -2 0 -1.5 -2.5 -2

C1 C2 Searching Range C1 C2 Searching Range C1 C2 Searching Range

C3 Positive Starting Point C1 C2 Starting Point Record108 Segment threshold (Case IV) (Case II) C3 Starting Point C2 Positive C1 Record108 Segment Starting Point threshold (Case IV) (Case II) Positive Starting Point C1 C2 C3 Negative Starting Point threshold (Case IV) T1 threshold (Case II) Negative T1 threshold Negative T1 T2 threshold

0.5 1

N

T2

N N

0.5

1

0.5

1

0.5

1

N

T2

N

Figure 9. The demonstration of QRS fiducial

N

N

T1

1.5 sec 1.5 sec 1.5 point sec

2 2 2

N T1

N

2.5

3

2.5

3

2.5

3

N

N

N

N

detection for the Record 108 segment.

Figure 9. The demonstration of QRS fiducial point detection for the Record 108 segment. Figure 10 demonstrates the detailed procedures the example shown in Figure 6f. Figure 9.9.The of fiducial point point detectionof for the Record 108 segment. Figure Thedemonstration demonstration of QRS QRSdetection fiducial detection for the Record 108 segment.

For the starting point at the first at 182.9procedures seconds, there is no secondshown crest and second Figure 10 demonstrates thedetected detailedcrest detection of the example in no Figure 6f. Figure 10 demonstrates thedetected detailedcrest detection of the example in no Figure 6f. For the starting point at the first at 182.9procedures seconds, there is no secondshown crest and second For the starting point at the first detected crest at 182.9 seconds, there is no second crest and no second

Sensors 2017, 17, 1969

7 of 19

Sensors2017, 2017,17, 17,1969 1969 Sensors

19 77ofof19

Figure 10 demonstrates the detailed detection procedures of the example shown in Figure 6f. trough,so sothe thestarting startingpoint pointisisredefined redefinedas asthe thestarting startingpoint pointof of thenext nextcrest. crest.Subsequently, Subsequently,case caseII trough, For the starting point at the first detected crest at 182.9 s, there is nothe second crest and no second trough, will be applied and C2 becomes the QRS fiducial point. A similar case is also illustrated at 183.7 s.ItIt will bestarting applied point and C2 fiducialpoint point.ofAthe similar also illustratedcase at 183.7 so the is becomes redefinedthe as QRS the starting next case crest.is Subsequently, I wills.be should benoted notedthat thatthe thedetected detectedQRS QRSfiducial fiducialpoint pointin inthe thetransformed transformedsignal signalmay maynot not correspond should appliedbe and C2 becomes the QRS fiducial point. A similar case is also illustrated at 183.7 correspond s. It should to the real R point in the ECG signal and an R point recognition procedure is described as the the to real R the point in theQRS ECGfiducial signalpoint and in anthe R point recognition is described as be the noted that detected transformed signalprocedure may not correspond to the real following. following. R point in the ECG signal and an R point recognition procedure is described as the following. 1 1 0.5 0.5

Record111 Segment Record111 Segment

C2 C2

StartingPoint Point Starting (CaseIV) IV) Searching (Case C1Searching Positive C1 Range Positive Range threshold threshold

StartingPoint Point C1 Starting C1 (CaseI)I) (Case

mV mV

0 0 -0.5 -0.5

L L

Negative Negative threshold threshold

-1 L -1 L 182 182

T1 T1

T2 T2

T1 T1 L L

182.5 182.5

L L

183 183

L L

183.5 183.5 sec sec

184 184

184.5 184.5

185 185

Figure10. 10.The Thedemonstration demonstrationof ofQRS QRSfiducial fiducialpoint pointdetection detectionfor forthe theRecord Record111 111segment. segment. Figure 10. The demonstration of QRS fiducial point detection for the Figure

2.4.Recognition Recognitionof theR Point 2.4. Recognition ofofthe the RRPoint Point To recognize recognize aa reasonable reasonable RR point point according according to to the the detected detected QRS QRS fiducial fiducial point, point, four four QRS QRS To four QRS waveform templates are proposed, as shown in Figure 11. The strategy of finding those features waveform waveform templates templates are proposed, as shown in Figure 11. The The strategy strategy of of finding finding those those features features includes first searching for the S point from the fiducial QRS point, then searching for the Ra, Q,and and includes first first searching for the S point from the fiducial QRS point, then searching for the Ra, Q, R points successively, where Ra is the approximate R point, in order to find a reasonable R point. The R approximate R point, in order to find a reasonable R point. The R points pointssuccessively, successively,where whereRa Raisisthe the approximate R point, in order to find a reasonable R point. details ofeach each stepstep areas asfollows. follows. details of step are The details of each are as follows. Ra,R Ra,R

Ra,R Ra,R

Ra,R Ra,R

Ra Ra QQ

QQ

QQ SS

(a) (a)

SS

Q Q

(b) (b)

SS

S,R S,R

(c) (c)

(d) (d)

Figure 11. QRS waveform templates of four desired recognition features: (a) normal QRS waveform; Figure11. 11.QRS QRSwaveform waveform templatesofoffour fourdesired desiredrecognition recognition features:(a) (a) normalQRS QRSwaveform; waveform; Figure (b) fork-like crests; (c) deeptemplates S wave with small R wave; (d) deep Sfeatures: wave with normal tiny or hidden R wave. (b)fork-like fork-likecrests; crests;(c) (c)deep deepSSwave wavewith withsmall smallRRwave; wave;(d) (d)deep deepSSwave wavewith withtiny tinyor orhidden hiddenRRwave. wave. (b)

2.4.1. S Point Detection 2.4.1.SSPoint PointDetection Detection 2.4.1. In general, a normal QRS segment range is less than 0.12 s. To identify the corresponding Q, R, Ingeneral, general,aanormal normalQRS QRSsegment segmentrange rangeisisless lessthan than0.12 0.12s.s.To To identifythe the corresponding Q, Q, R, and SInpoints for a given QRS fiducial point, it is reasonable to use identify a searching corresponding time interval span R, of and S points for a given QRS fiducial point, it is reasonable to use a searching time interval span of and points forat a given QRS fiducial point, it is detection reasonableprocedure to use a searching time 0.24 Ss centering the fiducial point. The S point is described as interval follows: span of 0.24sscentering centeringatatthe thefiducial fiducialpoint. point.The TheSSpoint pointdetection detectionprocedure procedureisisdescribed describedas asfollows: follows: 0.24

•  

Step 1:1: Step1: Step For a given QRS amplitude within thethe 0.24 s Foraagiven givenQRS QRSfiducial fiducialpoint, point,determine determinethe themaximum maximumand andaverage average amplitude within 0.24 For fiducial point, determine the maximum and average amplitude within the 0.24 searching span of the ECG signal. searchingspan spanof ofthe theECG ECGsignal. signal. sssearching Step2:2: Step Search aa crest crest of of amplitude amplitude higher higher than than one one half half of of the the maximum maximum amplitude amplitude after after the the QRS QRS Search fiducial point. fiducial point.

Sensors 2017, 17, 1969







8 of 19

Step 2: Search a crest of amplitude higher than one half of the maximum amplitude after the QRS fiducial point. Step 3: If there is a detected crest, the S start searching point is assigned as the detected crest. Otherwise, the S start searching point is assigned as the QRS fiducial point. Step 4: The S point is assigned as the point of amplitude less than the average amplitude with a local minimum slope after the S start searching point.

2.4.2. Ra Point Detection With a detected S point and its corresponding searching time span, the Ra point is determined according to the following. If there is at least one crest ahead of the detected S point with its amplitude higher than one half of the maximum within the searching range, the Ra point is assigned as the maximum amplitude point. Otherwise, the Ra point is assigned at the same point of S. 2.4.3. Q Point Detection With a detected Ra point and the corresponding searching time span, the Q point is identified by the following procedure.







Step 1: Search a crest of amplitude higher than one half of the maximum amplitude ahead of the detected Ra point. Step 2: If there is a detected crest, the Q start searching point is assigned as the detected crest. Otherwise, the Q start searching point is assigned as the Ra point. Step 3: The Q point is assigned as the point of amplitude less than the average amplitude with a local minimum slope ahead of the Q start searching point.

2.4.4. R Point Detection With detected Ra and S points, the R point is determined by the following rules:

• •



Case 1: If the Ra point and the S point are at the same position, then assign the R point at point S. Case 2: If the amplitude between the Ra point and the Q point is less than a quarter of the amplitude between Ra and S, then assign the R point at point S. Case 3: Otherwise, assign the R point at the Ra point.

3. Result and Discussion 3.1. QRS Detection and R Point Recognition Result Figure 12 illustrates the detected QRS fiducial points and the recognized feature points (Q, R, and S) of the three examples, based on the four proposed QRS waveform templates, shown in Figure 11. Figure 12a illustrates the correctly detected features defined in Figure 11a,c,d. Figure 12b illustrates the correctly detected features defined in Figure 11d. Figure 12c illustrates the correctly detected features defined in Figure 11c. The results in Figure 12 illustrate that different rhythms can be successfully recognized by the proposed method.

Sensors 2017, 17, 1969

9 of 19

Before implementing the algorithm in an embedded system, the time cost of each processing for the two-second length ECG signal from the MIT-BIH arrhythmia database (360 Hz) is evaluated Sensors 2017, 17, 1969 9 of 19 using Matlab in a Win 7 PC with Intel i5 dual core CPU. Through test runs of the above examples, the maximum time cost of processing once is less than 15 milliseconds and the average time cost of processing is less thanthan 6 milliseconds, which implies that the each processing is less 6 milliseconds, which implies that thealgorithm algorithmisisportable portablefor for aa real-time real-time embedded system. embedded system in Figure 13.

(a)

(b)

(c) Figure 12. The detected QRS fiducial points and R points using the proposed method: (a) recognized Figure 12. The detected QRS fiducial points and R points using the proposed method: (a) recognized feature points for the Record 114 segment; (b) recognized feature points for the Record 108 segment; feature points for the Record 114 segment; (b) recognized feature points for the Record 108 segment; (c) recognized feature points for the Record 111 segment. (c) recognized feature points for the Record 111 segment.

(c) Figure 12. The detected QRS fiducial points and R points using the proposed method: (a) recognized feature points Sensors 2017, 17, 1969 for the Record 114 segment; (b) recognized feature points for the Record 108 segment; 10 of 19 (c) recognized feature points for the Record 111 segment.

Sensors 2017, 17, 1969

(a)

10 of 19

(b)

(c) Figure 13. The time cost for processing each two-second length ECG signal: (a) Time cost of each Figure 13. The time cost for processing each two-second length ECG signal: (a) Time cost of each processing in Record 114; (b) Time cost of each processing in Record 108; (c) Time cost of each processing in Record 114; (b) Time cost of each processing in Record 108; (c) Time cost of each processing processing in Record 111. in Record 111.

3.2. Benchmarking Study Using MIT-BIH Arrhythmia Database 3.2. Benchmarking Study Using MIT-BIH Arrhythmia Database The MIT-BIH arrhythmia database contains 48 half-hour excerpts of two-channel ambulatory The MIT-BIH arrhythmia database contains 48 half-hour excerpts of two-channel ambulatory ECG recordings. The recordings were digitized at 360 samples per second per channel with an 11-bit ECG recordings. The recordings were digitized at 360 samples per second per channel with an 11-bit resolution over a 10 mV range [22]. The standard of ANSI/AAMI/ISO EC57:1998/(R)2008 claims that resolution over a 10 mV range [22]. The standard of ANSI/AAMI/ISO EC57:1998/(R)2008 claims that the QRS detection algorithm has to supply the reporting of statistics from the MIT-BIH arrhythmia the QRS detection algorithm has to supply the reporting of statistics from the MIT-BIH arrhythmia database [23]. database [23]. To evaluate the performance of the proposed method, the commonly used detector performance To evaluate the performance of the proposed method, the commonly used detector performance measures are applied and defined as follows. measures are applied and defined as follows. Sensitivity (Se) indicates the fraction of events which are detected: Sensitivity (Se) indicates the fraction of events which are detected: 𝑇𝑃 (3) Se = TP × 100% Se = 𝑇𝑃 + 𝐹𝑁 × 100% (3) TP + FN Positive prediction (+P) represents the fraction of detections, which are events: +P = And the detection error rate (DER):

𝑇𝑃 × 100% 𝑇𝑃 + 𝐹𝑃

(4)

Sensors 2017, 17, 1969

11 of 19

Positive prediction (+P) represents the fraction of detections, which are events:

+P =

TP × 100% TP + FP

(4)

FP + FN × 100% TP + FN

(5)

And the detection error rate (DER): Der =

where TP is the number of True Positive beats (correctly detected), FN is the number of False Negative beats (erroneously missed), and FP is the number of False Positive beats (erroneously detected) [23]. For comparison, the heart beats information in the annotation file of each recording is read for reference using the WFDB tool [24]. During a beat-by-beat comparison, reference beat labels in the annotation file and detected R points are matched by pairs. A match case is counted where the absolute value of the time difference between the detected R point and the reference is less than 150 ms [23]. Table 1 is the resulting performance of the proposed algorithm tested by the MLII lead and V5 lead of all 48 recordings in the MIT-BIH arrhythmia database. Segments of data in which ventricular flutter or fibrillation (VF) is present are only excluded from beat-by-beat comparisons (for QRS and VEB detection) [23]. A total of 109,443 beats were tested in total and Se is 99.82%, + P is 99.81%, and Der is 0.36% when applying the proposed method. Table 2 reports the performance of the proposed method in different rhythms using the annotation files of the MIT-BIH arrhythmia database. The QRS detection sensitivity of the PVC rhythms is 98.95%, which is sufficient for mobile health applications. Table 1. Performance of the proposed method using the single channel of the MIT-BIH arrhythmia database. No.

Lead

Se%

+P%

DER%

TB

FN

FP

100 101 102 103 104 105 106 107 108 109 111 112 113 114 115 116 117 118 119 121 122 123 124 200 201 202 203

MLII MLII V5 MLII V5 MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII

100.00 99.89 100.00 100.00 99.64 99.53 100.00 99.81 99.38 99.92 99.95 100.00 100.00 100.00 100.00 99.38 100.00 100.00 100.00 99.89 100.00 100.00 100.00 99.92 99.29 99.86 98.79

100.00 99.79 100.00 100.00 99.11 98.84 99.95 100.00 98.21 100.00 99.91 99.96 100.00 100.00 100.00 99.75 100.00 99.91 100.00 100.00 100.00 100.00 100.00 99.35 100.00 99.95 99.06

0.00 0.32 0.00 0.00 1.25 1.61 0.05 0.19 2.40 0.08 0.14 0.04 0.00 0.00 0.00 0.87 0.00 0.09 0.00 0.11 0.00 0.00 0.00 0.73 0.71 0.19 2.13

2271 1864 2186 2083 2228 2571 2026 2136 1762 2531 2123 2538 1793 1878 1952 2411 1534 2277 1986 1862 2475 1517 1618 2600 1962 2135 2979

0 2 0 0 8 12 0 4 11 2 1 0 0 0 0 15 0 0 0 2 0 0 0 2 14 3 36

0 4 0 0 20 30 1 0 32 0 2 1 0 0 0 6 0 2 0 0 0 0 0 17 0 1 28

Sensors 2017, 17, 1969

12 of 19

Table 1. Cont. No.

Lead

Se%

+P%

DER%

TB

FN

FP

205 207 208 209 210 212 213 214 215 217 219 220 221 222 223 228 230 231 232 233 234 Total

MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII MLII

99.74 99.62 99.46 99.97 98.94 100.00 99.91 99.96 100.00 99.91 100.00 100.00 99.84 99.76 99.96 99.81 100.00 100.00 100.00 99.97 100.00 99.82

99.96 99.36 99.76 99.93 99.81 100.00 100.00 99.96 100.00 99.95 99.91 100.00 100.00 100.00 100.00 98.99 99.91 100.00 99.72 100.00 100.00 99.81

0.30 1.02 0.78 0.10 1.24 0.00 0.09 0.09 0.00 0.14 0.09 0.00 0.16 0.24 0.04 1.21 0.09 0.00 0.28 0.03 0.00 0.36

2655 1859 2954 3004 2649 2747 3249 2261 3362 2207 2153 2047 2426 2482 2604 2052 2255 1570 1779 3078 2752 109,443

7 7 16 1 28 0 3 1 0 2 0 0 4 6 1 4 0 0 0 1 0 193

1 12 7 2 5 0 0 1 0 1 2 0 0 0 0 21 2 0 5 0 0 203

Table 2. Performance during different rhythms using the MIT-BIH arrhythmia database. Rhythm Type

Symbol

TB

TP

FN

Se%

Normal beat Left bundle branch block beat Right bundle branch block beat Atrial premature beat Aberrated atrial premature beat Nodal (junctional) premature beat Supraventricular premature beat Premature ventricular contraction Fusion of ventricular and normal beat Atrial escape beat Nodal (junctional) escape beat Ventricular escape beat Paced beat Fusion of paced and normal beat Unclassifiable beat Total

N L R A A J S V F E J E / F Q

75,013 8072 7256 2544 150 83 2 7130 803 16 229 106 7024 982 33 109,443

74,939 8067 7256 2543 133 83 2 7055 795 16 229 106 7017 981 28 109,250

74 5 0 1 17 0 0 75 8 0 0 0 7 1 5 193

99.90 99.94 100.00 99.96 88.67 100.00 100.00 98.95 99.00 100.00 100.00 100.00 99.90 99.90 84.85 99.82

Table 3 reports the function and performance comparison of the proposed method with other methods reported from the original published papers using the MIT-BIH arrhythmia database. As shown in Table 3, five products lead to embedded applications. Among them, the proposed approach is the only product which recognizes four types of point R and is able to provide a preliminary heart rhythm classification in embedded devices. The comparison implies that the proposed real-time method has a high sensitivity (Se) and positive prediction (+P), but low detection error rate (DER). Furthermore, the proposed method not only detects the QRS waves, but also detects the R points in various waveforms with a very low computational effort, which is suitable for wearable device applications and meets the requirement for new generation ECG products.

Sensors 2017, 17, 1969

13 of 19

Table 3. Comparison of this study with other studies using the MIT-BIH arrhythmia database. Method

Types of Point R Recognized

The proposed approach Pan and Tompkins [5] Hamilton and Tompkins [6] Farashi [7] Phukpattaranont [8] Manikandan and Soman [9] Merah et al. [12] Cristov [14] (algorithm 2) Karimipour and Homaeinezhad [15] Dohare et al. [17] Sharma and Sunkaria [18] Yazdani and Vesin [21] Castells-Rufas and Carrabina [25] Jinkwon Kim and Hangsik Shin [26] DS Benitez et al. [27]

4 * * 2 2 1 1 * * 1 2 2 * * 1

Embed. App. Y Y Y N N N N N N N N Y Y N N

Se%

+P%

DER%

TB

TP

FN

FP

99.82 99.76 99.69 99.75 99.82 99.93 99.84 99.78 99.81 99.21 99.50 99.87 99.43 99.90 99.81

99.81 99.56 99.77 99.85 99.81 99.87 99.88 99.78 99.70 99.34 99.56 99.90 99.67 99.91 99.83

0.36 0.68 0.54 0.40 0.38 0.20 0.28 0.44 0.43 1.45 0.93 0.22 0.88 0.19 0.36

109,443 116,137 109,267 109,965 109,483 109,496 109,494 110,050 116,137 109,966 109,488 109,494 109,494 109,494 N/A

109,250 115,860 108,927 109,692 109,281 109,417 109,316 109,615 115,945 109,096 108,979 109,357 108,880 109,357 N/A

193 277 340 273 202 79 178 240 192 870 509 137 614 107 203

203 507 248 163 210 140 126 239 308 728 428 108 353 97 187

* Only QRS complexes detection.

4. Implementation 4.1. Implementation for a Mobile Phone The algorithm has been implemented in a windows mobile phone for a mobile healthcare system and is shown in Figure 14. The mobile phone has a 528 MHz CPU and a Bluetooth module to receive the ECG signal from a wearable ECG patch with a 120 Hz sampling rate, where the ECG patch is developed by the Industrial Technology Research Institute (ITRI). In the system, the graphic user interface (GUI) and proposed algorithm are coded by Microsoft Visual C++. The average time cost of running the proposed algorithm in the mobile phone is less than 1 milliseconds. To verify the stability of the proposed algorithm, the implementation of daily ECG and heartrate monitoring are carried out Sensors 2017,in 17,Figure 1969 14 of 19 as shown 15.

Figure Figure 14. 14. The Thegraphic graphicuser userinterface interface and and algorithm algorithm implementation implementation for for aa mobile mobile healthcare healthcare system. system.

Sensors 2017, 17, 1969

14 of 19

Figure 14. The graphic user interface and algorithm implementation for a mobile healthcare system.

Figure 15. Implementation of daily ECG and heartrate monitoring using the proposed algorithm. algorithm.

4.2. Implementation in an AnEmbedded EmbeddedSystem System 4.2. Implementation in To implement implementthethe healthcare IoT system, an efficient low computational To healthcare IoT system, an efficient and lowand computational complexitycomplexity algorithm algorithm is necessary to reduce transition envelopes and save storage space. The proposed is necessary to reduce transition envelopes and save storage space. The proposed algorithm is algorithm is implemented in a wearable heart rate sensor developed by ITRI, shown in Figure implemented in a wearable heart rate sensor developed by ITRI, shown in Figure 16, which contains16, a which contains Corex-M3 runningofat24a frequency 24 MHz. Thecost average time cost running Corex-M3 MCUa running atMCU a frequency MHz. Theof average time of running theof proposed the proposed algorithm in the Cortex-M3 MCU less than 10 milliseconds. algorithm in the Cortex-M3 MCU is less than 10 is milliseconds. Sensors 2017, 17, 1969

15 of 19

Figure 16. The algorithm implementation in a wearable heart rate sensor. Figure 16. The algorithm implementation in a wearable heart rate sensor.

To demonstrate the resulting performance in a running activity, a market product of the Polar heart rate sensor [28] is used as an R-R interval (RRI) reference. There are 10 RRI data of 10 different persons running on the treadmill, which are collected by the proposed system and the Polar product at the same time. Figure 17 illustrates a good consistency between the results obtained by both systems. Table 4 shows that the max RRI difference is 2.3 ms and the average RRI difference of the 10 people is less than 1 ms, which demonstrates the flexibility of the proposed method to heart rate realtime detection.

Sensors 2017, 17, 1969

Figure 16. The algorithm implementation in a wearable heart rate sensor.

15 of 19

To demonstrate demonstrate the the resulting resulting performance performance in market product product of of the the Polar Polar To in aa running running activity, activity, aa market heart rate sensor [28] is used as an R-R interval (RRI) reference. There are 10 RRI data of 10 different heart rate sensor [28] is used as an R-R interval (RRI) reference. There are 10 RRI data of 10 different persons running running on on the the treadmill, treadmill, which which are are collected collected by by the the proposed proposed system system and and the the Polar persons Polar product product at the same time. Figure 17 illustrates a good consistency between the results obtained both at the same time. Figure 17 illustrates a good consistency between the results obtained by by both systems. Table 4 shows that the max RRI difference is 2.3 ms and the average RRI difference of the 10 systems. Table 4 shows that the max RRI difference is 2.3 ms and the average RRI difference of the people is less than 1 ms, which demonstrates the flexibility of the method to heart rate real10 people is less than 1 ms, which demonstrates the flexibility ofproposed the proposed method to heart rate time detection. real-time detection.

Figure 17. A sample R-R Interval curves.

Table 4. The average R-R interval of 10 test cases.

ID

ID

(This Study) Average (This Study) Average RRI (ms) RRI (ms)

(Polar Difference (PolarOutput) Output) Average Difference (ms) AverageRRI RRI (ms) (ms) (ms)

P201009271648 P201009271648 P201011171707 P201011171707 P201011161440 P201011161440 P201011171720 P201011171149 P201011171720 P201011171731 P201011171149 P201011171742 P201011171731 P201011171805 P201011231627 P201011171742 P201011241604 P201011171805 P201011231627 P201011241604 4.3. A Study Case of Walking

489 489 0.8 488.2 488.2 0.8 499.6 499.6 0 499.6 499.6 0 514.4 515 0.6 514.4 457.3 515 0.6 457.8 0.5 428457.8 2.3 457.3 425.7 0.5 528.7 529.4 0.7 425.7 419.8 2.3 420.4428 0.6 528.7 437.9 0.7 438.9529.4 0.9 424.6420.4 0.5 419.8 424.1 0.6 423.1 423.6 0.5 437.9 438.9 0.9 Average Difference 0.74 424.1 424.6 0.5 423.1 423.6 0.5 Average Difference 0.74 The motion artifact issue has been taken into consideration in this study. The testing database, MIT-BIH arrhythmia database, was recorded from an ambulatory ECG device and the testing results using the proposed algorithm have been listed in Tables 1 and 3. Furthermore, in our clinical study data using the wearable ECG device mentioned in the article, a study case of ‘walking’ is suitable to demonstrate the noise immunity of the proposed method. In the study case of walking, a man remains static in the first 20 s and starts walking in the following 100 s. The signal processing results using the proposed method are demonstrated in Figures 18 and 19. The results of QRS detection, R point recognition, and the calculated heart rate curve are demonstrated in Figure 20. In order to evaluate the noise immunity of the proposed method, we have used the SNR improvement measure given by:

"

SNRimp [dB] = SNRoutput − SNRinput

2

∑ | Xn (i ) − X (i )| = 10 log i 2 ∑i | Xd (i ) − X (i )|

# (6)

where X denotes the clean ECG, Xd is the denoised signal, and Xn represents the noisy ECG [29]. In this study, we assign:

curve are demonstrated in Figure 20. In order to evaluate the noise immunity of the proposed method, we have used the SNR improvement measure given by: ∑𝑖|𝑋𝑛 (𝑖) − 𝑋(𝑖)|2 𝑆𝑁𝑅𝑖𝑚𝑝 [dB]=𝑆𝑁𝑅𝑜𝑢𝑡𝑝𝑢𝑡 − 𝑆𝑁𝑅𝑖𝑛𝑝𝑢𝑡 = 10 log [ ] ∑𝑖|𝑋𝑑 (𝑖) − 𝑋(𝑖)|2 Sensors 2017, 17, 1969

(6) 16 of 19

where 𝑋 denotes the clean ECG, 𝑋𝑑 is the denoised signal, and 𝑋𝑛 represents the noisy ECG [29]. In this study, we assign: X: the filtered signal in static 𝑋: the filtered signal in static Xd : the filtered signal in walking 𝑋 : the filtered signal in walking Xn𝑑: the raw signal in walking 𝑋𝑛 : the raw signal in walking

The is around around 3.53 3.53 dB. dB. In In practice, practice, ininorder ordertotoavoid avoidtoo toomuch much The average average SNR SNR improvement improvement is computing effort during the de-noise process, we also use a well-designed fixing mechanism to reduce computing effort during the de-noise process, we also use a well-designed fixing mechanism to the motion the proposed is thus sufficient process signals for the reduce theartifact, motionand artifact, and thealgorithm proposed algorithm is to thus sufficient tosatisfactory process signals 120 test clinical satisfactory for study. the 120 test clinical study.

Sensors 2017, 17, 1969

Figure 18. The algorithm implementation in a wearable heart rate sensor. Figure 18. The algorithm implementation in a wearable heart rate sensor.

Figure 19. The signal processing results from 15 to 40 s. Figure 19. The signal processing results from 15 to 40 s.

17 of 19

Sensors 2017, 17, 1969

17 of 19

Figure 19. The signal processing results from 15 to 40 s.

Figure 20. 20. The The results results of Figure of QRS QRS detection, detection, RR point pointrecognition, recognition,and andheart heartrate ratecurve. curve.

5. Conclusions 5. Conclusions A real-time QRS detection and R point recognition method for a wearable single lead ECG device A real-time QRS detection and R point recognition method for a wearable single lead ECG was proposed, which consisted of a signal transform, QRS fiducial point detection, and R point device was proposed, which consisted of a signal transform, QRS fiducial point detection, and R point recognition. The proposed method is robust and insensitive to baseline wandering, amplitude recognition. The proposed method is robust and insensitive to baseline wandering, amplitude variation, variation, and atypical QRS waveforms. Verification using the MIT-BIH arrhythmia benchmark and atypical QRS waveforms. Verification using the MIT-BIH arrhythmia benchmark demonstrates that demonstrates that the detected sensitivity (Se), positive prediction (+P), and detection error rate the detected sensitivity (Se), positive prediction (+P), and detection error rate (DER) of the proposed (DER) of the proposed method are as good as those reported during existing approaches. The motion method are as good as those reported during existing approaches. The motion artifact issue has artifact issue has been taken into consideration in this study. The testing database, MIT-BIH been taken into consideration in this study. The testing database, MIT-BIH arrhythmia database, was arrhythmia database, was recorded from an ambulatory ECG device and testing results using the recorded from an ambulatory ECG device and testing results using the proposed algorithm have been proposed algorithm have been listed in Tables 1 and 3. A study case of ‘walking’ is also demonstrated. listed in Tables 1 and 3. A study case of ‘walking’ is also demonstrated. In practice, in order to avoid too In practice, in order to avoid too much computing effort during the de-noise process, we also use a much computing effort during the de-noise process, we also use a well-designed fixing mechanism to well-designed fixing mechanism to reduce the motion artifact, and the proposed algorithm is thus reduce the to motion artifact, and the proposed is clinical thus sufficient to process signals sufficient process signals satisfactory for algorithm the 120 test study. In conclusion, the satisfactory proposed for the 120 test clinical study. In of conclusion, the proposedon method meets theor requirement of real-time method meets the requirement real-time applications a mobile phone an embedded system applications on a mobile phone or an embedded system for new-generation ECG devices, owing to its computational simplicity and efficiency. The real time performance of the proposed work is shown in Table 5, where implanted platforms with corresponding processing times are provided in detail. This work is the only one among the references in Table 3 that provides quantitative data as a benchmark for further studies. Table 5. Implanted platforms with the corresponding processing times demonstrated in this study. Functions

QRS complex detection, features detection (Q, R, S), 4 types of point R recognition

Data

Platform

Processing Time

Coding Tool

MIT-BIH arrhythmia database (360 Hz)

windows 7 PC with Intel i5 dual core CPU @ 2.5 GHz

Max < 15 ms Average < 6 ms

Matlab (not be optimized)

Real captured ECG signal (120 Hz)

windows mobile phone with 528 MHz CPU

Average < 1 ms

Visual Studio C++

Real captured ECG signal (120 Hz)

ARM Cortex-M3 MCU running in the frequency of 24 MHz

Average < 10 ms

Keil C

Sensors 2017, 17, 1969

18 of 19

Acknowledgments: Part of the work was support by the Ministry of Technology, Taiwan, under the grant No. 106-2218-E-006-004. The authors would also like to thank the Ministry of Economic Affairs (MOEA), Taiwan, for the financial support on this research under the contract B341AB7410 and G301AR1C10. Author Contributions: Chieh-Li Chen and Chun-Te Chuang designed the algorithm and experiments; Chun-Te Chuang performed the experiments and analyzed the data; Chieh-Li Chen contributed to the algorithm revision. All authors read and approved the final manuscript. Conflicts of Interest: The authors declare no conflict of interest. The founding sponsors had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, and in the decision to publish the results.

References 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.

14. 15.

16. 17. 18. 19. 20.

Android App for Patient Monitoring. Available online: https://www.amrita.edu/center/awna/research/ patient-monitoring-app (accessed on 25 August 2017). Chen, H.; Liu, H. A remote electrocardiogram monitoring system with good swiftness and high reliability. Comput. Electr. Eng. 2016, 53, 191–202. [CrossRef] Madias, J.E. A proposal for monitoring patients with heart failure via “smart phone technology”-based electrocardiograms. J. Electrocardiol. 2016, 49, 699–706. [CrossRef] [PubMed] Take, Y.; Morita, H. Fragmented QRS: What is the meaning. Indian Pacing Electrophysiol. J. 2012, 12, 213–225. [CrossRef] Pan, J.; Tompkins, W.J. A real-time QRS detection algorithm. IEEE Trans. Biomed. Eng. 1985, BME-32P, 230–236. [CrossRef] [PubMed] Hamilton, P.S.; Tompkins, W.J. Quantitative investigation of QRS detection rules using the mit/bih arrhythmia database. IEEE Trans. Biomed. Eng. 1986, BME-33, 1157–1165. [CrossRef] Farashi, S. A multiresolution time-dependent entropy method for QRS complex detection. Biomed. Signal Process. Control 2016, 24, 63–71. [CrossRef] Phukpattaranont, P. QRS detection algorithm based on the quadratic filter. Expert Syst. Appli. 2015, 42, 4867–4877. [CrossRef] Manikandana, M.S.; Somanb, K.P. A novel method for detecting R-peaks in electrocardiogram (ECG) signal. Biomed. Signal Process Control 2012, 7, 118–128. [CrossRef] Zhu, H.; Dong, J. An R-peak detection method based on peaks of Shannon energy envelope. Biomed. Signal Process. Control 2013, 8, 466–474. [CrossRef] Yochuma, M.; Renaudb, C.; Jacquira, S. Automatic detection of P, QRS and T patterns in 12 leads ECG signal based on CWT. Biomed. Signal Process. Control 2016, 25, 46–52. [CrossRef] Meraha, M.; Abdelmalika, T.A.; Larbi, B.H. R-peaks detection based on stationary wavelet transform. Comput. Methods Progr. Biomed. 2015, 121, 149–160. [CrossRef] [PubMed] Madeiro, J.P.V.; Cortez, P.C.; Marques, J.A.L.; Seisdedos, C.R.V.; Sobrinho, C.R.M.R. An innovative approach of QRS segmentation based on first-derivative, Hilbert and Wavelet Transforms. Med. Eng. Phys. 2012, 34, 1236–1246. [CrossRef] [PubMed] Christov, I.I. Real time electrocardiogram QRS detection using combined adaptive threshold. Biomed. Eng. OnLine 2004, 3, 1–9. [CrossRef] [PubMed] Karimipour, A.; Homaeinezhad, M.R. Real-time electrocardiogram P-QRS-T detection–delineation algorithm based on quality-supported analysis of characteristic templates. Comput. Biol. Med. 2014, 52, 153–165. [CrossRef] [PubMed] Jain, S.; Ahirwal, M.K.; Kumar, A.; Bajaj, V.; Singh, G.K. QRS detection using adaptive filters: A comparative study. ISA Trans. 2017, 66, 362–375. [CrossRef] Dohare, A.K.; Kumar, V.; Kumar, R. An efficient new method for the detection of QRS in electrocardiogram. Comput. Electr. Eng. 2014, 40, 1717–1730. [CrossRef] Sharma, L.D.; Sunkaria, R.K. A robust QRS detection using novel pre-processing techniques and kurtosis based enhanced efficiency. Measurement 2016, 87, 194–204. [CrossRef] Kuzilek, J.; Lhotska, L. Electrocardiogram beat detection enhancement using Independent Component Analysis. Med. Eng. Phys. 2013, 35, 704–711. [CrossRef] [PubMed] Tafreshi, R.; Jaleel, A.; Lim, J.; Tafreshi, L. Automated analysis of ECG waveforms with atypical QRS complex morphologies. Biomed. Signal Process. Control 2014, 10, 41–49. [CrossRef]

Sensors 2017, 17, 1969

21. 22. 23.

24. 25. 26.

27.

28. 29.

19 of 19

Yazdani, S.; Vesin, J.M. Extraction of QRS fiducial points from the ECG using adaptive mathematical morphology. Digit. Signal Process. 2016, 56, 100–109. [CrossRef] Moody, G.B.; Mark, R.G. The impact of the MIT-BIH arrhythmia database. IEEE Eng. Med. Biol. Mag. 2001, 20, 45–50. [CrossRef] [PubMed] American National Standard ANSI/AAMI EC 57:2012, Testing and Reporting Performance Results of Cardiac Rhythm and ST-Segment Measurement Algorithms. Available online: https://webstore.ansi.org/ RecordDetail.aspx?sku=CARDIO+MEDICAL+DEVICE+PACKAGE (accessed on 25 August 2017). The WFDB Software Package. Available online: https://www.physionet.org/physiotools/wfdb.shtml (accessed on 25 August 2017). Castells-Rufas, D.; Carrabina, J. Simple real-time QRS detector with the MaMeMi filter. Biomed. Signal Process. Control 2015, 21, 137–145. [CrossRef] Kim, J.; Shin, H. Simple and Robust Realtime QRS Detection Algorithm Based on Spatiotemporal Characteristic of the QRS Complex. Available online: https://doi.org/10.1371/journal.pone.0150144 (accessed on 25 August 2017). Benitez, D.S.; Gaydecki, P.A.; Zaidi, A.; Fitzpatrick, A.P. A New QRS Detection Algorithm Based on the Hilbert Transform. In Proceedings of the Computers in Cardiology 2000, Cambridge, MA, USA, 24–27 September 2000; pp. 379–382. Polar Heart Rate Sensor. Available online: https://www.polar.com/uken/products/accessories//h10_ heart_rate_sensor (accessed on 25 August 2017). Moradi, M.H.; Ashoori Rad, M.; Khezerloo, R.B. ECG signal enhancement using adaptive Kalman filter and signal averaging. Int. J. Cardiol. 2014, 173, 553–555. [CrossRef] [PubMed] © 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

A QRS Detection and R Point Recognition Method for Wearable Single-Lead ECG Devices.

In the new-generation wearable Electrocardiogram (ECG) system, signal processing with low power consumption is required to transmit data when detectin...
9MB Sizes 9 Downloads 15 Views