1. Trang chủ
  2. » Luận Văn - Báo Cáo

Báo cáo hóa học: " Research Article Hardware Implementation of a Modified Delay-Coordinate Mapping-Based QRS Complex Detection Algorithm" potx

13 278 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 13
Dung lượng 1,55 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

The decision stage applies QRS complex search rules where the detection function is compared to a certain detection threshold level to find signal peaks and then the decision is made whe

Trang 1

Volume 2007, Article ID 57286, 13 pages

doi:10.1155/2007/57286

Research Article

Hardware Implementation of a Modified Delay-Coordinate

Mapping-Based QRS Complex Detection Algorithm

Matej Cvikl, 1 Franc Jager, 2 and Andrej Zemva 3

University of Ljubljana, Trzaska 25, 1000 Ljubljana, Slovenia

Trzaska 25, 1000 Ljubljana, Slovenia

Received 30 April 2006; Revised 23 January 2007; Accepted 23 January 2007

Recommended by David Hamilton

We present a modified delay-coordinate mapping-based QRS complex detection algorithm, suitable for hardware implementation

In the original algorithm, the phase-space portrait of an electrocardiogram signal is reconstructed in a two-dimensional plane us-ing the method of delays Geometrical properties of the obtained phase-space portrait are exploited for QRS complex detection In our solution, a bandpass filter is used for ECG signal prefiltering and an improved method for detection threshold-level calculation

is utilized We developed the algorithm on the MIT-BIH Arrhythmia Database (sensitivity of 99.82% and positive predictivity of 99.82%) and tested it on the long-term ST database (sensitivity of 99.72% and positive predictivity of 99.37%) Our algorithm outperforms several well-known QRS complex detection algorithms, including the original algorithm

Copyright © 2007 Matej Cvikl et al This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited

1 INTRODUCTION

Detecting QRS complexes is the most important task in

elec-trocardiogram (ECG) signal analysis Physiological

variabil-ity of QRS complexes and various types of artifacts like

mus-cle noise, power line interference, baseline wander, motion

artifacts, and electrode contact noise added to the ECG

sig-nal make QRS complex detection a difficult task

In the literature, various types of QRS complex

detec-tion algorithms can be found K¨ohler et al [1] divided QRS

complex detection algorithms into algorithms based on

sig-nal derivatives and digital filters, wavelet-based QRS complex

detection, neural network approaches, and additional

ap-proaches The algorithms from the first two groups are most

widely used for QRS complex detection and can be found in

software (SW) or hardware (HW) implementations

The first group encompasses algorithms based on

sig-nal derivatives and digital filters Such approach divides the

search process into two stages: the preprocessing stage and

the decision stage The preprocessing stage usually consists

of a band-pass linear filter to reduce noise and enhance the

QRS complex [2,3], and a nonlinear filter, which by signal

differentiation, squaring, and integration differentiates the

QRS complex from the artifacts The decision stage applies QRS complex search rules where the detection function is compared to a certain detection threshold level to find signal peaks and then the decision is made whether the peak is a QRS complex or not One of the best performing algorithms

in this group is an open source ECG analysis SW (OSEA) [4]; OSEA achieves QRS complex detection sensitivity (Se)

of 99.80% and positive predictivity (+P) of 99.80% on the MIT-BIH Arrhythmia Database [5] Further examples of al-gorithms with lower performance that can be classified into this group can be found in [6 10]

The variety of QRS complex shape morphologies and ar-tifacts causes the performance of QRS complex detection al-gorithms that use fixed bandwidth bandpass filters and fixed width integration windows to decrease when the QRS mor-phology changes To avoid this problem, a new approach to QRS complex detection based on wavelet transform (WT) has been introduced The WT decomposes the ECG signal into several scales, where each scale has different bandwidth and time support WT at any scale is done by filtering the sig-nal with an appropriate filter The most common approach

to QRS complex detection is finding local maxima at four consecutive scales Detection starts at the largest scale (W )

Trang 2

ECG signal Lowpass filter

Time delay

y x

Area calculation

Peak detection and decision

Detection threshold level calculation

Figure 1: QRS complex detection using delay-coordinate mapping [11]

containing low-frequency signal information and continues

to the lowest scale (W2 ) containing high-frequency signal

information A positive-negative pair of local maxima that

occurs at all the scales at the same time and meets other

de-tection rules is declared as the QRS complex One of the first

WT-based QRS complex detection algorithms with very high

Se of 99.89% and +P of 99.94% tested on the MIT-BIH

Ar-rhythmia Database was published by Li et al [12] This

al-gorithm serves as a starting point for other alal-gorithms which

usually only differ in the usage of different wavelet functions

[13], number of processed scales [14], or modifications to

the original algorithm [15,16] These algorithms also have

lower performance than [12]

While algorithms from the first group are usually less

computationally intensive and suitable for microcontroller

implementations in embedded systems, other types of

algo-rithms usually utilize a greater number of filters and decision

rules, making them unsuitable for systems with low-signal

processing power Most of such algorithms run on personal

computers (PCs) where data is processed further Regardless

of the type of the algorithm, when a lot of ECG signals need

to be processed on a single PC in a relatively short time, it

is essential to have enough processing power All the signals

need to be processed without degrading the performance of

other applications running on the PC One solution to the

problem is upgrading the PC, while the second solution is in

an application-specific HW Such HW can be based on a

dig-ital signal processor (DSP) or field programmable gate array

(FPGA) added to the PC, so the processor in the PC can be

relieved from most of the computation

The goal of our research work was development and HW

implementation of a QRS complex detection algorithm in

or-der to set the groundwork for further ECG signal processing

stages in HW Because of expected high-speed data

process-ing, the HW is aimed to be used as a QRS complex detection

engine in systems where a larger number of ECG signals have

to be processed In this paper, a HW implementation of the

QRS complex detection algorithm based on phase-space

por-trait of the ECG signal is described In contrast to the original

algorithm [11], our algorithm processes blocks of ECG data,

has a different input filter, and uses a different method for

detection threshold level calculation The algorithm was

de-veloped on the MIT-BIH Arrhythmia Database and a

com-parison with some of the well-known QRS complex

detec-tion algorithms in terms of QRS detecdetec-tion performance on

this database was made Finally, the algorithm was tested on the long-term ST database (LTST DB) [17]

2 MATERIALS AND METHODS

A real-time QRS complex detection algorithm for microcon-troller implementation was adapted for block data process-ing in HW The developed algorithm was first modeled and tested in SW (Matlab) The SW model served as an optimiza-tion and testing tool for the HW implementaoptimiza-tion of the al-gorithm, which was entirely written in very high-speed inte-grated circuit hardware description language (VHDL) [18] The QRS complex detection algorithm proposed by Lee

et al [11] uses time delay to map the input ECG signal A sin-gle ECG signal and its time delayed duplicate create a phase-space portrait, whose geometrical properties are exploited for QRS complex detection Based on the size of the poly-gon bounded by a number of consecutive data points, a QRS event can be found Each time a new polygon size (area) ex-ceeding the current detection threshold level is found, a de-cision is made whether the peak is indeed a QRS complex

or not, and the detection threshold level is updated A block diagram of the algorithm is shown inFigure 1

Although this scheme requires several multiplications for area calculation, the algorithm is relatively simple and has satisfactory performance: Se of 99.69% and +P of 99.88%, tested on the MIT-BIH Arrhythmia Database In order to simplify the preprocessing stage, authors deliberately used only a lowpass filter, which resulted in more dynamic changes

of the polygon sizes since P and T waves and motion artifacts were not filtered out

We modified the algorithm in order to make it more suit-able for postprocessing, where the ECG signal is processed block-by-block It is designed and optimized for QRS com-plex detection in the ECG signal sampled at 250 Hz How-ever, other sampling rates can be used with appropriate ad-justments to the input filter, correct block length, and detec-tion threshold level calculadetec-tion The algorithm we propose is shown inFigure 2

As can be seen inFigure 2, the modified algorithm com-prises a bandpass filter instead of the lowpass filter, and the detection threshold level calculation is performed before peak detection Moreover, a different method for the detec-tion threshold level calculadetec-tion is utilized The algorithm is described in more detail in the following subsections

Trang 3

ECG signal Bandpass filter

Time delay

y x

Area calculation

Threshold calculation

Peak detection and decision

Figure 2: Modified delay-coordinate mapping algorithm

1.5

1

0.5

0

0.5

1

1.5

t (s)

(a)

1.5

1

0.5

0

0.5

1

1.5

ECG (t) (mV)

(b)

1.5

1

0.5

0

0.5

1

1.5

ECG (t) (mV)

(c)

1.5

1

0.5

0

0.5

1

1.5

ECG (t) (mV)

(d)

Figure 3: Phase-space portraits of the ECG signal: (a) input ECG signal, (b) phase-space portrait of the ECG signal with the time delay of

4 milliseconds, (c) phase-space portrait of the ECG signal with the time delay of 12 milliseconds, (d) phase-space portrait of the ECG signal with the time delay 28 milliseconds

2.1 Phase-space portrait

The phase-space portrait (also phase portrait) of a

sig-nal is constructed in a 2D plane (x-y) from the

origi-nal sigorigi-nal and its time delayed duplicate, so that

coordi-nates of each data point are written asx[nT] = ECG[nT]

and y[nT] = ECG[(n − τ)T], where τ is the time

de-lay Figure 3shows exemplary phase-space portraits of two

consecutive heartbeats, where trajectories are generated by delaying the signal by 4 milliseconds, 12 milliseconds, and

28 milliseconds In the phase-space portraits, we can distinct three different areas which the trajectory forms in the 2D plane: the smaller areas are created by the P and T waves with a lower amplitude, while the largest area corresponds

to a higher amplitude wave or the QRS complex, respec-tively

Trang 4

0

1

2

t (s)

(a)

2

0

2

t (s)

(b)

0.5

0

0.5

t (s)

(c)

2

0

2

ECG (t) (mV)

(d)

0.5

0

0.5

ECG (t) (mV)

(e)

2

1

0

t (s)

(f)

0.4

0.2

0

t (s)

(g)

Figure 4: Phase-space portraits and the calculated area of the ECG signal: (a) input ECG signal, (b) lowpass filtered ECG signal, (c) band-pass filtered ECG signal, (d) phase-space portrait of the lowband-pass filtered ECG signal, (e) phase-space portrait of the bandband-pass filtered ECG signal, (f) calculated area of the lowpass filtered ECG signal, (g) calculated area of the bandpass filtered ECG signal

It is very important that an appropriate signal time

de-lay is chosen in order to get useful phase-space portraits and

to sustain proportions between the sizes of areas created by

different waves If the time delay is too short (Figure 3(b)),

the resulting trajectory creates rather “flat” areas around the

y = x line, that can potentially be disordered, but on the

other hand, if the time delay is too great (Figure 3(d)), the

contour can create several smaller areas instead of one larger

area Based on their QRS detection algorithm performance,

Lee et al [11] determined that the optimal time delay is

20 milliseconds

Some phase-space portrait examples of ECG signals

con-taminated with high-frequency noise and baseline drifts are

shown in [11] While baseline drifts cause the phase-space

portrait to move along the diagonal axis of the plane, along they = x line, and do not influence the size of the area itself,

the high-frequency noise can distort the phase-space portrait

to a point where the distinctive area created by the QRS com-plex cannot be found anymore To avoid this, the ECG signal

is to be prefiltered, so the phase-space portrait is constructed from the filtered ECG signal and its time delayed duplicate Figure 4shows the input ECG signal, lowpass, and bandpass filtered signals, their phase-space portraits, and sizes of the areas the trajectories created The input signal is deliberately selected to emphasize the difference between the phase-space portraits created by the two filters

When the signal is filtered with the lowpass filter, the in-fluence of baseline drift can be seen; the trajectory created

Trang 5

by time delaying the signal moves along the y = x line

(Figure 4(d)), while no influence can be seen on the

calcu-lated area (Figure 4(f)) It can also be noted that the

low-pass filter allows waves like P and T to create small areas

(Figure 4(f)), which add to more dynamical area behavior If

the ECG signal is filtered with a bandpass filter, the trajectory

does not move along the y = x line (Figure 4(e)) and there

are hardly any areas present that would be created by the P

and T waves, as these waves are attenuated (Figure 4(g)) It

can also be noticed that the different frequency

characteris-tics of the bandpass filter result in a different shape and

posi-tion of the shape the trajectory tends to form in the 2D plane

(Figures4(d),4(e))

2.2 Area calculation

As mentioned in the previous subsection, each data point in

thex-y plane has coordinates (x[nT], y[nT]) The size of an

area formed byn data points (n-point data vector) is used

as the detection function for locating QRS complexes The

area is obtained using plane geometry equation for a planar

non-self-intersecting polygon area calculation:

Area= 1

2





x1 x2

y1 y2





+





x2 x3

y2 y3









x n −1 x n

y n −1 y n









(1)

Polygon orientation is not important, so the absolute value

of the calculated area (determinant) has to be considered Lee

et al [11] calculated the sizes of areas comprised of ten data

points Their decision was based on the fact that if the average

QRS complex duration is less than 100 milliseconds (25 data

points at 250 samples per second), all polygons comprised

of ten data points are nonintersecting The experiment for

obtaining the optimum number of data points for our

algo-rithm is described inSection 3

2.3 Filtering

Targeted for HW implementation in FPGA, the chosen filter

belongs to a family of simple nonrecursive filters with

inte-ger multipliers [19,20] Impulse response of the filter used

in this work is shown inFigure 5(a) The filter comprises two

sections, where each section of lengthL calculates the

aver-age value ofL neighboring data samples; thus each section

represents a moving average filter By averaging consecutive

data samples, the high-frequency components of the input

signal are attenuated To attenuate power-line interference,

the lengthL of the two sections is calculated so that the

fil-ter has zero gain at 50 Hz (f 50) and multiples of 50 Hz For

250 Hz sampling rate (f s), the section length L is five:

L = f s

f50. (2) The filter can be redesigned for other sampling rates

accord-ingly, again attenuating 50 Hz Furthermore, the impulse

response of the filter was chosen in such a way that there

is a step between coefficient values This results in

empha-sis on high-speed transitions in the input ECG signal, that

1

0.8

0.6

0.4

0.2

0

0.2

0.4

0.6

0.8

1

Samples (a)

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0

Frequency (Hz) (b)

Figure 5: Filter characteristics: (a) impulse response, (b) frequency response

is, slopes of the QRS complex, and attenuation of the low-frequency components Frequency response of the filter is shown inFigure 5(b) The difference equation of the filter is the following:

y[n] = x[n] + x[n −1] +x[n −2] +x[n −3] +x[n −4]− x[n −5]− x[n −6]

(3)

Frequency response of the filter shows attenuation of low-and high-frequency components

We can also see approximately linear characteristic below the center frequency yielding sensitivity of the bandpass filter

to slopes in original signal and cancelation of the 50 Hz com-ponent and its multiples The center frequency of the filter designed is at 18.7 Hz and its cutoff frequencies are at 9.2 Hz and 29.3 Hz

An example of an input ECG signal and the filtered sig-nal is shown inFigure 6 It is clearly visible that faster slopes

in the original signal were emphasized or extracted, while

Trang 6

1000

950

900

850

800

750

t (s)

(a)

500

0

500

t (s)

(b)

Figure 6: Original ECG signal and filtered ECG signal

slowly varying waves like P wave, ST segment, and T wave

composed from low frequencies were attenuated

2.4 Detection threshold level calculation

The bandpass filter significantly reduces the influence of

lower- and higher-frequency components on the calculated

area, which can be seen when Figures4(f)and4(g)are

com-pared InFigure 4(g), representing the areas created by the

bandpass filtered signal, the peaks produced by the QRS

complexes can clearly be distinguished from other peaks

This is true even when the signal is noisy, like it is between

the third and the fourth heartbeats inFigure 4 The

reduc-tion of areas created by non-QRS artifacts enables a different

approach to the QRS complex detection threshold level

cal-culation than what was originally used in [11] Our detection

threshold level evaluation is based on the average value of the

detection function in the current data block As the average

value of the calculated areas in the block was not high enough

to filter out the peaks that were not due to QRS complexes,

multiplied average values were tested After extensive testing,

the optimal value to be used as a detection threshold level

was determined to be four times the average area value in the

data block

Two additional safety mechanisms for error prevention

were incorporated in our algorithm and are depicted in

Figure 7

The first mechanism assures that blocks, where the

cal-culated detection threshold level is too low, are treated as

blocks with no QRS Without this fail-safe, in blocks with

no QRS complexes, a peak of any height would be

recog-nized as a QRS complex and the number of false positive (FP)

detections would increase A search was conducted to find

the optimum lower limiting value that can be represented

Calculate thr new

thr new> thr old/8

Detect peaks, apply QRS rules at the end of the block

thr=thr new thr=thr old

Yes QRS found No

thr old=thr thr old=thr old/2

Stop detection?

Figure 7: Scheme of QRS complex detection threshold level adap-tation

with a combination of numbers of power of two This lim-itation was set to avoid divisions in HW Testing results indi-cated that the detection threshold level in the current block (thr new) has to be greater than 1/8th of the threshold level

in the previous block (thr old) If this is not the case, the old value is kept as a valid detection threshold level for the cur-rent block, otherwise the new value is used and the old one

is updated The second mechanism serves for recovery from false negative (FN) detections, as each time no QRS com-plex is found, the old detection threshold level (thr old) is decreased by 50% This proves to be useful in cases when nondetected weak QRS complexes are present; each time no QRS is detected, the detection threshold level (thr old) is lowered, and eventually becomes sufficiently low to start de-tecting the QRS complexes However, there is a limit to the number of the detection threshold level decreases The al-gorithm only allows three consecutive detection threshold level decreases, meaning that the detection threshold level can drop to 1/8th of its initial value The detection thresh-old level remains unchanged for all subsequent consecutive blocks with no QRS complexes

2.5 Peak search and QRS complex detection rules

QRS complex detection is based on a set of amplitude and timing criteria widely used in detection algorithms and is shown inFigure 9(a) After the detection threshold level (thr)

is set for the calculated areas, the block of the calculated areas

is searched for all peaks above thr and all peaks between thr/2 and thr All peaks that exceed thr are automatically treated as

Trang 7

1000

800

600

400

200

0

Time delay (ms)

Error at 600 samples, 8 points

FN=147

FP=426

FN=147

FP=412

FN=153

FP=371

FN=138

FP=299

FN=154

FP=276

FN=220

FP=423

FN=295

FP=837

FN=256

FP=670

(a)

1200

1000

800

600

400

200

0

400 500 600 650 700 750 800 900

Block length (samples)

Error at 20 ms delay, 8 points

FN=103

FP=954

FN=152

FP=562

FN=154

FP=276

FN=176

FP=262

FN=217

FP=199

FN=262

FP=184

FN=299

FP=168

FN=467

FP=136

(b)

500

475

450

425

400

Number of points for area calculation

Error at 600 samples, 20 ms delay

FN=151

FP=337

FN=148

FP=307

FN=154

FP=276

FN=175

FP=280

FN=185

FP=288

FN=212

FP=273

(c)

Figure 8: Influence of detection parameters ((a) time delay, (b)

block length, (c) number of polygon points) on the number of

missed and falsely detected beats

QRS candidates, while the peaks between thr/2 and thr are

stored to a separate list (half peaks) Every time a new QRS

candidate is found, the half peaks list is cleared If no QRS

candidates are found within 150% of the last RR interval,

the peaks from the half peaks list are added to QRS

candi-dates, and the half peaks list is cleared This procedure

cor-responds to the “search-back” procedure After the complete

block of the area values is swept and the QRS candidate list is

obtained, QRS decision rules are applied to the list

QRS complex decision is based on the peak mutual

dis-tance and amplitude criteria A sweep through the peaks in

the detection function is performed The position and height

of every peak in the QRS candidate list are compared to the

position and height of the last known peak in the list that

was recognized to originate from the QRS complex The first peak in the candidate list is automatically recognized as the QRS complex If the distance between the first and the second peaks is less than the refractory period (200 milliseconds), the higher of the two peaks is recognized as a QRS complex

In case the second peak is higher, the first peak is discharged and the second one is recognized as the first QRS complex If the distance is greater than the refractory period, the second peak is automatically recognized as a new QRS complex The third peak would then be compared to the first or the second peak, depending on which peak was recognized as the QRS complex

After all QRS complexes in the block have been located, the difference between the last two QRS complexes is consid-ered to be the RR interval If none or only one QRS complex

is detected in a block, the RR interval remains unchanged

It is also possible to calculate the RR interval as the mean value of all RR intervals within one block The performance testing showed that the latter method performed worse, for which its error persistence is to be blamed If one FP beat is detected, it takes several true positive (TP) detections to nul-lify its influence Since such errors can persist through sev-eral blocks, the error can increase even further Every FP de-tection causes the search-back to be performed sooner than

it should, which can lead to additional FP detections The opposite situation is also possible in cases when a few QRS complexes are missed (FN); the search-back interval can be increased and the search-back seldom performed This way, even more FN detections can occur when the QRS complexes have their amplitude below the detection threshold level

An additional feature of the QRS complex detection part

of the algorithm is the mechanism for block overlapping While in [13] consecutive blocks of data are overlapped by 75%, our algorithm uses the last detected QRS complex in

a block as a starting point for its subsequent block The method in [13] thus produces a constant 25% processing overhead as 25% of the data is always processed twice The overhead in our method is variable and spans between 6.7% (record 234) and 46.8% (record 231), but is with its average value of 19.1% lower than in [13] The same mechanism also sets the starting point when no QRS is found in the processed block In such cases, the new starting point of the following block is set at 450 samples of the currently processed block This means that the new block comprises 250 samples of the old data (one second of the ECG signal) and 450 samples of the new data In cases where low-amplitude QRS complexes are present but not detected, such block composition reduces the number of FN detections, as some portions of blocks are always processed twice and each time with a lower detection threshold level

To summarize, the main differences between the original algorithm [11] and the proposed algorithm are the foling The influence of the bandpass filter on noise and low-frequency signals causes the calculated phase-space portrait area to be smoother Additionally, the ECG signal is pro-cessed block-by-block, where block overlapping guarantees detection of QRS complexes that would normally be split into two separate blocks These two features make it possible

Trang 8

Read ECG data

Filtering, area calculation

Threshold

calculation,

start search

QRS detection

threshold exceeded

No

Yes

Add to QRS

candidates

Clear half peaks,

reset searchback cnt.

No

End of data block

Yes Apply QRS detection rules

to QRS candidates,

update RR interval,

update old threshold

No Stop detection

Yes Stop

Reduced QRS detection threshold exceeded

No

Yes Add candidate to half peaks

Time exceeds

RR interval

No

Yes Write half peaks

(a)

Read data

Filtering, area and threshold calculation

Else

Compare sample to thresholds

End of block

Apply QRS rules to QRS candidates

Update RR interval, transmit QRS locations

Add candidate to half peaks

Write QRS candidate

Clear half peaks, reset search-back cnt.

Else

thr/2 exceeded

thr exceeded

1.5 ∗RR interval exceeded

(b)

Figure 9: QRS complex detection algorithm: (a) flow chart of the SW implementation, (b) simplified state diagram of the HW implemen-tation

to calculate the QRS detection threshold level on the basis

of the average value of the detection function in the current

data block

3 IMPLEMENTATION

The algorithm performance is highly dependant on the time

delay parameterτ, data block length settings, and the

cho-sen number of polygon points For testing purposes, the

al-gorithm was first implemented in Matlab, where individual

detection parameters were set to give optimal QRS complex

detection performance in terms of the minimum number of

missed and falsely detected (FN and FP) QRS complexes

For each of the three parameters, the algorithm

perfor-mance was tested on the complete database Each test had

two parameters fixed and the third parameter was

chang-ing (Figure 8) First, the time delay parameter selection was made based on QRS complex detection performance with blocks of 600 data samples and 8 data points for area cal-culation (Figure 8(a)) In the next step, the block length was modified using the selected time delay and the same number of polygon data points (Figure 8(b)) Finally, the optimum number of data points used for area calculation was determined using 20 milliseconds delay and block length

of 600 data samples (Figure 8(c)) Parameter settings with the least detection error rate were chosen for the imple-mentation and algorithm performance was evaluated on the MIT-BIH Arrhythmia Database The time delay was set to

20 milliseconds, the block length was set to 700 samples, and the number of points was set to eight

Based on the SW implementation inFigure 9(a), a state-machine adapted copy of the algorithm shown inFigure 9(b)

Trang 9

was developed in VHDL The main difference between the

HW implementation and the SW implementation is true

parallel execution that the HW implementation offers

All grayed parts of the code inFigure 9(a)are in the HW

implementation executed independent of each other The

SW implementation needs to wait for the outcome of the

de-tection threshold level comparison, while in the HW

imple-mentation both detection threshold level comparisons (thr

and thr/2) are performed at the same time Such

schedul-ing significantly reduces the number of clock cycles needed

for data processing and improves data processing speed

Fur-thermore, the average value can be calculated in parallel with

area calculation, which also speeds up block processing

Another difference in the HW implementation is that in

the entire design only integer arithmetic is used The

deci-sion to represent the variables with 32 bits or less was made

to reach a compromise between the entered calculation error

and resource utilization Any variable that requires a greater

number of bits is appropriately modified Such modification

is only needed at average value calculation, when 700 30-bit

area size variables are to be summed The HW divider used

for average value calculation can only accept dividends of up

to 32 bits; therefore, before addition, each area value is

di-vided by 256 to achieve a 32-bit sum (dividend) Because of

the high area values, such division has no influence on the

detection accuracy, and does not also influence the

process-ing speed, since divisions with the power of two are in HW

only bit-shifts and zero padding

The HW implementation of the algorithm is designed to

accept the input data of a single ECG signal as a nonrepeating

stream, meaning that the input logic only accepts as much

data as needed to fill up the input buffer; if 200 samples of a

block need to get overlapped with the next data block, only

500 additional input samples are added to construct the next

data block The resulting QRS complex detection algorithm

inFigure 9(b)was implemented and tested with the Xilinx

XC2VP7 [24] development board To prove the concept, an

addition of a soft-core microcontroller and a serial port

in-terface were chosen for data transfer handling between the

development board and a PC

4 RESULTS AND DISCUSSION

The algorithm was developed on resampled data from the

MIT-BIH Arrhythmia Database The database contains 48

half-hour ambulatory records These records include

com-plex ventricular, junctional, and supraventricular

arrhyth-mias and conduction abnormalities Several of these records

have interesting rhythm features, QRS morphology

varia-tions, and variety of changes in signal quality, thus

repre-senting “real-world” clinical conditions that may present

dif-ficulty to Arrhythmia detectors

We tested standard performance measures such as the

sensitivity (Se) and the positive predictivity (+P) The Se

re-ports the percentage of true beats that were correctly detected

by the algorithm, while the +P reports the percentage of beat

detections which were in reality true beats The test results

presented in Tables1and2reflect the QRS complex detection

Table 1: Performance of the algorithm on the MIT-BIH Arrhyth-mia Database

Total 109494 109294 200 200 400 99.82 99.82

Trang 10

Table 2: QRS complex detection performance compared to several algorithms (based on [15, Table II]).

The numbers are recalculated

performance obtained utilizing data blocks of 700 samples,

time delay of 20 milliseconds and eight data points for area

calculation Because of initial data resampling to 250

sam-ples per second, the obtained QRS complex locations were

recalculated to match the 360 samples per second data rate of

the original data and the attribute file Then the performance

was tested applying a 40 milliseconds delay to the MIT-BIH

Arrhythmia Database The first channel of all 48 two-channel

records throughout their entire length was used for testing

the performance of the algorithm

The columns in Table 1 represent the record number

(REC), the number of heartbeats in the record (AHBs), the

number of correctly (true positive) (TP) detected heartbeats,

the number of missed (not detected) (FN) heartbeats, the

number of false positive (FP) detections, the sum of falsely

detected and missed heartbeats (FN + FP), the sensitivity (Se

[%]), and the positive predictivity (+P [%]), respectively

The results in Table 1 were obtained by the algorithm

modified for nonrepeating data reception through a serial

link The area calculation was performed on the data stream

and then partitioned to data blocks In order to enable block

processing through the complete record, 1000 replicates of

the last data sample were added to the end of all records The

algorithm was based on assumption that every block starts

at the last detected QRS complex, therefore data processing

starts 200 milliseconds after the block starts This is also the

case for the first data block where the first 200 milliseconds

of data are not scanned for peaks, which leads to FN

detec-tions at the start of some records (207, 208, 210, 214, 220,

and 233)

The algorithm performs well and stable on all tested

records (Table 1); however, performance on two records is

far worse than on other records The record 108 is

problem-atic for many detection algorithms because of the first-degree

AV block and high and sharp P waves The combination of

these two properties allows the P waves to qualify as the QRS

complexes and produce FP detections in several places in the

record Detection performance on the record 203 mainly suf-fers from nondetected (FN) beats, mostly premature ventric-ular contractions (PVCs) The nondetected PVCs have low amplitude and occur between two normal high-amplitude beats In such conditions, these beats either do not exceed any of the detection threshold levels or exceed the lower de-tection threshold level, but there is no search-back

To gain the sense of the algorithm performance on the MIT-BIH Arrhythmia Database, a comparison of detection results to a set of other well-known published algorithms is reported in Table 2 The columns in Table 2 represent the QRS detector (QRS detector), the number of tested (anno-tated) (ANN) heartbeats, the number of correctly (true pos-itive) (TP) detected heartbeats, the number of missed (not detected) (FN) heartbeats, the number of false positive (FP) detections, percentage of falsely detected and missed heart-beats among all tested heartheart-beats (Error %), the sensitiv-ity (Se [%]), and the positive predictivsensitiv-ity (+P [%]), respec-tively

With Se of 99.82% and +P of 99.82% the algorithm per-forms satisfactory when compared to other algorithms, and outperforms the founding algorithm [11] When the two al-gorithms are compared, it is interesting to see how the detec-tion performance is influenced by different filtering and de-tection threshold level calculation While our algorithm ex-hibits worse detection performance on, for example, records

104 and 108, it performs much better on, for example, record

222 We are confident that further algorithm improvements would lead to even better QRS complex detection results An improvement in detection threshold level calculation could prevent sudden baseline shifts or some QRS complexes from raising the detection threshold level to a point where no QRS

is detected in a subsequent block, which in the record 203 happens at 108.4 seconds Furthermore, incorporation of a positive-negative wave pair detection mechanism similar to other high-performance detection algorithms would exclude sudden baseline shifts from the QRS candidate list

Ngày đăng: 22/06/2014, 20:20

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN