#### Abstract

This study investigated an electrocardiogram (ECG) eigenvalue automatic analysis and detection method; ECG eigenvalues were used to reverse the myocardial action potential in order to achieve automatic detection and diagnosis of heart disease. Firstly, the frequency component of the feature signal was extracted based on the wavelet transform, which could be used to locate the signal feature after the energy integral processing. Secondly, this study established a simultaneous equations model of action potentials of the myocardial membrane, using ECG eigenvalues for regression fitting, in order to accurately obtain the eigenvalue vector of myocardial membrane potential. The experimental results show that the accuracy of ECG eigenvalue recognition is more than 99.27%, and the accuracy rate of detection of heart disease such as myocardial ischemia and heart failure is more than 86.7%.

#### 1. Introduction

ECG can record the physiological states of the heart and cardiovascular system in a real-time manner, and thus it is widely used for the detection and diagnosis of clinical heart disease [1]. ECG eigenvalue automatic detection can rapidly and accurately detect heart diseases [2]. Currently, ECG eigenvalue detection is based on multiple algorithms: the envelope analysis technique can effectively decompose complex signals into single component signals, which are typically empirical mode decomposition (EMD) and local mean decomposition (LMD). EMD is an adaptive signal decomposition method, the data from high frequency to low frequency decomposition into a series of intrinsic mode function (IMF) and a margin. Lahmiri and Boukadoum proposed A Weighted Bio-Signal Denoising Approach Using EMD in [3], which shows some advantages in ECG denoising. LMD solves the problem of endpoint effect of EMD method to a certain extent. However, both LMD and EMD belong to the recursive model, which have the problems of modal aliasing [4], end effect, being sensitive to noise and sampling, and difficulty in separating similar frequency components. But there is a problem caused by EMD [5]: in the background of bad noise, IMF will be submerged in the background of noise that leads to missing the signal characteristic component. Variational mode decomposition (VMD) solved this problem by transforming modal estimates into variational problems [6, 7].

The above methods are suitable for analyzing and dealing with aperiodic mutational signals [8]. If the periodic signals such as ECG are used to calculate the amount of periodic signals, it is difficult to determine threshold problems, especially for mobile real-time ECG monitoring, requiring low computational complexity and high detection accuracy, so the optimized wavelet processing is an ideal choice [9, 10].

However, two problems remain unresolved: firstly, which layer is more appropriate for feature detection after wavelet transform and secondly, whether the high-pass coefficient or low-pass coefficient is appropriate for feature location. If these key parameters are decided only by experiences, it is difficult to obtain systematic and scientific conclusions by experiments and emulations [11, 12]. This study investigated a detection method, which involved directly catching the signal frequency component during wavelet transform according to the frequency characteristics for different wavebands of ECG signal, to accurately locate the eigenvalue during wavelet transform. Currently, detection algorithms are mainly aimed at location and extraction of the QRS eigenvalue. Using these results and further reversing the electrophysiological activity of myocardial cells will be of great significance to automatic analysis and diagnosis of the physiological status of the heart [13]. Based on the eigenvalue detection, this research further studied the reverse analysis of myocardial action potential to enable automatic detection and diagnosis of heart diseases such as myocardial ischemia and heart failure.

#### 2. Specific Frequency Coefficient Obtained by Wavelet Bandpass Filtering

A wavelet transform was performed for signal with frequency , where the high-pass component frequency was and the low-pass component frequency was . The high-pass filter and low-pass filter have two intersections in : , . The two intersections represent the region where low frequency transitions to high frequency. According to the Fourier convolution theorem, it can be concluded that the role of and on signal is equivalent to the transfer function in filtering circuit analysis. For further analysis of the suppression multiple of signals at the two critical points, ; for , , so , obviously , and then . Clearly, it is a function related to with faster convergence rate. If , , and if , . For a given positive close to 0, there exists that always makes . Then an appropriate vanishing moment can make the suppression multiple at the critical point infinitely small and thus make the extra-regional gains of signal passing this point close to 0, theoretically equivalent to cut-off state. Assume the signal sampling frequency is , including the noise with frequency of . Assume the wave-trapped and denoising tolerable frequency bandwidth is , where is frequency bandwidth increment. If the signal section is , after each wavelet transform, the high-pass component covers the frequencies of , while the low-pass component covers the frequencies of . For higher orders of filter for wave trapping, the overlaying area of high-pass frequency and low-pass frequency is smaller, the filter frequency curve is steeper, and the energy is more concentrated. To facilitate calculation, this study adopted normalised frequency as the unit: for the normalised frequency in , the actual frequency refers to

Any frequency range , after normalised processing, can be expressed in solid area number field. According to the Shannon Theory, the sampling frequency should not be less than two times the maximum frequency in the analog signal frequency spectrum, so when directly filtering the sampling signal, the normalised frequency should be in , while for filtering at the layer of second or above, should be in .

Assume the normalised frequency for signal is in , and for the normalised frequency , if , the signal of frequency section can be extracted from by bandpass filtering after wavelet transform. As a demonstration, a wavelet transform is performed for signal , where refers to the low-pass component after transform and refers to the high-pass component after transform. According to the discussed situations, the following operations can be made according to concrete situations: indicates , where the result is returned, and then the algorithm ends. indicates and a wavelet transform is performed for signal . ; then this algorithm is repeated. indicates , and a wavelet transform is performed for signal . ; then this algorithm is repeated.

#### 3. Eigenvalue Extraction of QRS Wave Group and T Wave

How to accurately locate QRS wave group and T wave and extract their eigenvalues is of great significance for the detection of ECG eigenvalues. Affected by EMG interference, power frequency interference, and electromagnetic interference and noises, ECG signals are mixed with baseline drift and various noises, causing difficulties in the accurate location of ECG eigenvalues [14]. The basic method is to first analyze the frequency features of QRS wave group and extract the frequency components during wavelet decomposition, then enhance the signals according to certain strategy, and finally accurately locate the QRS wave group and T wave.

##### 3.1. Analysis of Frequency Features of QRS Wave and T Wave

Figure 1 shows the energy distribution of QRS wave and T wave on the frequency spectrum. It shows that the bandwidth for QRS wave is 0–40 Hz, accumulating nearly 99% of energy. To extract the wavelet system of QRS wave by bandpass filtering, the frequency bandwidth should be limited to about 20 Hz, so that the frequency section of 20 Hz bandwidth with maximum energy density in 0–40 Hz is achieved. By assuming only covers QRS wave signals, can transform from time domain to frequency domain. Section of 10 Hz bandwidth with maximum energy density is calculated by the following formulae:

**(a)**

**(b)**

**(c)**

Through calculation, it can be concluded that 76% of total energy is accumulated near 9.4 Hz–19.4 Hz of QRS wave. It can utilise the bandpass to extract the signal of this frequency section, where after the signal is enhanced, amplified, and processed, the higher identification can guarantee the signal is accurately locked. The wavelet coefficient has both frequency features and time domain features; location and extraction can be further made on the time domain. As shown in Figure 1, T wave has nearly 94% of energy in the 0–8 Hz frequency section. The bandwidth is narrower, to avoid overlapping with the baseband, and it selects 5 Hz waveband for extraction to calculate the frequency section of T wave of 5 Hz bandwidth with maximum energy density. By assuming only covers T wave signal, . Section of 5 Hz bandwidth with maximum energy density is calculated by the following formulae:

Through calculation, it can be concluded that 75% total energy is accumulated near 3.0–8.0 Hz.

##### 3.2. Extraction of Wavelet Coefficient Related to Features of QRS Wave Group and T Wave

According to the previous discussion, the wavelet signal component of QRS wave group should be extracted from 9.4 Hz to 19.4 Hz. To allow calculations, 10–20 Hz is used as the signal sampling section. When the sampling frequency is 200 Hz, the corresponding normalised frequency section is . By analysis, the wavelet bandpass filtering algorithm flow of is as follows.

The normalised frequency for the QRS frequency spectrum center is . When , the bandpass extraction fails to be made at the current wavelet decomposition layer, so the next round of wavelet transform needs to be made for the low-pass component after wavelet transform to finish the bandpass extraction. At this time, the resolution of wavelet-based signal space is shortened to a half, so the bandpass space should be expanded: , . In the second round of wavelet transform, is included in the low-pass space and the low-pass signal includes the direct current signal, so it should be further separated; let , to make the high-frequency component of the third round of wave transform as the extraction signal of QRS wave.

The energy distribution for T wave is 3.0–8.0 Hz, where the corresponding normalised frequency is and its center frequency is . After the fourth wavelet transform, , and the corresponding frequency range is , , so it can select the high-frequency component after fourth filtering as the extraction signal, as shown in Figure 2.

**(a)**

**(b)**

**(c)**

##### 3.3. Location and Eigenvalue Extraction of QRS Wave Group and T Wave

This processing has extracted the wavelet coefficient concentrating energies of the R wave signal, so next the coefficient can be accurately localised at the time domain. This study utilised a 0-1 extraction function to transform the wavelet feature component into a series of 0-1 square waves and then took the midpoint of each wave 1 as the time domain location result. The extraction function is expressed as follows:During the algorithm implementation process, the threshold value should be upgraded:

Generally, a real number of is used. While the value can be determined as per the actual width of R wave in the time domain, generally speaking, if R wave lasts for , . When the square wave is wider, it should be further localised to minimum time. A trigger mechanism should be set so that when , is triggered, and when changes from 1 to 0, the calculation and location will be made by . A concrete algorithm implementation can be finished in a loop iteration where the time complexity is . Figure 3 shows the location of features of QRS wave and T wave, and Figure 4 shows the location results of algorithm features. The feature detection and location are based on the wavelet transform and are combined with signal denoising, compressing, and other processing so that the algorithm can save resources.

**(a)**

**(b)**

**(c)**

**(d)**

**(a)**

**(b)**

#### 4. ECG Reverse Analysis and Myocardial Membrane Action Potential Feature Detection

The electrocardiogram (ECG) is a dynamic potential difference of myocardial membrane action potential between two points of body surface, and it can objectively reflect the physiological status of the heart [15]. ECG is of great significance to clinical diagnosis, but ECG automatic disease diagnosis and analysis face certain technology challenges. Some studies [16, 17] have put forward an ECG mode recognition method to establish a complete ECG feature template database in advance and then match it with extracted signal for analysis. However, this method has difficulties in establishing a complete ECG template and complexity in matching analysis time; it is not suitable for mobile and real-time ECG. Other studies [18, 19] have put forward an artificial intelligent algorithm, by learning, training, and accumulating the knowledge and experiences to perform intelligent recognition on extracted signals. This method can adapt to big-data and high-performance platform processing but is of insufficient resources for mobile and real-time ECG. The current study reversely calculated the heart outer membrane potential and obtained its eigenvalue based on previously extracted ECG eigenvalue, to enable the physiological status of heart to be shown and to provide a basis for automatic analysis of heart disease diagnosis and health surveillance.

##### 4.1. Heart Membrane Potential Action Figure and Feature Model

The potential difference between the inside and outside of the myocardial membrane is called the transmembrane potential or membrane potential. When the myocardial cells are excited by irritation, the membrane potential will suddenly change; the potential inside the membrane will change from negative potential to positive potential [20], while the potential outside the membrane will change from positive potential to negative potential. This change in myocardial transmembrane potential is called action potential. Figure 5 shows the relationship between myocardial membrane potential and ECG signal. The TNNP model is the single cell transmembrane potential action model presented by Köhler et al. [21]. By H-H equivalent model principle, the cell membrane acts as a capacitor, the ionic currents and pumps are equivalent to interrelated power and resistance [22], so the single cell electrophysiological model of TNNP model can be expressed bywhere is membrane potential, is time, is outside stimulated current, and is unit membrane capacitance. as total transmembrane current can be expressed bywhere is type-L Ca^{2+} current, is the current of Na^{+}/Ca^{2+} exchanger, is Na/K pump current, and are calcium and potassium current at platform phase, respectively, and are background potassium and calcium current, respectively, is rapid Na^{+} current, is inward rectifier K^{+} current, is transient outward current, is rapid delayed rectifier K^{+} current, and is slow delayed rectifier K^{+} current. The H-H model makes the influence factor of each current equivalent to a control logic gate to show the electrophysiological status of heart cells. The control parameters of the membrane potential action equation are as many as 256 [23]. For ECG automatic detection and calculation, the detection and extraction of large amounts of fine and sensitive physiological parameters is a complicated and difficult task, not suitable for a mobile and real-time calculation platform.

**(a)**

**(b)**

This complicated heart potential action equation cannot be directly determined by parameters and is hard to fit with polynomials. Based on this, the current study utilised big data to establish a standardised heart outer membrane action potential mode and modulated this model with simple parameters, to enable this model to show different heart outer membrane action potential characteristics and reversely calculate this model with ECG eigenvalue. The myocardial cell action potential can directly reflect the electrophysiological activity of cells in universality and stability; under normal circumstances, it can better show the electrophysiological activity status of myocardial cells. This study used the heart outer membrane potential database as sample data to perform regression analysis and establish the v-lead left and right standard models, where the corresponding figures are as follows.

Let indicate left epimyocardium standard action potential of human and let indicate right epimyocardium standard action potential of human.

means the -coordinate of is scalable in times and the -coordinate is scalable in times.

means the -coordinate of is scalable in times and the -coordinate is scalable in times. Figure 6 compares the normal and abnormal epicardium action potentials, showing , , and have influences on epicardium action potential forms. Figure 6(b) shows the myocardial action potential figure and ECG with myocardial ischemia, and Figure 6(c) shows the myocardial action potential figure and ECG with heart failure. In the case of myocardial ischemia, in , is less than 0.9 and is less than 0.95. In the case of heart failure, in , is less than 1.1 and is less than 0.96. Therefore, eigenvalues and can effectively show the status of myocardial electrophysiology activity and thus provide a way for intelligent diagnosis and analysis.

**(a)**

**(b)**

**(c)**

##### 4.2. Extraction of Potential Features of Heart Membrane

Through detection of ECG eigenvalue, it can obtain basic features of the ECG signal: to locate the time of R peak value and T peak value, obtain R peak value Ψ and T peak value , and acquire the integral of ECG signal time on time Δ from R wave starting time to rest time. Accordingly, the following simultaneous equations model can be established:where and indicate the integral of on time . This model is unidentifiable from structure. To simplify calculations, this study assigned 1, respectively, to , , to get , , and hence, formula (7) is simplified into a regression simultaneous equations model:In the simultaneous equations model, the first equation is a linear equation with two unknowns and is not dependent on the second equation, so the least square method can be adopted independently for unbiased estimation of parameters , . Through detection and analysis, the experimental data can be attained:

The corresponding deviation equation is

Calculate the partial derivative of , , let it be 0, and then solve the equation to getwhere

By rounds of the least square method, the estimated values of , of sets will be attained:

Substitute them into for regression fitting of the least square method on . Generally speaking, the system will tend to be stable after multiple rounds of iterations, and then the parameters , , can objectively reflect the basic features of myocardial electrical activity. Figure 7 shows ECG reverse feature analysis results.

**(a)**

**(b)**

**(c)**

**(d)**

This investigation sampled 15 records, respectively, from the European ST-T database and the BIDMC congestive heart failure database and sampled 10 records from ECG ID for comparative experiments, to analyze the correlation between and and myocardial ischemia and heart failure. When is less than 0.85, the myocardial ischemia probability begins to increase; when is less than 0.7, the probability is as high as 89%. When is greater than 1.2, the correlation of heart failure will obviously increase; when is greater than 1.45, the probability of heart failure will be as high as 77.5%. The correlations are shown in Figure 8.

**(a)**

**(b)**

#### 5. Experiment and Emulation Results

This research utilised the ECG ID database to evaluate the ECG detection method. The ECG database includes the two-channel ECG records of 48.5 hours, with 11 digits of resolutions and 10 mV. ECG records from this database cover sharp waves and high T waves, negative QRS wave group, small QRS wave group, wide QRS wave group, myoelectricity noise, baseline drift, sudden change of QRS amplitude, QRS morphological mutation, polymorphous premature ventricular contraction, long pause, and irregular heart rhythm. Detection and experiments were performed by the algorithm presented in this paper to obtain six quantitative results: correct detection of R or T peak time showed true positive (TP); loss of R or T peak time showed false negative (FN); and the noise spike detected to be R or T peak time showed false positive (FP). To evaluate the performance of the given detection algorithm, the following formulae should be utilised to calculate the sensitivity (Se) and detection error rate (DER). To evaluate the detection accuracy and accuracy rate of this method, accuracy (Acc) is defined. In Table 1, R peak detection rate of first channel (each) of 16 ECG records in the MIT-BIH arrhythmia database is summarised. By running the algorithm for detection, QRS wave totally generates 43 FN pulses and 44 FP beats, totalling 87 failures. The detection accuracy of ECG records change from 99.32% to 100% based on normal and pathological ECG signal features and different noises. The detection accuracy for QRS wave is slightly higher than T wave; T wave totally generates 48 FN pulses and 54 FP beats, totalling 102 failures, as shown in Table 1:

To test the detection effects of the algorithm on pathological ECG signals of myocardial ischemia and heart failure, this study used 15 ECG samples with myocardial ischemia from the European ST-T database, 15 ECG samples with heart failure from the BIDMC congestive heart failure database, and 10 raw signal ECG samples from the ECG ID database, with 100 heart rhythm signals included for each sample. As seen from the detection results in Table 2, 14 ECG samples with myocardial ischemia were accurately detected, with an accuracy of 93.3%; 13 samples with heart failure were accurately detected, with an accuracy of 86.7%; and 10 raw signal ECG samples were accurately detected, with an accuracy of 100%.

Signal analysis and processing can be divided into two methods: direct analysis and transformation analysis. Signal transformation analysis and processing is carried out by mapping the signal to another domain, such as wavelet transformation or EMD transformation.

Figure 9(a) shows the ECG signal processing of conventional processes, including denoising, feature detection, and filtering of the three main processes. If is the length of the signal under normal circumstances, each process needs to undergo a transformation, assuming that each transformation requires a time frequency of . Under these conditions, denoising, detection, and compression are performed. Assuming that the time frequency of each process is , the total time required for the conventional signal processing method is . If the proposed algorithm is used for completing the denoising, the detection, and the compression operation, the whole process only needs to perform the wavelet transform one time, with a total time taken of (as shown in Figure 9(b)). The algorithm proposed in this paper can reduce the time for transformation between signal domains due to the combination of feature detection, signal filtering, and signal compression, thus saving resources and speeding up the operation. As the wavelet transformation needs to undergo both processes of decomposition and reconstruction, the useful signal is often lost in the process of conversion; for example, the symmetry of the orthogonal wavelet will decrease with the increase of the order of the vanishing moment and the process will cause signal distortion. In this paper, we present a method which reduces the time for transformation, so useful signal loss can be reduced and accuracy of detection increased.

**(a)**

**(b)**

#### 6. Conclusion

The wavelet transform was performed to achieve wave trapping extraction, to extract the feature signal component from wavelet decomposition signal and then enhance and locate the energy expressing eigenvalue. This method can integrate the feature location, signal filtering, signal compressing, and other processing, and therefore it can save computing resources, speed up the processing, and enhance the detection accuracy. This study utilised ECG eigenvalue to reversely calculate myocardial potential action features. This research also established the simultaneous equations model to represent the myocardial membrane potential activity and utilised iterative regression to analyze the asymptotic approximation, to cause the model to accurately show the myocardial potential action and provide the basis for automatic diagnosis of heart diseases.

#### Conflicts of Interest

The authors declare no competing financial interests.

#### Authors’ Contributions

Ziran Peng and Guojun Wang conceived and designed the experiments, Ziran Peng performed the experiments, and Guojun Wang analyzed the data and contributed analysis tools. Ziran Peng wrote and edited the main manuscript text. All authors reviewed the manuscript.

#### Acknowledgments

This research was supported by National Natural Science Foundation of China (61632009, 61472451, 61272151, and 61462006), Natural Science Foundation of Hunan Province (2017JJ5038), and the “Mobile Health” Ministry of Education-China Mobile Joint Laboratory (MOE-DST no. []311).