Summary: In this paper different types of ECG automatic delineation approaches were overviewed. A combination of these approaches was used to create sampling rate automatically adaptive filtration approach for ECG delineation that is capable of distinguishing different morphologies of T and P waves and QRS complexes.
Key words: delineation, ECG, wavelets, CWT, SWT, QRS complex, P wave, T wave.
Technical sciences
УДК 004.021:004.93
Nikolaiev Sergii
Ph.D. student
National Technical University of Ukraine
“Igor Sikorsky Kyiv Polytechnic Institute”
Chereda Hryhorii
Master’s student
National Technical University of Ukraine
“Igor Sikorsky Kyiv Polytechnic Institute”
SAMPLING RATE INDEPENDENT FILTRATION APPROACH FOR AUTOMATIC ECG DELINEATION
Summary: In this paper different types of ECG automatic delineation approaches were overviewed. A combination of these approaches was used to create sampling rate automatically adaptive filtration approach for ECG delineation that is capable of distinguishing different morphologies of T and P waves and QRS complexes.
Key words: delineation, ECG, wavelets, CWT, SWT, QRS complex, P wave, T wave.
I. INTRODUCTION
The healthcare industry is now on the cusp of disruptive changes and the new technologies are being developed will truly alter the way how the medical care is provided to the patients. The medicine in the 21st century will be functioning in the framework of a fundamentally new P3 paradigm: predictive, preventive and personalized medicine (PPPM). This means that the healthcare will become proactive but not reactive and medical sensors become ubiquitous, the streams of bio-data available to clinicians will completely overwhelm their ability to understand this amount of information and react in real time. To deal with this “ocean of bio-signals” (Big Data), we need to develop fast and reliable automatic signal processing algorithms that can adapt to the peculiarities of individual person. Якір[1]
ЯкірNowadays the cardio vascular diseases are the major cause of death and because of that more and more businesses every year create smart-garments that measure Якірelectrocardiogram (ECG) in daily life. These garments require ECG automatic real-time analysis and heart pathologies detection software.
So, we may state the importance of automatic ECG signal processing and analysis tools development. These tools contain several stages of information processing like raw analog signal noise reduction, digitized signal filtering, digitized ECG delineation for marking of P, T waves and QRS complexes (heartbeats), time- and amplitude- and frequency-based feature retrieval, machine-learning or rule based approaches for pathology detection and prediction. [2]
ЯкірThe paper is organized as follows: in Section II, we focus on the overview of the ECG automatic delineation algorithms. The usage of continuous wavelet transform (CWT) filtration with automated adaptation for different sampling rates is described in Section III instead of the use of the stationary wavelet transform (SWT) for the input ECG signal delineation. The obtained results of our approach and comparison with SWT method are discussed in Section IV. Finally, the conclusions are presented in Section V.
II. DELINEATION ALGORITHMS OVERVIEW
All delineation algorithms can be divided into two major groups: those that detect only QRS complexes peaks and wave delineation algorithms that find all peaks including full marking of P and T waves.
One the most famous examples from the first group is Pan-Tompkins approach [3]. It is used to find R-peak position on the raw ECG signal by calculating adaptive thresholds.
ЯкірWe consider the second type of algorithms, where determination of P- and T-waves is performed after the determination of the location of QRS complexes. We can name Chesnokov [4] and Laguna [5] approaches as the great examples of Якірsuch algorithms. But even their methods are not ideal.
Chesnokov ECG delineator uses ЯкірЯкірCWT that performs the filtration of digitized ECG signal equally good for given wavelet analyzing frequencies regardless of the ECG sampling rate.
One of the drawbacks of the approach is that the proposed architecture cannot automatically determine whether the T-wave is biphasic. This parameter can be optionally set by the user before starting the delineator, but it requires a prior knowledge from the user about the analyzed ECG. Also this approach cannot differentiate between ascending and descending T-waves.
Laguna delineator approach allows the annotation of ECG waves for any configuration of P- and T- waves and QRS-complexes. But the main drawback is that filters used in ЯкірЯкірSWT (algorithme à trous [5]) need to be individually tuned for ECG signals recorded with different sampling rates.
Our goal is to combine these two approaches to create sampling rate independent filtration approach for automatic ECG delineation that is capable of recognizing biphasic, ascending and descending T-waves.
III. METHODS DESCRIPTION
The ECG signal consists of different parts: complexes (heartbeats ranges) and waves (like P- and T-waves). Physicians use them to determine heart pathologies. The waves contain various spectral components which appear at certain moments of time that can be automatically analyzed. To analyze these components in the time-frequency representation special tools and approaches are used.
One well-known approach is short time Fourier transform (STFT) [6]. The main idea is to apply Fourier transform to parts of the signal (called windows) where the signal appears to be stationary. But the biggest challenge for this approach is to find optimal window width. To overcome this problem the wavelet transform (WT) approach is used in recent years. This approach implements the decomposition of non-stationary signal on the basis obtained by compression and displacement of a function (prototype wavelet). According to [7] a good selection of parent wavelet will allow to obtain a satisfactory resolution for both time and frequency domains.
Formally continuous wavelet transform can be represented as a function of two variables:
(1)
where is a scale, - prototype wavelet, is the signal. It can be considered as inner product in (space of Якірsquare-integrable functions, defined on the real axis) and as a mutual correlation of the signal and the wavelet. The larger scale – the lower frequency f is extracted by the CWT, f~1/a. Parameter – offset of the wavelet. The asterisk defines a complex conjugation of the wavelet.
Equation (1) could give the impression that an exact value of the signal frequency can be extracted at a certain moment of time. However, taking into account a broad interpretation of Heisenberg uncertainty principle, in general case this conclusion is not true. From this principle the fact follows - it is impossible to determine which harmonic signal components are present in a fixed time, you can only get an idea of a certain frequency range at a certain time interval.
If prototype wavelet is the derivative of some smoothing function then CWT of signal at scale a is [8]:
(2)
where is the scaled version of the smoothing function. The CWT at fixed scale a is proportional to the derivative of the filtered signal with a smoothing function . Zero-crossings of the WT correspond to the local maxima or minima of the smoothed signal at different scales, and the maximum absolute values of the wavelet transform are associated with maximum slopes in the filtered signal. A quadratic spline wavelet which is a derivative of a smoothing function is used in this work.
IV. DEPENDENCY BETWEEN FREQUENCY, SAMPLING RATE AND SCALE
Fixed scale CWT extracts certain interval of frequency components at the fixed sampling rate. The principal frequency f at a fixed scale a analyzed by CWT is proportional to the sampling rate sr. These values are bounded by the following equation:
(3)
To obtain the equality, we need to find a constant Якірvalue Якірfc. For a certain wavelet at fixed scale a this constant equals to the frequency, where Fourier spectrum of the wavelet reaches its maximum. We established that fc = 0.2685 for quadratic spline wavelet:
(4)
and fc = 0.16 for derivative of a Gaussian smooth function.
(5)
The scale a and the offset of the wavelet can be discretized. This allows us to use the main idea of discrete wavelet transform (DWT) - decomposition of the in approximating and detailing parts ( represents the scale factor):
(6)
where - is the scale function; – wavelet function.
The DWT can be implemented by passing the discrete time signal through a high pass and a low pass filters. The original signal can be obtained through the reconstruction filter bank.
The authors in [5] have used theanalysis filter bank based on quadratic spline wavelet (4) in SWT:
(7)
The equivalent frequency response for the filters in SWT for k-th scale is
(8)
where , are the frequency responses of filters (8)
(9)
The filter bank (7) was used in [5] with the sampling frequency equal to 250 Hz. For the adaptation to other sampling rates, the authors in [5] adequately resample the equivalent filter impulse responses at 250 Hz to other sampling rate values. But this procedure is time-consuming and can’t be done automatically for all sampling rates.
Main SWT scales in [5] were 21, 22, 23, 24, 25 at 250 Hz sampling rate. We should get values of the fixed frequencies, which analyzed by quadratic spline wavelet on those scales at 250 Hz sampling rate. After that we will generalize them into other sampling rates.
Let’s define frequencies which are mainly analyzed by SWT filters (7) at scales 21 - 25. Each of these frequencies corresponds to the point, where the maximum of the SWT frequency response (8) is achieved (Fig. 1). After that we put the found frequency value to the Table 1. The scale a can be defined as a function of sampling rate sr from (3):
. (10)
By this way we obtain an adaptation for the scale for any sampling rate at fixed frequency f mainly analyzed by the wavelet.
Table 1
Obtained Frequencies for Given Scales
Proposal. We propose to use CWT with recalculation of the scale factor according to (10) at fixed frequencies from Table 1 instead of the use SWT which could not be automatically adjusted to different sampling rates.
Let’s compare the CWT frequency response and the frequencies responses from SWT filters (8). For this purpose we compute Fourier spectrum of the wavelet (4) assuming that the wavelet’s scale was recalculated in accordance with (10). The frequency responses of the wavelet (4) and filters (8) at k-th scale are denoted respectively as and (Fig. 1).
Fig 1. Comparison of frequency responses for SWT and CWT based filtration at different scales.
The Figure 2 presents the Chebyshew error of processed ECG signals in time domain that were normalized. As for the scale 21, we also have a good approximation at sr > 250 Hz (see Fig. 2 below).
Fig 2. Wavelet transforms and their error at scale 21, 23, 25.
It can be observed that the frequency responses of the quadratic spline wavelet with scales recalculated by (10) constitute precise approximation of the original filters up to a frequency of 125 Hz.
V. RESULTS
The SWT and CWT methods were applied to ECG signals with 250 Hz sampling rate. Tests were performed on sell100.dat file from QTDB [9]. We denote signals obtained at a fixed scale 2k by the SWT and CWT (for CWT the scale and corresponding frequency are taken from Table 1) as Qk[n] and Tk[n] respectively. The CWT and SWT methods were compared using of Chebyshev error:
(11)
But before calculating errors in (11), the signals filtered by CWT and SWT must be normalized in the range of [-1, 1]. For signal x[n]:
(12)
The results of comparison can be observed in Table 2 and Figure 2.
Table 2
Chebyshev errors at different scales
According to Table 2, CWT deviates from SWT at scale 21. As we can see from the Fig. 2, the most significant errors are present at spikes of the CWT, but in general, approximation could be interpreted as satisfactory for 125 Hz and 250 Hz sampling rates.
For the third scale 23 and the fifth 25 the obtained approximation is better (Fig. 2). The errors on spikes are decreasing at bigger scales. At the fifth 25 scale we have almost perfect approximation.
Scales21, 22, 23, 24 are relevant for calculating the thresholds in [5] that define the existence of QRS complex.
Despite of obtained deviations between CWT and SWT at the QRS complexes locations at scales 21 and 22 these errors are irrelevant for finding positive maximum and negative minimum pairs (so called maximum modulus lines [5]) on the CWT and SWT graphs (Fig. 2) becausemaximum modulus lines and (2) guarantees zero crossing of WT with OX axis at local maxima or minima on the ECG signal.
Scales 24 and 25 are used for P, T waves delineation. As for these scales, we obtained a good approximation. More significant Chebyshev error appears at QRS complex location, which is not involved in P and T wave delineation. In this case, there is no need to change the delineation thresholds in Laguna algorithm.
VI. Conclusion
In this paper the approach for signal filtering in the ECG automatic delineation problem was researched.
A combination of Chesnokov and Laguna approaches was used to create sampling rate independent filtration algorithm for automatic ECG delineation that is capable of distinguishing different morphologies of T and P waves and QRS complexes.
The algorithm accuracy was investigated for different wavelet scales and despite of relatively valuable Chebyshev error between CWT and SWT it had no significant influence on the ECG delineation precision.
It was shown that continuous wavelets transform with automatic adaptation for different sampling rates can be used instead of stationary wavelet transform for the delineation problem.
REFERENCES