• 沒有找到結果。

2-1 Background

ECG is the transthoracic interpretation of the electrical activity of heart over a period of time. A typical ECG tracing of the cardiac cycle (heartbeat) consists of a P wave, a QRS complex, and a T wave. The most commonly used features, which delineates the ECG waveform, are the signal amplitude and intervals within P, QRSon, R, QRSend, T wave boundaries.

The detection of these features is challenging for several reasons:

 Because of the small amplitude of ECG signal (<5mV), it is usually coupled with noise and artifacts, such as power line interference, electrode contact noise, patient-electrode motion artifacts, Electromyography (EMG), baseline wandering, data collecting device noise, quantization noise and aliasing, etc.

 The wide variation of QRS morphologies and rhythms, from abnormal ECGs and interpersonal variations.

Fig. 2-1 shows some ECG signals extracted form QT database including a broad range of QRS and ST-T variety to show the morphological changes. Some non-ideal effect for mobile measurement including muscular noise, motion artifact, amplitudes changes are also shown in these examples.

11

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105 -50

0 50 100

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

Fig. 2-1 Morphological changes of some example ECG signals extracted from QT database.

Accordingly, most ECG delineation algorithm usually consists of a preprocessing stage and a decision stage. The preprocessing stage usually includes filtering of high frequency noise and baseline drift, or transforming the data into different patterns to make the features more conspicuous. Previous works of ECG QRS detection algorithm utilize methods like wavelet transform [9], band pass filtering [6], genetic algorithm [7], mathematical morphology [8], and phasor transform [10]. Among them, the multi-scale wavelet-based methods are proven to provide effective noise removal and

12

exists fast transform method which are implementation-friendly for digital implementation. Therefore, wavelet-based method is selected as the basis of the proposed delineation algorithm.

The proposed ECG delineation comprises the multi-scale dyadic wavelet transform and the feature extractor. The DWT decomposes the ECG signal and noise to different wavelet scales. And the feature extractor with search rules and adaptive threshold are applied for the ECG fiducial point decision.

2-2 Dyadic Wavelet Transform (DWT)

2-2.1 Wavelet Theory

Wavelet transform is widely used in applications such as noise reduction and edge detection and is usually implemented in the form of FIR filter banks with little hardware requirement. Wavelet transform decompose signal by a set of basis function obtained by dilation (a) and translation (b) of a single prototype wavelet ψ(t) and is defined as

𝑎𝑥(𝑏) = 1

√𝑎∫ 𝑥(𝑡)

−∞

(𝑡 − 𝑏

𝑎 ) 𝑑𝑡, 𝑎 > 0. (2-1)

where Wax(b) is the wavelet coefficient at scale a, and x(t) is the original signal. The greater the scale factor (a), the wider is the basis function. And the corresponding coefficients give information about lower frequency components of the signal.

If the prototype wavelet is defined as the derivative of a smoothing function θ(t).

(2-1) can be rewritten as

𝑎𝑥(𝑏) = −𝑎 (𝑑

𝑑𝑏) ∫ 𝑥(𝑡)

−∞

𝜃𝑎(t − b)𝑑𝑡. (2-2)

13

𝜃𝑎(t) = 1

√𝑎𝜃 (𝑡 𝑎).

(2-3)

Then the wavelet transform at scale a can be interpreted as the derivative of the filtered version of original signal with impulse response equal to θa(t). Therefore, every local maximum/minimum in the time domain will be represented by a zero crossing points surrounded by a positive and a negative peaks, with the amplitude of the peaks corresponded to the maximum/minimum slope. Regarding the application of detecting various ECG features occurring at different time instant coupled with different kinds of noise, the flexibility of scales and the corresponded frequency response give convenience for such application.

For discrete time signal, the dilation (a) and translation (b) can be chosen to be in dyadic form (2-4) on the time scale plane. Such kind of wavelet transform is then called dyadic wavelet transform, with basis function equal to (2-5).

a = 2𝑘, 𝑏 = 2𝑘𝑙. (2-4)

𝑘,𝑙(𝑡) = 2𝑘2 (2−𝑘𝑡 − 𝑙). (2-5)

According to [11], the dyadic wavelet transform can be implemented using filter banks with cascaded identical high-pass and low-pass filters as shown in Fig. 2-2 (a).

To achieve the same sampling frequency and provide approximate translation invariance, algorithm á trous [12] is used. The filter response is interpolated with zero and the down sampler is removed to overcome the translation-invariance (Fig. 2-2 (b)).

This is also known as the stationary wavelet transform.

14

Fig. 2-2 (a) Mallat’s Algorithm, (b) algorithm á trous (SWT)

2-2.2 Quadratic Spline Wavelet Transform (QSWT)

A quadratic spline originally proposed in [13] is selected as the prototype waveform for the detection algorithm. The Fourier transform of this quadratic spline is depicted as

which are FIR filters with impulse response as

𝑖[ ] =1

8× {𝛿[ + 2𝑖] + 3𝛿[ + 2𝑖−1] + 3𝛿[ ] + 𝛿[ − 2𝑖−1]}. (2-8)

𝑔𝑖[ ] = 2 × {𝛿[ + 2𝑖−1] − 𝛿[ ]}. (2-9)

15

To decide the number of scales to be used, the frequency components of some ECG signals are analyzed together with the filter bank frequency response. Fig. 2-3 shows the frequency response of the ECG signal extracted from MIT-BIH Arrhythmia Database (data 103) together with its QSWT up to 5 scales with 250Hz sampling frequency. From the figure we can see that most energy concentrate in frequency band 0 Hz to 50 Hz. Scale-1 is discarded considering the high frequency noise. Considering hardware cost and filtering performance, the proposed delineation algorithm used scale 2, 3, and 4 for detection of the 5 fiducial points (P, QRSon, R, QRSend, T).

0 200 400 600 800 1000 1200

-100

Fig. 2-3 (a) Data #103 from MIT_BIH Arrhythmia Database at 360Hz sampling frequency and (b) the corresponded frequency response.

16

2-3 Detection Algorithm

The detection algorithm presented in this section targets for the 5 most significant ECG fiducial points (P, QRSon, R, QRSend, and T) based on the quadratic spline wavelet transform described in the previous section. The dyadic wavelet transform filter out the interference of high frequency noise and baseline drift and decompose the ECG signal into different scales. Detection is then performed based on the cross examination among these scales of coefficients. Comparing with existing off-line detection methods with costly computation, the proposed algorithm is designed suitable for hardware implementation providing comparable detection result. The detection rules for each feature and the adaptive generation for threshold and search window will be described in the following paragraphs.

2-3.1 Wave Characteristic and Detection Flow

Fig. 2-4 shows the decomposition of some example ECG waveform using the QSWT. From the figure we can see that a peak in the time domain will be represented by a zero crossing point surrounded by a local maximum and minimum point in the wavelet domain, each representing the deepest rising and falling slope. The reason for discarding scale-1 becomes clear in this figure (high frequency noise). For the 5 desired fiducial points with different wave characteristics, detections are done using different scales of wavelet coefficients. For the most important R peak, we use scale 2, 3, 4 for detection. Because of reduced resolution in higher scales, sharp edges such as the boundary for QRS complex (i.e. QRSon, QRSend) use coefficients of scale-2 for detection. Wide wave such as P and T wave use higher scales (scale-4) for detection.

Considering hardware cost, increased latency in higher scales, and the interference of baseline drift, the scale of wavelet decomposition is limited to four.

17

100 200 300 400 500 600 700 800 900 1000 1100

-200 0 200 400

100 200 300 400 500 600 700 800 900 1000 1100

-150

100 200 300 400 500 600 700 800 900 1000 1100

-200 -100 0 100 200

100 200 300 400 500 600 700 800 900 1000 1100

-300

100 200 300 400 500 600 700 800 900 1000 1100

-200 -100 0 100 200

100 200 300 400 500 600 700 800 900 1000 1100

-100

Discarded due to high frequency noise a. normal ecg b. high frequency noise

C. baseline drift

Baseline wondering remains Local max

Local min

Fig. 2-4 The first 5 wavelet decomposition of ECG signal with noise coupling

Using the zero crossings and local maximum/minimum at each scale, the proposed algorithm detects the five fiducial points within a cardiac cycle by:

a) Detection for R peak.

b) Search-back for QRSon and P wave.

c) Moves on for QRSend and T wave.

d) Update detection threshold and search window.

18

If an R peak is detected

· The detection threshold for R peak detection and boundary detection is updated every time an R peak is detection

· Search for P and T detection is limited in the P/T search window

· End of delineation of an cardiac cycle

· Delineation is performed based on a 4-scale wavelet transform

· Once an R peak is detected, delineation for other fiducial points starts

Fig. 2-5 Flow graph for the proposed detection algorithm

Fig. 2-5 shows the flow graph of the detection algorithm. For the best extraction performance, the feature extraction process starts with the most obvious R peak. Based on the detected R peak, the detector searches back for the starting boundary of the QRS complex (i.e. QRSon) and P wave. After successful search of these wave points, the detection moves forward for QRSend and T wave. This completes the detection of the 5 wave within a cardiac cycle. To reduce unnecessary search time and power, the detection for P and T wave is limited in a search window. The search window and the detection thresholds for locating the peaks are updated every cardiac cycle.

19

Considering hardware cost, the design rules for QRSon/end and P/T waves are designed to be similar so the hardware can be shared. The detection detail will be explained as follows.

2-3.2 R Peak Detection

Scale-2

Zero crossing

Local max

Thresholds are updated every time an R peak is

detected

thr2p

Scale-4 ECG

peak

thr2npeak

thr3ppeak

thr3npeak

thr4ppeak

thr4npeak

Scale-3

After every successful R peak, there will be an refraction period for heart to repolarized

Fig. 2-6 R peak detection is performed by searching for the min-max pair exceeding the peak threshold in scale 2, 3, and 4

A peak is indicated by the temporal relationship of local minimum and maximum peak pair defined as the point exceeding the peak threshold (thrpeak2p , thrpeak2n , etc.) together with the zero crossing between them. The detection of R peak is performed with cross examination in the 3 scales (scale-2, 3, and 4) because of its high importance. To prevent large data storage, the detection is done sequentially using 3 parallel state machines. According to the 3 scales of wavelet coefficients, the state

20

machines change state when finding a positive or negative peak, a zero crossing point, and the proceeding peaks opposite to the previous detected peak, and output the marking for possible candidate for QRS complex. Using the rule of majority, if candidate markings are found in 2 or more scales, the zero crossing point in scale-2 will be considered as the detected R peak. Besides locating the R peak location, the information of this min-max pair (amplitude, location) is recorded for successive QRSend detection and threshold update.

After successful locating an R peak, the conducting cell needs to repolarize in order contract again. This period is called the refraction period. During this period, no peak will be considered as R peak.

2-3.3 QRSon/end Detection

QRSon

Scale-2

thr2p

Scale-4 ECG

boundary

thr2n QRS boundary is decided by continuous

samples under the boundary threshold QRSoff

Wide QRS needs coefficients from scale-4 QRSon candidate

boundary

Fig. 2-7 QRSon/end detection search for continuous samples under the edge threshold

Considering reduced resolution in higher scales, coefficients of scale-2 is used of detection of QRS edges (QRSon/end). Because of similar wave characteristic, the detection rules for QRSon/end detection are designed to be the same so the hardware can be shared (with only comparators). The detection of QRSon/end is performed by searching for continuous points under the boundary threshold as illustrated in Fig. 2-7.

21

The detection of QRSend can be performed following successful detection of R peak.

To avoid search back and additional storage for QRSon detection, possible points satisfying the detection rules are saved as QRSon candidates. Finally the candidate that supplies the most nearest sample to the R peak will be confirmed as the real QRSon

point.

To avoid morphological changes of wide QRS complex (syndrome:

PVC-premature ventricular contraction) which cannot be characterized by scale-2, coefficients of scale-4 is used to distinguish the wide morphology and avoid detecting false boundary (shown in the right part of Fig. 2-7).

2-3.4 P/T Wave Detection

P

Scale-4

ECG T P T P T

P search window T search window

QRSon-end

Search window is calculated from

recursive computation of QRSon-end interval zero crossing

Fig. 2-8 Search window defined for P/T detection

Because of the wider wave characteristic, the detection process of P and T wave detection use scale-4 for detection. The process is as follows: First, the search is limited in a search window defined relatively according to the recursive computing of QRSon to QRSend interval. This reduces extra time and power for unnecessary search according to the physical phenomenon for a normal cardiac cycle. Instead of using RR interval as reference, QRSon to QRSend interval eliminates the influence of

22

morphological changes of QRS complex. The size of the search window is carefully designed because it results in extra storage for P wave search back after R peak detection. Finally we define the search window boundary for P and T wave detection to be:

𝑆𝑊𝑝𝑟 = 10.

𝑆𝑊𝑝𝑙= { 100 𝑓(𝑆𝑊𝑝𝑙 > 100)

10 + 𝑄𝑅𝑆𝑜𝑛−𝑒𝑛𝑑× 0.375. . 𝑤. .

( 2-10 )

𝑆𝑊𝑡𝑙 = 15.

𝑆𝑊𝑡𝑟 = { 100 𝑓(𝑆𝑊𝑡𝑟 > 100)

15 + 𝑄𝑅𝑆𝑜𝑛−𝑒𝑛𝑑× 0. . . 𝑤. . ( 2-11 )

with a maximum search range of 100 samples under 250Hz sampling frequency. The QRSon-end is the value that updated every time a new QRS complex is detected. These values are designed according to the physical nature of our heart. For example, the value of SWpr is chosen to be 10 because the delay caused by AV node between atrial and ventricular is approximately 0.1 second.

Within this window, we search for the global maximum/minimum points. If one of them exceeds the P/T threshold, a wave is considered to exist and is indicated by the zero crossing point between them.

2-3.5 Adaptive Threshold and Window Update

As mentioned previously, the robustness of the proposed algorithm lies from the adaptively update of detection parameters including the peak threshold for R peak detection and the boundary threshold for QRSon/end detection and the search window for P and T wave detection.

23

For R peak detection, separate thresholds (thrpeakxp ,thrpeakxn ) are used for positive and negative peaks to avoid failed detection for asymmetric rise and fall peaks shown in Fig. 2-6. Avoiding costly computation such as division, square roots [14], or root-mean-square [9], thresholds are computed based on the information of the recorded value of local min-max pair (signal peak) and the recorded noise level (noise peak). The equation of the peak threshold for R peak detection and boundary threshold for QRSon/end detection are depicted as follows:

{ 𝑓 (𝑙 𝑎𝑙_𝑚𝑎𝑥𝑥 ≥ 𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑝 ) → 𝑆𝑃𝑝𝑒𝑎𝑘𝑥𝑝 .

𝑒𝑙 𝑒 𝑓 (𝑙 𝑎𝑙_𝑚𝑎𝑥𝑥 < 𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑝 ) → 𝑁𝑃𝑝𝑒𝑎𝑘𝑥𝑝 . (positive threshold) { 𝑓 (𝑙 𝑎𝑙_𝑚 𝑥 ≥ 𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑛 ) → 𝑆𝑃𝑝𝑒𝑎𝑘𝑥𝑛 .

𝑒𝑙 𝑒 𝑓 (𝑙 𝑎𝑙_𝑚 𝑥< 𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑛 ) → 𝑁𝑃𝑝𝑒𝑎𝑘𝑥𝑛 . (negative threshold) where x is the scale.

(2-12)

𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑝 ′ = 𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑝 × 3 + 𝑁𝑃𝑝𝑒𝑎𝑘𝑥𝑝 + (𝑆𝑃𝑝𝑒𝑎𝑘𝑥𝑝 − 𝑁𝑃𝑝𝑒𝑎𝑘𝑥𝑝 ) ≫ 1 𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑛 ′ = 𝑡ℎ𝑟𝑝𝑒𝑎𝑘𝑥𝑛 × 3 + 𝑁𝑃𝑝𝑒𝑎𝑘𝑥𝑛 + (𝑆𝑃𝑝𝑒𝑎𝑘𝑥𝑛 − 𝑁𝑃𝑝𝑒𝑎𝑘𝑥𝑛 ) ≫ 1

(2-13)

𝑡ℎ𝑟𝑏𝑑𝑟𝑦𝑝 = 𝑡ℎ𝑟𝑝𝑒𝑎𝑘2𝑝

𝑡ℎ𝑟𝑏𝑑𝑟𝑦𝑛 = 𝑡ℎ𝑟𝑝𝑒𝑎𝑘2𝑛 ≫ (2-14)

Equation (2-12) describes the rule to classify the noise peak and signal peak. The new threshold is computed by the weighted average of the current threshold and the new threshold based on the detected noise peak and signal peak (2-13). Equation (2-14) shows that the threshold for QRS complex boundary detection is based on a simple shift of the peak threshold.

24

2-4 Simulation Result and Performance Evaluation

Fig. 2-9 shows the detection result of the proposed algorithm with different wave morphologies and noise coupling.

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105 -50

0 50 100

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

1.502 1.504 1.506 1.508 1.51 1.512

x 105

Fig. 2-9 Detection result of the proposed with ECGs with morphological changes and noise

As there is no golden rule for the decision for peaks, onset, and endset, the validation for the detection result needs to be performed by doctors. Thanks to Physionet [3], lots of standard databases are provided and sorted with detail information about the ECG including the corresponded syndrome and either manually

25

or automatically annotated fiducial points. In this report, we choose the two common databases for the validation of our proposed algorithm, namely the MIT-BIH Arrhythmia Database (MITDB) [4] and QT Database (QTDB) [5]. Here we first make a brief introduction about the databases and provide the validation result.

 MIT-BIH Arrhythmia Database (MITDB) [4]

The MITDB includes 48 specially selected Holter recordings with anomalous but clinically important phenomena at 360Hz sampling frequency, 11-bits resolution and 10-mV amplitude range with automatically determined R peak annotations. We use this database for the validation for R peak detection.

 QT Database (QTDB) [5]

The original goal for QTDB is to make a database with sufficient ECGs coverage for variety of QRS and ST-T morphologies in order to challenge existing algorithms with real-world variability. The 105 records were chosen primarily from among existing ECG databases, including the MITDB, the European Society of Cardiology ST-T Database [4], and several other ECG databases collected at Boston's Beth Israel Deaconess Medical Center. All records all resample to 250Hz in QTDB. Different annotations are provided including the automatically annotation for QRS complex (.man) and manually determined waveform boundaries by two experts (.q1c .q2c). We validate the detection result of all the fiducial points using this database.

The two parameters to qualify the detection result are sensitivity (Se) and positive predictivity (Pr) and are depicted as

𝑆𝑒 = 𝑇𝑃

𝑇𝑃 + 𝐹𝑁, Pr = 𝑇𝑃

𝑇𝑃 + 𝐹𝑃. (2-15)

where TP stands for true positive detection, FN stands for false negative detection, and FP stands for false positive detection. The sensitivity Se reports the percentage of true

26

beats that were correctly detected. The positive predictivity Pr reports the percentage of beat detections which were in real true beats (accuracy).

Comparison of the detection result with the state-of-the art detection algorithm (including software algorithm and hardware detector) are also listed in Table 2-1 and Table 2-2. Table 2-3 lists the detail detection result of R peak detection verified using MITDB.

Table 2-1 R peak detection comparison with state-of-the-art detector using MITDB

Detector #

Table 2-2 Fiducial points delineation result comparison using QTDB

Detector P QRSon QRSend T

27

Table 2-3 R peak detection result within MITDB

Records Total (beats) TP FP FN Se (%) Pr (%)

28

From Table 2-1, the proposed algorithm achieves 99.71% sensitivity and 99.68%

positive predictivity for R peak detection. Although with reduced computation complexity, the performance of the proposed algorithm is still compatible with the published off-line detection algorithms. Our algorithm achieves similar detection accuracy comparing with the on-line detection ASICs.

Table 2-2 shows the detection result of other targeted fiducial points (P, QRSon, QRSend, T) comparing with the 2 off-line detector verified using QTDB q1c annotation.

The proposed algorithm achieves better detection result at QRSon and QRSend detection and similar result for P and T wave detection.

2-5 Summary

In this chapter we proposed an ECG delineation algorithm especially for abnormal alarm based on 4-scale quadratic spline wavelet transform. The delineation algorithm can extract P, QRSon, R, QRSend, and T wave with accuracy over 99%. The wavelet transform removes noise interference and decompose ECG signal into different frequency bands. With cross examination among the decomposed scales and adaptive threshold update considering noise level, the algorithm is suitable for mobile ECG monitoring. Designed using only simple operations, the algorithm can be implemented using low power ASICs. Chapter 4 describes the architecture for the implemented ASIC delineator, using mixed synchronous and asynchronous design style with low power techniques.

29

Chapter 3:

相關文件