METHODS AND APPROACHES FOR AUTOMATIC PROCESSING AND STORAGE OF HIGH-POTENTIAL ELECTROCARDIOGRAM REGISTERED BY HARDWARE AND SOFTWARE COMPLEX ON NANOSENSORS

The problems of designing the system for automatic analysis of cardiograms are considered. The structure of the system for recording and storing electrocardiograms was formed. The procedures that make up the complex of automatic analysis are listed.


Introduction
Despite the advances in the field of cardiology, a number of research studies are currently being pursued [1].A large number of studies are devoted to the investigation and development of means to monitor cardiac functioning without surgical interference.For many years, scientists of Tomsk Polytechnic University together with colleagues from Tomsk Scientific Research Institute of Cardiology have been studying bioelectrical activity of the heart in an extended frequency range of 0-10,000 Hz [2,3].A hardware and software complex based on nanosensors capable of recording signals from 0.3 μV with a sampling frequency of 32 kHz and 64 kHz was developed.ECG is currently being studied and analyzed [4,5].The preclinical studies carried out in healthy volunteers showed the possibility of recording the cardiac micropotentials from 0.3 μV with duration from 0.3 ms and the relationship between the micropotential parameters and the human heart state [6].Unlike conventional electrocardiography in a narrow frequency range of 0.05-150 Hz [7], recording of a high-precision ECG requires a large amount of memory, especially in case of regular heart monitoring at home.For this reason, it is necessary to develop new approaches to record and store the obtained data.
The tasks can be divided into several groups: 1. Analysis and classification of the ECG form.2. Analysis of the cardiac pulse elements.
The paper aims to formulate the requirements for the system for automatic analysis of ECGs, to consider some aspects of the cardiac signal recording and to focus on the individual cardiac signal properties in order to identify the system of requirements imposed on the processing and storage system.
A multi-channel system with a high polling frequency and a long-term periodic monitoring of the patient's heart requires the storage of a large amount of data.Modern electronics enables the storage of large data volumes in miniature units.To store very large data volumes, the system provides two separate units, a miniature recorder and a data collection and storage unit (DCSU).Today, the DCSU can be implemented on smartphones or special units of a similar size [8].The patients' ECGs are gradually copied and stored in a single database, for example, in the clinic (see Figure 1).
During periodic monitoring of the heart, it is important to know what the patient is doing at the moment when the problem arises and prior to that [9].To record the patient's behavior, the system can be supplemented with portable means to record video and audio signals.That is, a short video fragment showing the external environment can be shot -the room and those present in the room.The image may be of low resolution and should remind the patient of what was happening at a certain moment of time.
During ECG recording, video recorders of the cardiac signal transmit the data to the DCSU and indicate the time of recording.This allows synchronization of the ECG and the external environment.The accumulation of a large amount of data requires the development of a robotic system for automatic processing of the ECG signal.This system should automatically process the data and provide signals indicating abnormalities.

Problems of the complex for ECG recording and automatic processing
The recorded cardiac signals can be divided into two groups -short and multiply repeated signals with a certain cycle during dynamic monitoring of the heart.Short ECGs are similar to conventional ones, and they are recorded when a patient is at rest and after physical activity.The recording is performed within several minutes.The recording environment (at rest, load type) is registered in the log.The examination of a large number of patients requires storage of large data volumes.Therefore, the system should be able to maximally compress the data.
This can be achieved by combining several methods: 1. Removal of old data.Since the system is capable of automatic detection of abnormalities or changes in the ECG form, these can be early revealed through monitoring of a healthy person's condition.However, the storage of all data on the normal condition of a patient is meaningless.It is enough to store the data on the current normal state of the heart.Therefore, the ECG itself can be removed or a sample fragment of the normal ECG can be stored.This enables the analysis of the ECG dynamics with regard to the patient's age.
2. Identification of typical areas: a.Typical cardiac pulses are pulses that are similar to each other and an overwhelming majority of them can be observed on the ECG.
b.Not typical cardiac pulses are pulses which form differs from that of typical ones.They constitute a small percentage of the total signal duration.These cardiac pulses should be divided into several groups in case they significantly differ from each other.
If the signal is partially removed, the corresponding video fragments are also deleted.The video data compression is possible by substituting this data for the data about the patient's condition -rest, load type, and the type of activity the patient is involved at the moment.However, processing should be done manually.
In addition to compressing the stored data, the system should automatically recognize pathologies in typical cardiac pulses and in pulses that are different from typical ones.If there are abnormalities in the ECG or it significantly differs from the previous ECGs of the patient, the system should issue a warning.The doctor analyzes the ECG in an automated mode, prescribes other types of analyses, etc.
The analysis, which can be performed using both short ECG recordings and those repeated with a certain cycle, has its own characteristics.Therefore, it is necessary to create a list of requirements for the system for automatic processing of short recordings separately from the requirements for processing of repeated recordings.

Requirements for the unit for automatic analysis of ECGs
The feature of the unit for processing short recordings of cardiac signals is that the obtained recording can be fully loaded into the computer's RAM.In this case, all the analysis tasks that are part of the program can be solved using this recording.The main stages of processing short recordings, the units to implement these stages and the corresponding requirements can be as follows.
Setting the parameters for short signal processing.The parameters of the subsequent automatic processing stages are set at this stage that is performed manually.The processing system is supposed to be automatic.However, the parameters of each of the processing stages should remain unchanged.This increases the processing system flexibility.
Short signal loading.At this stage, files are loaded in the internal format of the device.The high-frequency signal recording requires a high-speed apparatus and simple preprocessing methods.Therefore, the signal in the recording device is typically stored in an analog-to-digital converter (ADC) data format.This allows making the device tiny and reliable and provides a high speed of signal recording.
When setting a short signal loading stage, you need to specify which single file you want to load, or to create a list of files to be processed.
Removal of final samples.At this stage, the initial and final samples of the cardiac signal are removed.The ECG recording is complicated.Therefore, the initial and final cardiac pulses can be significantly distorted.For example, the patient has not come to a calm state yet, or, on the contrary, he began to show activity at the end of recording.
When setting this stage, the duration of the initial and final sections to be removed is specified.
Short signal conversion.The loaded signal has an integer format, and the range of values equals to the ADC range.To analyze and process the ECG, the values should be in the range of ± 300 mV and in a real format.Therefore, the signal is converted from an integer format into a real one and scaled.This stage does not require any settings.The ECG recording unit will be modified with time.ECG recording will be performed at different frequencies.The conversion unit should receive the data for correct conversion into the real format.
Processing of short duration ECG recordings.It is the main unit of the system that involves a set of independent and interrelated procedures for processing the initial ECG or the recording that has been processed using other procedures.The set of procedures should include: • procedures for plotting and calculating characteristics of the heart rate; detection of the cardiac rhythm disturbances; • procedures for automatic filtration of different types; • procedures for approximation of a noisy cardiac signal; • procedures for separation of the ECG recording into individual cardiac pulses; • procedures for extraction of groups of similar cardiac pulses -typical and not typical of this ECG; classification of cardiac pulses; • procedures for analysis of the cardiac pulse forms; identification of critical abnormalities; • procedures for formation of the charts and reports on the processing results, the lists of normal ECGs, with obvious or suspected pathology.
During the system development, the list of procedures will be supplemented with other types of processing.The increased capabilities of this unit and the improved quality of signal processing will enable automatic operation.The doctor will only examine ECGs with obvious or suspected pathology.
The unit setting involves the creation of a list of procedures that must be performed while processing the list of files with ECGs.It is also necessary to determine the types of graphs and the composition of reports for each of the procedures.
In case of repeated studies, for example, at home, processing will be carried out according to the procedure for short ECGs, the data that allows evaluation of the patient's heart state over time will be stored in the memory unit.The program that implements Simson's method has been developed [10,11].The program is designed to process highresolution ECGs [12][13][14].This software includes the automation elements and allows detection of ventricular late potentials in both the averaged signal and single cardiac pulses.
A procedure chart of the program is shown in Figure 2. Some units of the program algorithm (Figure 2) include the following automatically performed actions: In unit 2, after the signal is loaded, the duration of the cardiocycle is determined.The process of calculating the duration of a cardiac cycle is realized by correlation: the two most correlated adjacent cardiocycles are selected from a larger number of similar ones in the entire ECG record and the distance between the peak R is measured.The obtained time characteristic is used in calculating the search step and the search area of the peak R for detecting all cardiocycles in the signal.
In unit 3, the user selects the type of research.Depending on the choice, the program performs the following: for the study of a single cardiocycle appears interface in the form of a vertical line on the graph and the slider with which it moves; to study the averaged signal, the program starts the algorithm for checking the averaging capability.In unit 5, the signal is averaged.Prior to averaging, the direction and center point of the QRS complex are automatically determined.This procedure is carried out with the help of filtering, which removes excess extremes, and the derivative of the first order.The result of the algorithm for determining the center of the QRS complex can be seen in Figure 3.The summation of the cardiocycles is superimposed on each other depending on the central points of the QRS complex and using the time interval defined in unit 2. In unit 6, bi-directional bandpass filtering and summing of the signal from the three leads are performed to obtain the resulting Simson's curve using the formula: The actions related to the automatic adjustment of settings or points on the graphs are supported by the possibility of manual adjustment to improve the accuracy of results.Addition of the automation elements to the program allows significant acceleration of the work associated with processing of high-resolution ECG signals.

Fig. 1 .
Fig. 1.Structural scheme of the complex for ECG recording and automatic.
filtration is carried out in two stages: in the first filtration is performed from the beginning of the cardiac cycle to the central point of the QRS complex, in the second from the end of the cardiocycle to the central point of the QRS complex.On the resulting curve, the algorithm automatically calculates the reference points for the diagnosis of the patient.