The Use of Digital Signal Processing Algorithms for Electrophysiological Diagnostics of Cardiovascular Diseases

The relevance of the study is determined by the need for automatic pre-diagnosis and introduction of the diagnostic algorithms into the appropriate software. The article presents a method of processing the electrocardiogram (ECG) as well as the results of applying this method to the real ECG taken from public databases. Their Fourier and wavelet spectra are given as proposed for digital signal processing and automated diagnostics, and also a number of methods for their use are described. The problems of software development of mobile medical electrocardiographic system have been considered. It is proposed to diagnose diseases of the cardiovascular system by comparison a normalized ECG signal with the interpolation model . The outcomes of the research are of practical value for the needs of medicine, in particular for cardiology.


INTRODUCTION
The most important problems of medicine is early diagnosis, prevention and treatment of cardiovascular diseases (CVD), which is impossible without the development and study of algorithms and techniques for processing electric cardiologic signal (ECS).There is a variety of devices and remote monitoring systems, which represent different ways of monitoring of physiological parameters for various human diseases by passing information from the patient to the doctor.The use of innovative advances in electronic information technologies for quick diagnostics and predicting the state of health, creation of new social medical services available to wide circles of the population, will improve the quality of life of people having the risk of a sudden death, because cardiovascular diseases are the leading cause of mortality of the population.
The majority of clinical studies of the cardiovascular system are based on an analysis of Electrocardiograms (EKG) and a number of other recorded signals, illustrating the bioelectric activity of the heart.Among the obvious advantages of such an approach is its relative simplicity, accessibility, non-invasiveness and highly informative content.
So it is quite obvious, that research and development of new methods of handling the ECS is an actual scientific challenge.
The task of automatic diagnosis of cardiovascular system can be divided into several stages.The first step is the signal processing, removing the noise and disturbances.For this step there is a variety of methods and software tools.The studies [1][2] are devoted to the problem of removal of drift contours, which is low-frequency disturbance of the ECG signal, presumably connected with breathing. 1gives an overview of such techniques as: the use of digital filters, signal averaging, polynomial and wavelet approximation.Z.K. Adeyemo and S.A Olayanju 3 discuss the empirical mode decomposition method, which allows working with flow of ECG information in real time.In this work the authors offer to solve the problem of removal of drift contours by spectral methods using the discrete Fourier transform.
In some cases it is necessary to "clean up" the signal from the noise and RF interference as well as from such interference, when the spectrum of frequency range coincides with the range of a useful signal.Scientific studies [4][5] are dedicated to ECG signal processing problems with low value of signal-to-noise ratio.The authors suggest using wavelet transform for smoothing.Parsad Kanta Sharma and Manpreet Kaur 6 compare ECG filtering methods by wavelets, fast Fourier transform and Kalman filter.The next step in the analysis of ECG can be called getting the values of informative parameters that can be used to diagnose the state of the cardiovascular system.These are the parameters of heart rate variability such as mean RR interval, its standard deviation, the shape of the main waves and etc.So it is necessary to solve such an important task as detection of the QRS complex in the ECG.The work 7 is dedicated to the review of such methods.Many authors offer their original methods of detecting QRS complex.Thus, there are descriptions of a method based on the theory of optimal estimates, 8 and of the correlationextreme method with the evaluation of its deviation. 9ere are also well-known methods of QRS-complex.A brief description of the most common methods such as methods of Pan and Tompkins 10 and adaptive algorithm. 11In the present paper it is proposed to use the equivalent of the adaptive algorithm described below.
And finally, the third step is the diagnosis of cardiovascular system in the form of a recognized and processed ECG.For this purpose it is suggested to use the Mathematic model of the ECG of a healthy person, as well as of a person with various pathologies.For the development of the model different approaches can be implemented.There are a number of developments in this area.Models based on Gaussian functions are described in [12][13] , and a model of the ECG as the result of the rotation of a unit vector in three-dimensional space is provided in 14 .Different waves may arise due to the presence of the corresponding attractors in phase space.A model is also described 15 in which various segments of the ECG correspond to Markov chain states and the values of the parameters of this model are provided for a normal ECG and certain pathologies.
To compare ECG with models the authors use wavelet transform.The results of applying transformations with different wavelet functions to the ECS are present in 16 .Examples of using wavelets for analysis of ECG with the help of Matlab program are given in [17][18] .

Concept headings
Scientific purpose of this work is to study, develop and implement in software the algorithms for detecting cardiovascular pathologies associated with various cardiac arrhythmias based on the use of advanced digital signal processing algorithms and pattern recognition.A separate area of research is the study of heart rate variability, the development of its mathematical model to predict the emergence and development of pathologies.
While developing new methods for automated ECG analysis and mathematical model of the cardiovascular system pathologies and heart rhythm disturbances the following methods were applied: the spectral analysis of the simulated signal; simulated signal approximation with the sum of Gaussian functions whose parameters were computed by various methods, including the leastsquare procedure, and while modelling signal distortion, noise and certain pathologies simulation methods were used, such as the generation of random numbers and events.To model, obtain numerical results and plot graphs the following tools were used: Matlab mathematical modelling environment, MathCad mathematical calculation package.

Model of the Electrocardiogram of a Healthy Person and a Person with a Number of Pathologies of the Cardiovascular System
Modeling of electrocardiograms is an actual scientific and practical task.The human body is an extremely complex system from the point of view of the description of the processes occurring in it at the level of the physical laws in analytical form.Therefore, the modeling of electric potentials, changing as a result of the heart, will be empirical, based on experimental results.The averaging of all the vectors of action potentials that occur at a certain moment in the heart is reflected in the ECG.Usually the ECG can be divided into five waves: P, Q, R, S, T (figure 1).Electrocardiograms represent quasi-periodic functions of a certain shape, and our task is to define the parameters and the form of this function, as well as to simulate a realistic artificial ECG shape with characteristics given.
A more detailed description of the model is given in 19 .Let us choose the basic model, similar to 12 .It is formed by the standard z (t), which describes the sum of symmetric Gaussian functions, unlike the one 12 which uses asymmetric Gaussian function.
In our case, R-wave is represented as a sum of two Gaussian functions to simulate the processes in the right and left Atria separately.Twave inversion asymmetry will be modelled by summing up two summands (T1 and T2) of the equation (1). Figure 1 shows the location of the main waves of the ECG.
Numerical values of the parameters of the function z(t) will determine the form of the electrocardiogram.We define them for ECG of healthy people and people with abnormalities of the cardiovascular system.
Figure 1 shows the form of a single ECG normal sinus rhythm.Its appearance was reproduced according to the open database 20 for the ECG of a healthy person in the first lead (ECG1) snapshot.
Figure 2 shows the shape of the heart rate for the normal sinus rhythm (curve a) in blue color, and extrasystole heart rate (curves b, c, d) in red color.The models were made according the examples of real ECG given in 21 .
According to these basic cycles, an ECG model (artificial ECG) with specified characteristics: frequency of cardiac contractions (heart rate), average height of RS-waves can be modeled.An example of the ECG for the case of ventricular extra systole is shown in Figure 3.The model accounts for changes in the duration of RR-interval.They are considered to be normally distributed.Their mathematical expectation corresponds to HR = 60 1/min.(the average period of RR = 1000 msec.), the standard RMS deviation = 20 msec.Sampling frequency 500 Hz.Noise, distributed by the normal law with parameters (1= 0 MV, 2 = 0.02MV), is superimposed at the simulated signal.
In addition, drift isoline is simulated.The contour is considered to be varying as sinus with a frequency of 15 1/min (respiratory rate) and amplitude of 0.12 mV.The simulation object is the electrocardiogram, which represents an implementation of a quasi-periodic random process.Therefore, when developing a model we use statistical methods of experimental data processing.The result of the simulation is a function of some characteristic species, so for its generation in each period interpolation methods are used."Period" is understood as a cardiac contraction cycle, which, generally speaking, is also a random variable.The value of the period is generated at each step with the help of a random number generator that allows us to talk about the use of simulation methods.This method allows you to simulate ECG abnormalities, In addition, the model takes into account all the electric noises, which are superimposed on the main signal and are generated by pseudorandom number generator, as well as drift contour, which is represented in the form of a sine wave with a frequency close to the frequency of breathing, similar to 14 .

ECG Signal Processing Methods
In order to produce a quantitative comparison, experimental ECG must be processed and quantitative characteristics should be obtained.They will enable you to check the adequacy of the model, as well as to make the preliminary diagnosis of the patient, whether he has or not any pathology according to his ECG.
Typically, diagnosis based on the electrocardiogram is performed by a physician who examines the image printed on graph paper.For an automatic diagnosis ECG should de digitized (if it is not yet in a digital form) and quantitative characteristics should be obtained.They will enable you to draw conclusions about the state of the cardiovascular system of the patient or to compare investigated ECG options with the model.the cardiovascular system.To analyze the shape of the heart rate it is necessary to allocate a separate rate out of the range.To obtain the main characteristics of heart rate variability we use spectral methods.

Let's consider the methods of the ECG quantitative characteristics to evaluate the state of
Suppose we have a digitized (or obtained with the help of a digital device) ECG signal.Let us denote its values Fn, tn -moments of time corresponding to these values, where n = 0,1...N-1, N -sample size data.Sampling frequency is We calculate complex signal spectrum on the formula of the discrete Fourier transform.For the function f (t), analytically specified in the interval [0, T], the spectrum is calculated by the formula: Figure 4 shows the amplitude spectrum of the electrocardiogram based on the record data No. 16773. 20Frequency (Hz) is indicated horizontally, and the amplitude, corresponding to the harmonics (mV) is indicated vertically.The solid line (with circles) is the spectrum of the one cycle model of the normal heart calculated by the formula (3).The dotted line (with crosses) is the one cycle spectrum ECG record; the potty-dotted line is the entire spectrum record.It is evident that all the spectra have a maximum at zero.This means that ECG has a constant component.The first peak of the spectrum of the entire record that coincides with the first point of a cycle corresponds to the heart rate.
The normalized autocorrelation function is calculated by the formula The maximum of spectral density function Scorr(f1) corresponds to the frequency of heart rate (HR )which is one of the main characteristics of the ECG.According to the HR value such diseases as tachycardia and bradycardia are diagnosed.The HR value can also determine the averaged amount of the RR -period.
The RR interval corresponding to the distance between peaks of neighboring waves R, is equal to duration of one cardiac cycle and is perhaps the most important characteristic of a normal ECG.By interpreting the sequence of duration of these intervals we can tell if there is some cardiovascular disease.This approach is called the cardiac rhythm variability analysis (CRV).The heart rate is usually measured in 1/min: heart rate [1/min)] = 60*heart rate [Hz] = 60 000/RR [msec].The next step is to eliminate the zero offset potential, the so-called "drift contour".This will exclude from the ECG spectrum all the lower harmonics to N1 corresponding to f1 (and the corresponding mirror closest to N), and we can reconstruct the signal.
First we normalize signal vertically, adding the average value of the normal ECG cycle, which was deducted when filtering the lower frequencies.
Next, the normalized signal is divided by the periods and is transformed by the time relative to the duration of the excitation Tsinaps.Thus we get a family of curves, each of which corresponds to the period of cardiac contraction.To synchronize them by time we must calculate the time shift of the beginning of each excitation regarding the notional start of the corresponding period of the ECG Tsdvigm, where m=1... Nperiod, Nperiod -number of periods in the electrocardiogram.The index of the maximum value in each period will be denoted by Nmax.

Use of Wavelet Spectra for Electrophysiological Diagnostics
Let's consider the ECG spectrum, calculated on the basis of wavelet transform.As a forming wavelet function we take the WAVEwavelet. 22In this case: The wavelet spectrum is calculated by the formula: (10)   Let us compute the wavelet spectrum of the normalized function z(t).As it is defined in the interval [0, 1], infinite limits in integral ( 9) can be replaced by the limits 0 and 1.For this we use the program MathCad.We build this two-parameter spectrum as a graph surface in accordance with (Figure 6).On axes x and y we show the values of the parameters a and b, respectively, multiplied by 100.
Calculating the discrete spectrum it is necessary to choose the right way of the range of integer values that characterize a and b.This spectrum is highly informative because the model represents a sum of functions similar to forming wavelet functions.
We use Wavelet transform to compare shapes of cycles of the ECG models.Let's consider the case shown in Figure 2. It is the ECG for a normal sinus rhythm and for three types of extrasystole.Since the main difference is in the form of P wave, that is, at the beginning of the graph, we use the plane b=0 of the wavelet spectrum (Figure 6).Compare the wavelet spectra of the individual cycles of the ECG with spectra models.Graphs of the corresponding spectra depending on the parameter a are shown in Figure 7.
The graph shows that the dotted lines are closer to a bold green line which is a range of models with normal ECG.So we can conclude that the studied ECG belongs to a healthy person.This conclusion is confirmed by calculating the sum of squares of deviations of functions of normalized spectra of the signal and models.

DISCUSSION
A mathematical model of the electrocardiogram has been developed, which is based on signal representation as a sum of symmetric Gaussian functions.A similar idea is used in 12 ; however, in the present work the authors used asymmetric Gaussian functions, while in the developed model the asymmetry of the wave is modeled with the sum of two symmetric functions of waves R and T, which makes the wavelet analysis of a signal easier and allows to simulate different types of atrial arrhythmia.A similar model is demonstrated in 22 where there is a sum of symmetric Gaussian functions, however, t-and r-COGS are presented as a single term that does not enable to show their asymmetry.The model presented in 14 considers the ECG as the projection of the motion of the unit vector in three-dimensional space, where quasiperiodicity is created by rotation in the plane (x, y), and the presence of waves is determined by attractors in phase space.However, to produce artificial ECG with the help of this model we have to solve a system of differential equations, which significantly complicates the algorithm.In addition, simulation of arrhythmia and extrasystole in this case is very problematic.Therefore, the model presented by the authors, is optimal for solving the problems of the individual electrophysiological diagnostics.

1.
Methods of analysis and processing of Electrocardiograms have been considered.The interpolation ECG model of a healthy person and the ECG model with arrhythmia of different types were obtained 2.
Fourier and wavelet spectra of real ECG and its model have been built.The article gives also the description of the method for the real ECG normalization.

3.
These studies are of a general nature, and its results will be used in the creation of an information system for individual electrophysiological diagnosis of cardiovascular diseases based on the use of modern algorithms of digital signal processing and pattern recognition of automatic analysis of ECG and preliminary diagnosis.Application of pattern recognition algorithms is not a traditional task for automatic analysis of electrocardiograms which allows anticipating receiving qualitative and innovative results in the field.

Fig. 1 :Fig. 2 :
Fig. 1: ECG model cycle of a healthy person, normalized in time to the duration of excitation and vertical axis to maximize the spread of values

Fig. 6 :Fig. 7 :
Fig. 6: Wavelet spectrum of Electrocardiograms (WAVE-Wavelet) is the average value of the sample data.The spectral density is calculated by the autocorrelation function as its Fourier image (2).
Tsdvig parameter values characterize different duration periods.If these values are heavily scattered, we may speak about arrhythmia.If the value of the parameter Tsdvig of some period is small, compared to the average value of this parameter, it is possible that this reduction is extrasystoles.The results of these operations are shown in Figure5.The solid line shows a graph model of a normal ECG cycle, and the dashed line shows the individual normalized cycles of real electrocardiogram, taken from the Archive of digital recordings of physiologic signals and related data 20 (record No. 16272).