Application Of Adaptive Signal Processing For Determining ... - IITB-EE

0 downloads 0 Views 87KB Size Report
ECG, i.e., Q-T, P-R, and other series are subjected to analysis. As ... López are with Grupo de Procesado Digital de Se˜nales (G.P.D.S), Facultad de Fısica ...
IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. 45, NO. 8, AUGUST 1998

1077

Communications Application of Adaptive Signal Processing for Determining the Limits of P and T Waves in an ECG Emilio Soria-Olivas, Marcelino Mart´ınez-Sober, Javier Calpe-Maravilla,* Juan Francisco Guerrero-Mart´ınez, Javier Chorro-Gasc´o, and Jos´e Esp´ı-L´opez

Abstract—A new algorithm for the determination of the limits of P and T waves is proposed, and its foundations are mathematically analyzed. The algorithm performs an adaptive filtering so that the searched point corresponds to a minimum. Crucial properties of its performance are discussed, i.e., immunity to base line drifts and full adaptation to any cardiological criteria. A series of tests are made involving real registers with different morphologies for P and T-waves.

(a)

Index Terms—Adaptive signal processing, P-wave, T-wave.

I. INTRODUCTION The determination of the limits of the different waves that constitute an electrocardiogram (ECG) is fundamental in cardiological diagnosis; in this context, the processing of R-R time-series has afforded good results in diagnosing cardiac dysfunctions. These timedomain studies are currently being extended to other segments in the ECG, i.e., Q-T, P-R, and other series are subjected to analysis. As in the case of the R-R time series, these new series may prove to be of fundamental help in the determination of hidden cardiopathy. As an example, Q-T series have been proposed as a marker of sudden death risk. Many algorithms are able to determine the limits of the different waves that form an ECG register [1], [2]. The difficulty of determination varies greatly from one wave to another; thus, fixing R is quite simple in comparison to our present concern, i.e., the location of P and T boundaries. Such difficulties are due to: 1) oscillations in the base line of a typical ECG and 2) the adoption of different criteria among cardiologists. The base line serves as an algorithm reference, setting the boundaries of ECG waves based on amplitude criteria. Thus, base line drifts lead to deficient algorithm performance. This is of particular concern in exercise registers, where ECG recordings are greatly affected by the electromyogram. The second difficulty mentioned above arises from the different criteria used by cardiologists in establishing the limits of the waves. Thus, some set the end of T at the inflection point of the final part of the wave, while others consider the intersection between the base line and the tangent with maximum slope in this final area. The implementation of an algorithm taking into account these often Manuscript received October 19, 1994; revised March 10, 1998. This work was supported by the Generalitat Valenciana under Project GV-2235/95. Asterisk indicates corresponding author. E. Soria-Olivas, M. Mart´ınez-Sober, J. F. Guerrero-Mart´ınez, and J. Esp´ıL´opez are with Grupo de Procesado Digital de Se˜nales (G.P.D.S), Facultad de F´ısica, Universitat de Valencia, Valencia 46100 Spain. *J. Calpe-Maravilla is with Grupo de Procesado Digital de Se˜nales (G.P.D.S), Facultad de F´ısica, Universitat de Valencia, c/Dr. Moliner 50, Burjassot, Valencia 46100 Spain (e-mail: [email protected]). J. Chorro-Gasc´o is with Servicio de Cardiolog´ıa, Hospital Cl´ınico Universitario. Valencia 46010 Spain. Publisher Item Identifier S 0018-9294(98)05333-6.

(b) Fig. 1. (a) Original ECG and (b) high-pass filtered ECG.

contradictory criteria, would be very complex. As a result, only one criterion is adopted in most cases, which in turn leads to rejection by a number of users. The algorithm developed in the present study overcomes both inconveniences: it is immune to base line drifts and is able to adapt to cardiologist criterion in determining the boundaries of P and T waves. Moreover, it is immune to Gaussian noise addition. The algorithm has been applied to obtain time-series in 5-min registers from healthy individuals. These series are extensively used in clinical research [3]. II. MATHEMATICAL DEVELOPMENT One of the first approaches for eliminating base line variations consisted of applying a high-pass filter with a cutoff frequency below 0.8 Hz. This filtering deforms the ECG, as shown in Fig. 1. Widrow [4] implemented this filter employing a first-order adaptive system with an equal-to-one constant reference input. The system followed the basic least-mean-square algorithm [5], attempting to minimize the mean-square error between the primary or desired signal and the output of the adaptive filter y (n) (Fig. 2). Widrow [4] showed that the transfer function for the described adaptive system is

E (z ) P (z )

=

0 z01 1 0 (1 0 ) 1 z 01 1

(1)

where  is known as the adaptation constant. The starting point of our algorithm for determining P and T wave limits, originates from a careful visual inspection of Fig. 1. In effect, in the filtered ECG, a minimum appears near the end of T. The key consideration in our method is to determine whether the position of the minimum may be controlled by modifying the adaptation constant. If so, the minimum could be set at the end of T. Thus,

0018–9294$10.00  1998 IEEE

1078

IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. 45, NO. 8, AUGUST 1998

In this way, (7) is reduced to

d(n) =  1

N r=0

r 1 d(n 0 r)

(11)

where N is the time-constant of the exponential averaging in (7). Expression (11) leads to the estimation of the adaptation constant. In the segments from the peak of T (P) to the limits of the wave, the derivatives (slopes) of close samples are similar. Thus, a sensible approximation would be

d(n)  = d(n 0 r 0 1);

Fig. 2. Schematic representation of an adaptive system.

with a suitable choice of the constant, it would be easy to determine this characteristic point by merely applying an extreme criterion. The first step in estimating the constant involves the expression of (1) as a difference equation, where p(n) is the ECG and e(n) is the error

e(n) 0 1 e(n 0 1) = ecg(n) 0 ecg(n 0 1)

(2)

where is equal to 1 0 : The second term in (2) is the derivative of the ECG, which is noted as d(n): This is an iterative expression which, considering that e(0) = 0, can be written as

e(n) =

0

n 1 r=0

r 1 d(n 0 r):

(3)

The condition to be applied consists of making zero the first derivative; this is easily shown to be a minimum for “well-behaved” T-waves, and a maximum for inverted waves. To calculate the derivative e(n 0 1) is subtracted from both terms in (2), i.e.,

e0 (n) = ( 0 1) 1 e(n 0 1) + d(n)

and making

e0 (n) equal to

(4)

zero we obtain

0 ) 1 e(n 0 1) = d(n)

(1

=

(5)

d(n) : e(n 0 1)

(6)

In expression (6), we observe that in order to establish the constant, a previous filtering of the ECG is required to calculate e(n 0 1). Cardiologist criterion is taken into account to establish an initial estimate of the constant. By replacing in (5) the expression given in (3), we obtain the condition for locating the extreme

1

0

n 2 r=0

r 1 d(n 0 1 0 r) = d(n):

(7)

From (7), algorithm immunity to Gaussian noise can be accounted for: as the value of is very close to one, the exponential average is almost a simple average with equal weights, and this is known to increase the signal-to-noise ratio. The time constant, ; for the exponential average in (7) is given by



=

1

(8)

e

taking natural logarithms and making a first-order approximation ln(1

0 x) = 0x

when

x!0

0

 r  N:

(12)

A second approximation might be

 = 1:

(13)

With these two simplifications, and using (11) we obtain

=

1

N +1

 =

1

N

for large N:

(14)

Equation (14) provides the estimation of the parameter used to perform the first filtering that will enable us to calculate its definitive value according to (6). The estimation must in turn be coherent with approximations (12) and (13). The cardiologist marks the limits of P or T according to his or her personal criterion, obtaining a constant by applying (14). The constant is in turn used in the adaptive filtering of the ECG, which will result in a definitive constant according to (6). This is a valid distance because it verifies (12). Moreover, this length is long enough to employ (14) in estimating the parameter while verifying (13). A final filtering is performed with this new constant, and these characteristic points are easily identified, since the discrete-time derivative will be equal to zero for them. If the sampling frequency is too low for the above approximations to be valid, an interpolation is performed to increase the length of the considered segment [6]. This in turn makes it possible to employ the algorithm with different sampling rates. The present method can be applied to determine the onset and offset points of every segment that satisfies the quoted approximations (inverted T waves, T waves with slow downturns, “well-behaved” P waves, etc.), yet may prove useless for other ECG segments of different morphology (e.g., Q wave). The two main features of the algorithm demonstrated in this study are as follows. 1) The base line variations exert no influence upon the performance of the algorithm, as the latter removes them. Indeed, this was the first application found for this system [4]. 2) The criterion of the cardiologist is the starting point of the algorithm, as he or she chooses the limits of the considered waves. This is the point of reference taken by the algorithm in deciding where to establish the limits of the waves in the ECG. In order to detect the beginning of the P and T waves, the ECG is time-inverted so that these points appear at the rear end. The method discussed above may then be applied because the analyzed segments meet the requirements specified in approximations (12) and (13).

(9) III. EXPERIMENTAL RESULTS

we obtain



=

1



:

(10)

In order to obtain the registers used to validate the algorithm, two sources have been chosen as follows.

IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. 45, NO. 8, AUGUST 1998

TABLE I DIFFERENCES (IN MS) BETWEEN THE VALUES MARKED FOR THE BEGINNING OF P CARDIOLOGISTS AND THE ALGORITHM DEVELOPED IN THE PRESENT STUDY

1079

BY

TABLE II DIFFERENCES (IN MS) BETWEEN THE VALUES MARKED FOR THE END OF T BY CARDIOLOGISTS AND THE ALGORITHM DEVELOPED IN THE PRESENT STUDY

TABLE III DIFFERENCES (IN MS) BETWEEN THE VALUES MARKED FOR THE ONSET OF P AND THE END OF T BY A CARDIOLOGIST AND BY THE ALGORITHM FOR 24 MIT-BIH REGISTERS

1) ECG recordings acquired at the Hospital Cl´ınico Universitario (Valencia, Spain), using an HP-7830A ECG recording system with D-II leads; the recordings were stored on magnetic media with a DAT (model TEAC RD-120T), sampled at 1 kHz and finally processed with a 100 taps low-pass FIR filter with a Blackman window. 2) Database registers from the MIT-BIH Database. The first result to be illustrated constitutes one of the main characteristics of the algorithm, i.e., its ability to adapt to cardiologist criterion. Tables I and II show the differences (in ms) between the limits marked by the algorithm and by two different cardiologists. These data have been obtained by averaging the values given by a series of pulses (50 for each register). The mean and standard deviation (s.d.) are given for the different biases (algorithm-cardiologist and cardiologist-cardiologist). The beginning of P and the end of T have

been chosen to appear in these tables, to investigate the possibility of applying the algorithm to the boundary detection of P and T waves. Tables I and II reflect the goodness of wave limits detection. The low values of both the mean and s.d. reflect the quality of the “learning” capacity of the algorithm, following the criteria of each cardiologist. A broader verification has been carried out with 24 registers from the MIT-BIH database, with different T-wave morphologies. Fifty consecutive beats were considered in each register. Table III shows the mean and s.d. of the differences between the values marked by a cardiologist and by the algorithm trained by him. The low values obtained reflect the ability of the algorithm to abide with cardiologist criteria. Another feature in evaluating the precision of the method involves performing a linear regression analysis of the length of a certain ECG segment given by the algorithm and by the cardiologists for each file.

1080

IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. 45, NO. 8, AUGUST 1998

TABLE IV LINEAR REGRESSION COEFFICIENTS BETWEEN THE VALUES CHOSEN BY CARDIOLOGISTS AND BY THE ALGORITHM DEVELOPED IN THE PRESENT STUDY

ACKNOWLEDGMENT The authors would like to thank Dr. P. Laguna from the University of Zaragoza for his valuable suggestions and providing some of the registers. They also wish to thank the referees for their constructive suggestions. REFERENCES

Fig. 3. End of T estimation by the algorithm in an ECG with a highly disturbed base line.

The R-T segment has been analyzed because very precise methods are available for fixing R-wave position; in this way, the error is attributable to a deficient determination of the end of T. In Table IV, regression coefficients between the limits given by the algorithm and by several cardiologists are shown for the considered registers. Table IV shows that the algorithm is well adapted to the criterion of each cardiologist, since the algorithm-cardiologist regression coefficients are very close to one. The slope and offset of the regression line and mean value of the residual errors emphasize the validness of our approximation, as the algorithm-cardiologist values are always closer to optima (one for slope, zero for offset and residual errors). The results of applying a test to measure the degree of fit based on [7] reflect its goodness at a significance level of 0.005 (i.e., maximum). The previously commented immunity to base line variations is reflected in Fig. 3, where the algorithm is applied to an ECG with considerable base line oscillations. This register was obtained by adding the base line drift due to respiration to register number 306 in the MIT-BIH database. IV. CONCLUSIONS An algorithm for the detection of the limits of T and P waves has been developed and discussed. Two main drawbacks are avoided in this determination, i.e., base line variations and differing cardiologist criteria. A series of simulations on real registers has been performed to complete the mathematical discussion, in support of the theoretical expectations. Evaluations are underway to appraise its performance in the determination of other characteristic ECG points.

[1] P. Laguna, R. Jan´e, and P. Caminal, “Automatic detection of wave boundaries in multilead ECG signals: Validation with the CSE database,” Computers, Biomed, Res., vol. 27, pp. 45–60, 1994. [2] C. Li, C. Zheng, and C. F. Tai. “Detection of ECG characteristic points using wavelet transforms,” IEEE Trans. Biomed. Eng., vol. 42, Jan. 1995. [3] P. W. Mc Farlane and T. D. Veitch, Comprehensive Electrocardiology. New York: Pergamon, 1989. [4] B. Widrow and J. R. Glower, J. M. McCool, J. Kaunitz, C. S. Williams, R. H. Hearn, J. R. Zeidler, E. Dong, and R. C. Goodlin, “Adaptive noise canceling: Principles and applications,” Proc. IEEE, vol. 63, pp. 1692–1716, Dec. 1975. [5] C. F. N. Cowan and P. M. Grant, Adaptive Filters. Englewood Cliffs, NJ: Prentice-Hall, 1985, ch. 1. [6] “Programs for digital signal processing,” in Algorithm 8.1. New York: IEEE Press and Wiley, 1979. [7] K. S. Shanmugan and A. M. Breipohl, Random Signals: Detection, Estimation and Data Analysis. New York: Wiley, 1985, pp. 538–540.

Suggest Documents