DOI: 10.14529/ctcr210107
WAVELET-CONVERSION IN ELECTROCARDIO SIGNAL PROCESSING
V.F. Telezhkin1, [email protected],
B.B. Saidov1'2, [email protected], [email protected],
P.A. Ugarov1, [email protected],
A.N. Ragozin1, [email protected]
1 South Ural State University, Chelyabinsk, Russian Federation,
2 Tajik Technical University named after academician M.S. Osimi, Dushanbe, Republic of Tajikistan
In the present work, processing of an electro cardio signal using a wavelet transform is considered. In electrocardiography, various digital signal-processing techniques are used to detect, extract, and analyze the various components of an electrocardiogram. Among them, the wavelet transform technique gives promising results in the analysis of the time-frequency characteristics of the electrocardiogram components. The urgency of solving the problem of improving the quality of life of people with the help of early diagnosis and timely treatment of various cardiac diseases is obvious. The process of automated analysis of a huge database of electrocardiographic data is especially important. Wavelet analysis can be successfully used to smooth and remove noise in the ECG signal. Electrocardiogram signal, cleaned from noise components, looks clearer, while its volume is from 10 to 5% of the original signal, which largely solves the problem of storing cardiac records. Aim. Development of an algorithm for threshold processing of wavelet coefficients and filtering of an electrocardiography signal. Materials and methods. Cardiograms were taken for analysis. Then they were digitized and entered into a computer for processing. A program was written in the MATLAB environment that implements continuous and discrete wavelet transform. Results. The work shows the result of filtering the ECG signal with the addition of noise with a signal-to-noise ratio of 35 and 45 dB using the decomposition levels N = 2, N = 3, N = 4. Conclusion. Based on the analysis of the data obtained, it can be concluded that the second level of decomposition is the most optimal for filtering the ECG signal. With an increase in the level of decomposition, the output ratio decreases, at the level N = 4 the output signal-to-noise almost does not exceed the input one, therefore, the filtering becomes ineffective. The correlation coefficient to the fourth level is significantly reduced, which means a significant increase in the distortion introduced by the filtering algorithm.
Keywords: electro cardio signal, wavelet transform, filtering algorithm, development of an algorithm.
Introduction
The increase in the number of diseases and deaths associated with functional disorders of the cardiovascular system is one of the most important problems of modern medicine. The urgency of solving the problem of improving the quality of life of people with the help of early diagnosis and timely treatment of various cardiac diseases is obvious. The process of automated analysis of a huge database of electrocardiographic data is especially important.
In recent years, a number of new noise reduction techniques have emerged. One of the first works in this area was devoted to cleaning the ECG signal from additive filter noise [1-9]. In the literature in the field of ECG research, a large number of noise reduction methods are currently described, for example, wavelet transform [10, 11], adaptive filter [12], fuzzy threshold [10], band rejection filter, nonlinear filter, Kalman filter [13] stationary wavelet transform [11] and Fourier transform. However, the approach based on the wavelet transform gives the most promising results [12].
Wavelet analysis can be successfully used to smooth and remove noise in the ECG signal. Electrocardiogram signal, stripped of noise components, looks clearer, while its volume is from 10 to 5% of the original signal, which to a large extent solves the problem of storing cardiac records.
The electrocardiogram signal, ECG, plays a critical role in the diagnosis of human heart disease. The primary processing of the ECG signal data and its subsequent study becomes much more efficient if the signal has no noise component, therefore, noise removal is a task of paramount importance [14].
When recording an ECG, the signal is inevitably more or less distorted by various noises. For example, network high-frequency interference of the electrical network (network noise), noise of electrocardiograph amplifiers, muscle tremor, low-frequency swimming of the isoline due to breathing. Fast discrete wavelet transform effectively removes the noise present in the digitized signal. The purpose of this work is to develop an algorithm for threshold processing of wavelet coefficients [1].
To implement the procedure for wavelet filtering of the CS, the method of threshold processing of coefficients was chosen. In the course of the work, an algorithm for the wavelet filtering of the CS by the thresholding method was developed and implemented [15]. There is a wide choice of wavelet bases used for filtering signals by the thresholding method, the choice of the wavelet function and noise reduction parameters, such as the type of threshold, the level of decomposition, etc., plays a decisive role in the method's operation. To implement the algorithm and conduct modeling, software was written in the language programming MATLAB.
1. Noises arising from registration of ECG signals
When recording an ECG, the signal is inevitably more or less distorted by various noises. The high-frequency components of the cardiac signal are considered to be noise. To smooth the cardiogram, high-frequency components are usually removed using various filters. It is clear that some of the information recorded by the cardiograph is lost. The origin of the high frequencies of the cardiac signal is not fully understood. The network high-frequency interference of the electrical network (network noise), due to the inclusion of a large number of electrical appliances in the electrical network, and the electronic noise of the electrocardiograph amplifiers have some influence. The frequency of this interference is 50 or 60 Hz [11].
It is assumed that physiological high-frequency noises are to a large extent a consequence of the electrical activity of the heart, since they are recorded by sensors located near the heart. Also, the noise causes the baseline to float, the baseline drift is a low-frequency interference with a frequency of less than 1 Hz, due to the influence of respiration and high skin resistance. The volatility of the isoline affects the accuracy of measuring the amplitude parameters of the electrocardiosignal, since it is from it that the count is taken. Traffic disturbances appear as single or cyclical bursts. The frequency of such interference is in the range from 1 to 40 Hz. They arise as a result of a change in the position of the patient or the electrode, hiccups, coughing, etc. In modern technical equipment with appropriate grounding, the hardware noise is practically insignificant in comparison with physiological noise. Effective separation of high-frequency noise components is possible using wavelet transform of the signal [3].
2. Noisy signal model
Wavelet analysis is effectively used to remove noise in a signal. Let's consider the simplest model, where the noisy signal looks like:
Gaussian white noise is a stationary random sequence that is absolutely uncorrelated, with a mathematical expectation of zero and a variance of one. The signal n(t) is called white noise, because it has a constant spectrum at all frequencies, by analogy with white light, which has a uniform continuous spectrum in the visible part [13].
The essence of noise removal, in other words, signal filtering, consists in suppressing the noise part n(t) of the signal and restoring the useful signal S(t). In this paper, a threshold filtering algorithm with one-parameter threshold functions is used.
(1)
3. Threshold processing of wavelet coefficients
Wavelet transform of signals is one of the types of spectral analysis, the most famous representative of which is the Fourier transform. The English word wavelet (from the French "ondelette") literally translates as "short wave". In various translations of foreign articles, there are also terms such as: "burst", "burst function", "low-wave function" and others [1-4].
Continuous wavelet transform is carried out according to the formula:
W ( x,, ) = 1 +jV i^ 1 f (t ) dt
—m ^ '
{x, s ) = - jy I — | f (t) dt, (2)
where t is the time axis; x is the time instant; s is the parameter inverse to the frequency (scale); y* means the complex conjugate; f {t) is the signal under study;
W {x, s) is the result of
the wavelet transform for 2 values x and s; y is the wavelet function. Expression [7] is used for discrete transformation.
dj,k =jVj,k {x) f {x)dX (3)
where d is the coefficient for the scale j (j = 0, 1, -n) and point k. Scaled and offset versions of the parent
j
wavelet: y j к = 2 k y ( 21 x - к ).
' j k ti" X ^
The result of the Wavelet transform of the signal is the decomposition of the signal into approximating coefficients ^mk, which represent the smoothed signal, and detailing coefficients Dmk, which describe the oscillations.
It is known that the noise component is more reflected in the detailing coefficients Dmk. Therefore, for noise removal, usually only detail coefficients are processed.
The second assumption is that the noise component is a signal that is less in magnitude than the main one. Therefore, the simplest way to remove noise is to zero the coefficient values that are less than a certain threshold value [2].
This procedure is called coefficient thresholding and, ideally, allows you to get rid of the coefficients due only to the noise component and preserve the decomposition coefficients of the main signal. In foreign literature, the threshold processing of coefficients is called thresholding.
There are such thresholding methods as hard tresholding and soft thresholding. With strict thresholding, all coefficients exceeding a certain threshold value t are considered to belong to the original signal, and the smaller ones are referred to as noise and are zeroed out. With soft thresholding, the modulus coefficients smaller than t vanish, the remaining coefficients decrease in modulus by the value of t.
The value of the threshold value t plays the role of a control parameter that affects the filtering error. The choice of the threshold value determines the quality of the signal noise reduction, estimated as the signal-to-noise ratio.
With an underestimated value of t, some of the noise expansion coefficients do not vanish, which leads to poor filtering, the signal-to-noise ratio increases only by an insignificant amount. When the threshold t is overestimated, some of the informative coefficients vanish, the filtered signal is distorted [5].
Searching for the optimal value of t means finding such a threshold that, with the smallest change in the reconstructed signal, provides the highest value of the signal-to-noise ratio [3].
The quality of signal noise reduction and, consequently, the degree of increase in the signal-to-noise ratio depends not only on the type of the trasholding function, but also on the method of its application. Distinguish:
• general trasholding, carried out using a fixed value of the threshold t - a value that is the same for all levels of decomposition and signal detail coefficients;
• multilevel trasholding, carried out using the threshold t, the values of which vary from level to level;
• local trasholding, implying the use of the threshold t, variable not only in terms of the level of decomposition, but also depending on the position of the detail coefficients at a given level.
4. Development of an algorithm for threshold processing of wavelet coefficients
Based on the generalized wavelet filtering algorithm, we will compose a wavelet filtering algorithm using the thresholding method of coefficients:
1) Decomposition (Direct wavelet transform):
a) Choosing a wavelet function;
b) Choice of the decomposition level N;
c) Calculation of the wavelet decomposition of the original signal to the level N;
2) Thresholding of detail coefficients:
a) Choice of thresholding method (hard / soft);
b) For each level from 1 to N, a threshold is selected and soft (and in the case of images, hard) thresholding of the detail coefficients is applied;
3) Reconstruction. An inverse wavelet transform is performed based on the original N level approximating coefficients and the filtered detail level coefficients from 1 to N.
The block diagram of the wavelet filtering algorithm using the coefficient thresholding method is shown in Fig. 1.
<D
О
Sä
Noisy signal S\t) = S(t) + с n(t)
г
Selecting a wavelet function
г
Choice of decomposition level N
1
Signal decomposition to level N
1
Noisy decomposition coefficients
Amk; Dmk
¡Ï 43
3
—
Sä 'G
Й
<D
Inverse wavelet transform
Choice of thresholding method (hard / soft)
Determination of the threshold
Processing detail coefficients
Filtered Decomposition Coefficients
Dmk
-4-
Reconstruction of the signal to level N
Filtered signal S (t)
Fig. 1. Wavelet filtering algorithm by thresholding wavelet coefficients
To assess the efficiency of the algorithm and identify the optimal set of filtering parameters, the output signal-to-noise ratio will be used as a measure. The calculation of the correlation coefficient between the original and cleaned signal will also be carried out. The result of calculations will be displayed in text form for m variants of signal-to-noise mixtures S1', S2',..., Sm'.
For the filtered signal obtained at the output, the signal-to-noise ratio will be determined: Af
SNR = 20log10 —f, (4)
An
where Af is the average amplitude of the filtered signal; An is the average amplitude of the noise present in the signal after filtering.
The noise component of the filtered signal is determined from the following relationship:
n (i) = S (i) - Sf (i), i = 1L, (5)
where n (i) is the sample of the noise component; S (i) - reading of the initial ECS without an additive
component; Sf (i) is the count of the filtered signal; L is the signal length.
Correlation is understood as the relationship of some quantities represented by data - vectors or matrices. The generally accepted measure of linear correlation is the correlation coefficient. Its closeness to unity indicates a high degree of linear dependence. The degree of signal coupling is expressed in normalized units of the correlation coefficient, i.e. in the cosine of the angle between the vectors of the signals, and, accordingly, will take values from 1 (complete coincidence of signals) to -1 (complete opposite).
The calculation of the cross-correlation coefficient between the original S and the cleaned Sf signals of length L will be performed according to the formula:
rs Sf , (6)
I(S -S) I(Sf -Sf )
_ 1 L _ 1 L
where S is the initial ECG signal; Sf - filtered signal; S =—^St,Sf = —^fift - the mean of
L t=i L t=i
the samples for S and Sf , respectively.
Let us determine the optimal level of decomposition N, to which it is advisable to carry out the decomposition in subsequent studies.
We act on the initial ECG signal S with white Gaussian noise no with a given signal-to-noise ratio.
Table 1 shows the results of comparing the decomposition levels N = 2, N = 3, N = 4 for the Simlet 4 wavelet. The type of the threshold function is soft, using an adaptive method for choosing the threshold value.
Table 1
Results of comparing the levels of decomposition N = 2, N = 3, N = 4
Input signal-to-noise ratio, dB N = 2 N = 3 N II 4
Output signal-to-noise ratio, dB
30 35.721 33.819 30.655
35 39.697 34.862 30.878
40 43.270 35.182 30.959
45 45.271 35.336 30.984
Correlation coefficient, %
30 91.3 84.5 63.1
35 96.5 87.9 65.2
40 98.3 88.7 66
45 99 89.1 66.2
Figs. 2-4 show the result of filtering the ECG signal with added noise with a signal-to-noise ratio of 35 dB using the decomposition levels N = 2, N = 3, N = 4.
1.2 1.1 1
0.9
Original signal S(t)
200 400 600 800 1000 1200 1400 1600 1800 2000 Noisy signal s(t)+n(t)
0.8
0.8
- 1 1 1 I i 1 1 1 1 1 I i i i i I I -i i
0 200 400 600 800 1000 1200 1 De-noised signal s1(t) 1400 1600 1800 ; >000
- I | i 1 1 1 1 1 1 i i i i i i i i I - 4 i
1.2 1.1 1
0.9
0 200 400 600 800 1000 1200 1400 1600 1800 2000 Fig. 2. The result of filtering the ECG signal with the addition of 35 dB noise N = 2
Original signal S(t)
200 400 600 800 1000 1200 1400 1600 1800 2000 Noisy signal s(t)+n(t)
0.8
- i I I I i i i 1 1 1 1 1 1 1 -i i
200 400 600 800 1000 1200 1400 1600 1800 2000 De-noised signal s1(t)
0 200 400 600 800 1000 1200 1400 1600 1800 2000 Fig. 3. The result of filtering the ECG signal with the addition of 35 dB noise N = 3
Mн$окоммунмкацмоннblе TexHonomw u OMOTeMbi
1.2 1.1
1
0.9
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Noisy signal s(t)+n(t)
_ 1 1 1 1 1 1 1 i i i i i i i i _ i i
0 200 400 600 800 1000 1200 1400 1600 1800 2000
1.05 1
0.95 0.9
0 200 400 600 800 1000 1200 1400 1600 1800 2000 Fig. 4. The result of filtering the ECG signal with the addition of 35 dB noise N = 4
Figs. 5-7 show the result of filtering an ECG signal with added noise with a signal-to-noise ratio of 45 dB using decomposition levels N = 2, N = 3, N = 4.
1.2 1.1
1
0.9
0 200 400 600 800 1000 1200 1400 1600 1800 2000
1.2 1.1
1
0.9
0 200 400 600 800 1000 1200 1400 1600 1800 2000
1.2
1
0.8
0 200 400 600 800 1000 1200 1400 1600 1800 2000 Fig. 5. The result of filtering the ECG signal with the addition of noise 45 dB N = 2
De-noised signal s1(t)
Original signal S(t)
Noisy signal s(t)+n(t)
i ¡«A»<f\ 1 1 1 1 1 1 -
De-noised signal s1(t)
О 200 400 600 800 1000 1200 1400 1600 1800 2000
Noisy signal s(t)+n(t)
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Fig. 6. The result of filtering the ECG signal with the addition of noise 45 dB N = 3
Original signal S(t)
1.2-1-1-1-1-1-1-1-1-1-г
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Noisy signal s(t)+n(t)
1 1 1 1 1 1 f 1 1 1 1 1 1 1 1 u 1 1 1
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Fig. 7. The result of filtering the ECG signal with the addition of noise 45 dB N = 4
Mн$окоммунмкацмоннblе TexHonomM u cucTeMbi
Conclusion
Based on the analysis of the data obtained, it can be concluded that the second level of decomposition is the most optimal for filtering the ECG signal.
With an increase in the level of decomposition, the output ratio decreases, at the level N = 4 the output signal-to-noise almost does not exceed the input one, therefore, the filtering becomes ineffective.
The correlation coefficient to the fourth level is significantly reduced, which means a significant increase in the distortion introduced by the filtering algorithm.
The analysis of the graphs shown in Figs. 2-7 also confirms the conclusion about the optimality of the level N = 2.
Anastasia Denisovna Chupina, a student of the KE-658 group, took part in the process of experimental research.
References
1. Lokenath D., Jean-Pierre A. Wavelet Transforms and Their Applications, 1998, pp. 685-713.
2. Parul G. Image processing using MATLAB. National Conference on Advance Computing and Communication Technology (NCACCT-2010). ABES Engineering College, Ghaziabad, India, 2010, pp. 1-6.
3. Richard H., Guillaume B., Linda R.P. WAVOS: a MATLAB toolkit for wavelet analysis and visualization of oscillatory systems, 2012, pp. 2-8.
4. Darshana M., Asim B. Discrete wavelet transform using MATLAB. International journal of computer engineering& technology (IJCET), 2013, vol. 4, pp. 252-259.
5. Burhan E. Signal and Image Denoising Using Wavelet Transform. Advances in Wavelet Theory and Their Applications in Engineering, Physics and Technology, 2012, pp. 495-514.
6. Chouakri S.A., Bereksi-Reguig F., Ahmaidi S., Fokapu O. Wavelet denoising of the electrocardiogram signal based on the corrupted noise estimation. Computers in Cardiology, Lyon, 2005, pp.1021-1024.
7. Singh B.N., Tiwari A.K. Optimal Selection of Wavelet Basis Function Applied to ECG Signal Denoising. Digital Signal Processing, 2006, vol. 16 (3), pp. 275-287.
8. Sayadi O., Shamsollahi M.B. ECG denoising and compression using a modified extended Kalman filter structure. IEEE Transactions on Biomedical Engineering, 2008, vol. 55 (9), pp. 22402248.
9. Sameni, R., et al. Filtering noisy ECG signals using the extended Kalman filter based on a modified dynamic ECG model. in Computers in Cardiology, 2005.
10. Chouakri S.A., Bereksi-Reguig F., Ahmaidi S., Fokapu O. Wavelet Denoising of the Electrocardiogram Signal Based on the Corrupted Noise Estimation. Computers in Cardiology, 2005, pp.1021-1024.
11. Ying-Wen B., Wen-Yang C., Chien-Yu C., Yi-Ting Lee, Yi-Ching T., Cheng-Hung T. Adjustable 60Hz noise reduction by a notch filter for ECG signals. Proceedings of the 21st IEEE Instrumentation and Measurement Technology Conference (IEEE Cat. No. 04CH37510), Como, 2004, vol. 3, pp.1706-1711.
12. Sameni R. et al. A nonlinear Bayesian filtering framework for ECG denoising. IEEE Transactions on Biomedical Engineering, 2007, vol. 54, pp. 2172-2185.
13. Alfaouri, M. and K. Daqrouq, ECG signal denoising by wavelet transform thresholding. American Journal of applied sciences, 2008, vol. 5(3), p. 276.
14. Phinyomark A., Limsakul C., Phukpattaranont P. Optimal wavelet functions in wavelet denoising for multifunction myoelectric control. Transactions on Electrical Engineering, Electronics, and Communications. ECTI, 2010, vol. 8, pp. 43-52.
15. Benazza-Benyahia A, Ben Jebara S. Multiresolution based reference estimation for adaptive ECG signals denoising. International Conference on Image and Signal Processing, ICISP'01, Morocco, 2001, vol. 2, pp. 875-882.
Received 10 January 2021
УДК 53.08 DOI: 10.14529/^сг210107
ВЕЙВЛЕТ-ПРЕОБРАЗОВАНИЕ В ОБРАБОТКЕ ЭЛЕКТРОКАРДИОСИГНАЛА
1 1 2 1 1 В.Ф. Тележкин1, Б.Б. Саидов1', П.А. Угаров', А.Н. Рагозин'
1 Южно-Уральский государственный университет, г. Челябинск, Россия,
2 Таджикский технический университет имени академика М. С. Осими, г. Душанбе, Республика Таджикистан
В настоящей работе рассматривается обработка электрокардиосигнала при помощи вейв-лет-преобразования. В электрокардиографии для обнаружения, извлечения и анализа различных компонентов электрокардиограммы применяются различные методы обработки цифровых сигналов. Среди них техника вейвлет-преобразования дает многообещающие результаты в анализе частотно-временных характеристик компонент электрокардиограммы. Актуальность решения проблемы повышения качества жизни людей при помощи раннего диагностирования и своевременного лечения различных кардиологических заболеваний является очевидной. Особенно важным является процесс автоматизированного анализа огромной базы электрокардиографических данных. Вейвлет-анализ может успешно использоваться для сглаживания и удаления шума сигнала ЭКГ. Сигнал электрокардиограммы, очищенный от шумовых компонент, выглядит нагляднее, при этом его объем составляет от 10 до 5 % от исходного сигнала, что в большой степени решает проблему хранения кардиозаписей. Цель исследования: разработка алгоритма пороговой обработки вейвлет-коэффициентов и фильтрации сигнала электрокардиографии. Материалы и методы. Для анализа были взяты кардиограммы. Далее они были оцифрованы и введены в компьютер для обработки. Была написана программа в среде МА^АВ, реализующая непрерывное и дискретное вейвлет-преобразование. Результаты. В работе показан результат фильтрации сигнала ЭКГ с добавлением шума с отношением сигнал/шум 35 и 45 дБ с использованием уровней разложения N = 2, N = 3, N = 4. Заключение. На основе анализа полученных данных можно сделать вывод, что второй уровень разложения наиболее оптимален для фильтрации ЭКГ-сигнала. С увеличением уровня разложения выходное отношение уменьшается, на уровне N = 4 выходное сигнал/шум почти не превышает входное, следовательно, фильтрация становится неэффективной. Коэффициент корреляции к четвертому уровню значительно снижается, что означает значительное повышение искажений, вносимых алгоритмом фильтрации.
Ключевые слова: электрокардиосигнал, вейвлет-преобразование, алгоритм фильтрации, разработка алгоритма.
В процессе экспериментальных исследований принимала участие студентка группы КЭ-658 Чупина Анастасия Денисовна.
Тележкин Владимир Федорович, д-р техн. наук, профессор кафедры инфокоммуникационных технологий, Южно-Уральский государственный университет, г. Челябинск; [email protected].
Саидов Бехруз Бадридинович, аспирант кафедры инфокоммуникационных технологий, ЮжноУральский государственный университет, г. Челябинск; Таджикский технический университет имени академика М.С. Осими, г. Душанбе, Республика Таджикистан; [email protected], [email protected].
Угаров Павел Александрович, канд. техн. наук, доцент кафедры инфокоммуникационных технологий, Южно-Уральский государственный университет, г. Челябинск; [email protected].
Рагозин Андрей Николаевич, канд. техн. наук, доцент кафедры инфокоммуникационных технологий, Южно-Уральский государственный университет, г. Челябинск; [email protected].
Поступила в редакцию 10 января 2021 г.
ОБРАЗЕЦ ЦИТИРОВАНИЯ
Wavelet-Conversion in Electrocardio Signal Processing / V.F. Telezhkin, B.B. Saidov, P.A. Ugarov, A.N. Ra-gozin // Вестник ЮУрГУ. Серия «Компьютерные технологии, управление, радиоэлектроника». - 2021. -Т. 21, № 1. - С. 70-79. DOI: 10.14529/ctcr210107
FOR CITATION
Telezhkin V.F., Saidov B.B., Ugarov P.A., Ragozin A.N. Wavelet-Conversion in Electrocardio Signal Processing. Bulletin of the South Ural State University. Ser. Computer Technologies, Automatic Control, Radio Electronics, 2021, vol. 21, no. 1, pp. 70-79. DOI: 10.14529/ctcr210107