Systematic Approach to Processing and Analysis

Introduction. Cardiovascular disease occupies an important place throughout the world, which necessitates the development of more effective modern means of diagnosis and treatment. The primary diagnosis of heart disease is based on analysis and processing of an electrocardiogram (ECG). Despite the fact that there are many methods and algorithms for ECG analysis and processing, one of the urgent problems of cardiology remains to obtain the most complete information about heart electric potential, respectively, the behavior of the waves P, Q, R, S and T. Aim. Development of algorithms and software for processing and analysis of electrocardiograms (ECGs), as well as calculation of heart rate and detection of arrhythmias based on Labview. Materials and methods. The methods for removing noise using the wavelet transform method to eliminate base-line deviation, to extract ECG signs, to calculate heart rate and to detect arrhythmias based on Labview have been adopted as a mathematical apparatus for processing and analyzing ECGs. Results. Organizing of the ECG database, developing algorithms for converting the ECG file of the database into a useful format for Labview, processing of the ECG signal with removing noise from the original ECG signal, extracting signs for obtaining ECG diagnostic indicators, calculating heart rate and detecting arrhythmias. Conclusion. An analysis of the results demonstrates that systematic approaches to evaluating ECG signals allow to avoid one-way decisions and to integrate different methods into an integrated system of ideas of the state. The implementation of the proposed algorithms using Labview programming system ensures the removal of noise and artifacts, the extraction of the necessary ECG signs, the calculation of heart contractions and the detection of arrhythmias.

Introduction. Cardiovascular disease is the main killer that causes mortality worldwide [1,2]. Significant efforts have been directed towards the introduction of various technologies for the diagnosis of heart disease, allowing doctors to recognize earlier symptoms of heart problems for further medical care. For this, an important place is occupied by research on the development of methods and algorithms for the analysis and processing of biological signals. In accordance with the studied object of the human body, one or another method or algorithm for analyzing biosignals can be chosen.
Biological signals carry information about the physical manifestations of the physiological processes of a living organism, which can be measured and presented in a form convenient for processing using computer technology [1]. As an example, we can determine the process of the heart and as a result of which electrical potentials appear on the surface of the body. This process of the heart is determined by a biological signal called an electrocardiogram (ECG).
ECG system provides signals containing useful information to doctors. Several cardiac arrhythmias can be easily identified when anomalies in ECG signals are observed. As a rule, normal healthy ECG signals have waves P, Q, R, S and T with a standard value measurement, and they may differ in terms of capabilities or morphological signs of abnormal ECG signals [3]. To improve the quality of diagnosis of heart disease at an early stage, it is necessary, in particular, to increase the accuracy of ECG signal measurement and its diagnostic parameters.
The parameters of a biological signal that change in time in accordance with changes in physiological processes in the human body are informative. In other words, these parameters carry data on the change in the state of the investigated object (patient) or process. For biomedical signals, the informative parameters may be amplitude or power, frequency (period), phase (time shift). Processing of biomedical signals is carried out in order to isolate informative signs in them or to determine diagnostic indicators [2].
The classical approach to the analysis of heart rate variability (HRV) includes statistical, correlation and spectral processing methods, the basics of which were given in the works of foreign and domestic authors [3,4]. The traditional methods for the analysis of biomedical signals listed above are based on the assumption that the signal remains stationary within the analyzed fragment. In practice, especially during the study of functional indicators, the implementation of this rule does not give the correct results. Therefore, in the analysis of biomedical signals, the application of mathematical processing methods that do not have any specific requirements for the characteristics of these signals is relevant.
The process of heart rhythm formation is determined by the interaction of the circulatory system with numerous regulatory mechanisms, depending on the state of the autonomic and central nervous systems, hormonal, humoral and reflex processes. Moreover, in this multi-level, hierarchical system, the current state of the organism plays a decisive role. This system is complex: the most obvious feature of it, like any biological object, is the ability to self-organize and manifest dynamic properties. Based on the results obtained in [5], we can say that the properties of the studied object can be restored by measuring only one observed signal.
Biological signals reflecting changes in functional processes in the human body, in the cardiovascular system are continuous. To analyze the nonlinear properties of HRV, the Poincare section, cluster spectral analysis, attractor graphs, singular decomposition, Lyapunov exponent, Kolmogorov entropy and others are used [3]. However, for short-term time series of HRV, obtaining statistically stable estimates of fractal dimensions, Lyapunov exponents, and entropy encounters certain problems caused by the insufficient length of the series and the noise level of the HRV signal [6]. Some authors have come to the conclusion that the information encoded in the variability (R-R) of the intervals cannot be fully estimated using only one technique for the analysis of HRV. The presence of specific fluctuations (R-R) intervals determines the need to use different mathematical approaches to its estimation [3,6]. Currently, different approaches are not considered as separate phenomena that did not have a common theoretical base.
Methods. Systematic approaches to the estimation of HRV signals make it possible to avoid onesided decisions and combine different methods into an integrated system of ideas about the HRV signal as a process containing a huge amount of heterogeneous information about the nature of such a complex biological object as a living organism [7].
The first step in the study of the object is to obtain the correct or accurate information about changes in the physiological process of the patient in the form of electrical signals that can be measured.
The next step is filtering and eliminating signal distortions (artifacts). For example, artifacts of the ECG signal can be caused by mechanical movements of the body, network noise, and electromagnetic field pickups.
The third step is the detection of events in biomedical signals and an analysis of their informational characteristics, modeling of processes and systems generating biomedical signals [8].
In general, the processing of biological signals can be implied by a complex of algorithmic, hardware and software. As a rule, this complex may contain specialized software for preliminary (or primary) signal processing and special software for secondary signal processing.
Pre-processing tools are designed to process the initial biosignals, observed in the general case against random noise and interference of various physical nature and presented in the form of discrete digital samples, in order to detect and isolate a useful signal and evaluate the characteristics of the detected signal. The useful information obtained as a result of preliminary processing enters the secondary processing system for classification, archiving, system analysis, etc.

Systematic Approach to Processing and Analysis Diagnostic Indicators of Electrocardiograms Based on Labview
Purpose of work is the development of algorithms and software for processing and analysis of ECG, as well as calculating heart rate and detecting arrhythmias based on Labview.
To achieve this goal, we need an ECG database. The database obtained from a medical institution consists of ECG signals received in .dat and .atr files. Its direct use for processing in the Labview system is impossible. By converting database files, new files are created that can be read in Labview. Files created for Labview consist of comma-separated values of the .txt data type. For Labview, two files are created: one with an ECG signal and one with a time signal. The time signal is multiplied by 1000 before it is saved in the .txt file and divided by 1000 in Labview after the file is opened. This is to avoid rounding errors that occur when opening files with floating point numbers. Since the entire ECG signal consists of large numbers without floating points, this is not required when saving the ECG signal for Labview [9].
In general, a recorded ECG signal is often contaminated with noise and artifacts. These impurities may be in the frequency band of interest and manifest with characteristics similar to the ECG signal itself. Thus, in order to extract useful information from noisy ECG signals, we need to first process the raw ECG signals. The algorithm begins with plotting the original, noisy ECG signal (Fig. 1). This graph shows which noises are present in the raw ECG signal.
Then, the stage of preliminary processing of the ECG signal, i. e. will be detected removes or suppresses noise from the raw ECG signal. Among these noises, noise in the power line and deviation from the baseline are the most significant and can greatly affect the analysis of the ECG signal. Other noises that cannot be neglected are broadband and usually represent a complex random process.
The interference in the power line is narrow-band noise centered at 60 Hz (or 50 Hz) with a bandwidth of less than 1 Hz. This comes from the use of electricity at a specific frequency. Typically, equipment for receiving an ECG signal can eliminate power line noise. If there is interference from the power line in the raw ECG signal, this can be eliminated with a digital filter. Uzbekistan uses 50 Hz alternating current electricity. To ensure that the correct frequency is removed from the ECG signal, the frequency domain must be plotted in Labview. As a result, we get a random signal from the database, selected for use as an example.
There is interference on the power line for the selected specific signal from the 60 Hz database. Therefore, we must use a filter to eliminate power line interference at a frequency of 60 Hz for each signal. In Labview, the classic Express filter design creates a Butterworth bandpass filter as input to the DFD Filtering VI. As a result, in Fig. 2 we get an enlarged version of the plots made in Labview at 60 Hz.
Wandering around the baseline is another type of significant noise that needs to be addressed. The main causes of the basic walk are breathing, a change in the resistance of the electrode due to sweating and increased body movements. Thus, the elimination of basic wandering can significantly improve the accuracy of clinical information [10].
There are two removal methods available to eliminate this type of noise. First of all, we can design a high-pass digital filter [11] to eliminate the basic deviations. A Butterworth high-pass filter is a good choice. Fig. 3 shows the result of this filter for an ECG signal. In Labview, this filter is created in the VI Express Classical Filter Design Express and used as input for the VI Filtering DFD.
Secondly, you can use the wavelet transform to eliminate the deviation of the baseline, to eliminate  Fig. 4. Moreover, the wavelet transform method gives a better result than the digital filter method [12].
After eliminating the deviation of the baseline (removing the baseline wander), the resulting ECG signal is more stationary and explicit than the original signal. However, as before, some other types of noise can still affect the extraction of ECG signal signs. Noise can be complex stochastic processes within a broadband connection, so it cannot be eliminated with traditional digital filters. Therefore, a high-pass filter is proposed in Express-Classical Filter Design Express to remove the base walk (Fig. 5).
Moreover, using the wavelet transform approach. Wavelet Denoise Express VI, which performs this task, will achieve the removal of broadband noise (Fig. 6).
After pre-processing the raw ECG signal, we get a useful ECG signal. You can now proceed to the feature extraction step. This extracts diagnostic information from the ECG signal. The most important feature of the ECG signal is the R-peak. Detection of R-peaks and, therefore, QRS (is a ventricular complex consisting of Q, R and S waves) complexes in the ECG signal can provide a lot of information about heart rate, conduction speed, the state of tissues in the heart, and also about various disorders [13,14]. He provides evidence for diagnosing heart disease. For this reason, he has attracted considerable attention in the field of ECG signal processing. However, the presence of noise and timevarying morphology makes it difficult to detect the QRS complex.
Labview has its own building block for detecting peaks/valleys in signals. To determine the correct  peaks and valleys, the user must change two variables that differ from signal to signal. These variables are peak/valley width and peak/valley threshold. This determines the width in the number of samples of peaks or valleys and the threshold that WA Multiscale Peak Detection VI uses to deflect peaks or valleys of a certain size. A true boolean value indicates whether it should remove the trend from the signal. Fig. 7 shows the result of peak/trough detection on the filtered ECG signal, which shows the detection of R peaks.
After extracting the functions by detecting the QRS complex, we can analyze the functions by other methods. For example, we can perform an analysis of HRV for an ECG signal of the R-R interval to demonstrate the condition of the heart and nervous system. Heart rate variability is especially clearly visible on the tachogram. The tachogram shows the differences between the two subsequent peaks of R (Fig. 8). After detecting the QRS complex, you can begin the analysis of the ECG signal. This consists of calculating heart rate and detecting abnormalities. The heart rate is calculated by determining the number of peaks R and dividing it by the recorded time [15][16][17].
Results. The paper proposes algorithms for processing and analysis of ECG signals using the Labview programming system. ECG processing algorithms consists of: converting the database into an ECG into a useful ECG model; pre-processing consisting in eliminating interference in the power line and deviating the baseline using wavelet transform; detecting a complex of QRS and R peaks to determine heart rate variability and tachograms. ECG analysis algorithms consist of: calculating cardiac contractions and detecting arrhythmias.
Conclusion Signal processing begins by filtering the noisy ECG signal. In Labview, the Butterworth filter filters out power line noise. Figure 2 shows the result of this simple filter. Because it's convenient to create filters in the VI Classical Filter Design in Labview. Labview, uses predefined building blocks, which allows the user to very easily perform operations with signals. But this gives the user less freedom, and also makes the program very simple. For example, the graphs in Labview are very simple; it is convenient to create filters in the VI Classical Filter Design in Labview thanks to specialized blocks. This is followed by a basic removal of walks. This is done by two methods: a high-pass filter or a wavelet transform. The results show that, according to this method, the resulting ECG signals contain little basic information about the walk, but retain the main characteristics of the original ECG signal. Moreover, the method based on the wavelet transform is better, because this approach does not introduce delay and less distortion than the method based on the digital filter. The digital filter significantly changes the waveform of P, Q, S and T. This distortion occurs in Labview, as can be seen in Fig. 4. The magnitude and phase response of the high-pass filter and the amplitude response in Labview can be seen in Fig. 5. Due to the VI Classical Filter Design in Labview, filter design was easier and more convenient in Labview.
An ECG signal analysis was performed on the processed signal, i. e. QRS complex detection. and R. peaks. Heart rate variability can be extracted from this and can be plotted in a tachogram. The calculation of heart rate and detection of arrhythmias was made. The average heart rate is displayed in the panel command window in Labview.
As a result, we can say that Labview is the best programming system for performing filtering and preprocessing, as well as for calculating heartbeats and detecting arrhythmias.