Adaptive Recursive Least Squares Denoising in Ventricular Fibrillation ECG Signals

Cardiac arrest is a fatal and urgent disease in humans. A high‐quality electrocardiogram (ECG) has a positive guide to the success of defibrillation and resuscitation. However, because of artificial motion interference and ambient noise, reliable ECG signals can be obtained only during chest compression (CC) pauses. To address this issue, the adaptive recursive least squares (RLS) denoising approach is proposed. First, the ECG signals of porcine are divided into three groups: CC, without CC, and both with and without CC. Then, five Gaussian noises with different signals‐to‐noise ratios (SNR) and five noises with different distribution types are added, respectively. Furthermore, RLS is compared with six other different denoising approaches. Experimental results demonstrate significant differences between RLS and the other six algorithms in main metrics. SNR and related factors are larger, while the root mean square error is smaller. In conclusion, RLS can significantly eliminate many types of ambient noise, and improve the quality of ECG signals during cardiopulmonary resuscitation.


Introduction
Cardiac arrest can be fatal in humans, and most patients with cardiac arrest show early ventricular fibrillation (VF) or ventricular fibrillation waveforms. [1,2] Ventricular fibrillation refers to the disorderly agitation of the ventricle, resulting in the disappearance of the regular and orderly agitation and contraction function of the ventricle. This is a functional cardiac arrest, which DOI: 10.1002/adsr.202200035 is a fatal arrhythmia. Defibrillation and chest compressions (CC) are the only effective methods to terminate ventricular fibrillation and restore tissue rhythm. [3,4] Ineffective defibrillation can cause unnecessary interruption of chest compressions, which directly damage the myocardium and further reduce the success rate of resuscitation. [5][6][7][8] Many studies have shown that the electrical energy delivered by defibrillation is closely related to the severity of myocardial dysfunction after cardiac arrest. [9] The amplitude spectrum area (AMSA) has been proven to improve the success of defibrillation, the return of spontaneous circulation (ROSC), and long-term survival by aggregating animal and clinical studies. [4,[10][11][12][13] In addition, AMSA has a good correlation with coronary perfusion pressure and can reflect the energy status of the myocardium. [14][15][16] However, reliable AMSA can only be obtained during the interval of CC pause. As the mechanical activity from the CC introduces artifact components into the electrocardiogram (ECG) signal, which may lead to overestimation of AMSA and reduction of predictive performance, and causes inaccuracy of the shock/nonshock decision. [17,18] Therefore, it is important to obtain stable and reliable ECG data for ventricular fibrillation. The key is how to eliminate artificial motion interference and environmental noise in cardiopulmonary resuscitation (CPR).
Adaptive denoising is an optimal filtering method developed on the basis of linear filtering. It offers stronger adaptability and better filtering performance, and it has been widely used in engineering practice, especially in information processing. The adaptive noise filter uses output feedback, making it maintains the best output even if the filter input is varied. Meanwhile, it can compensate for the parameter variation and error of the filter element to some extent. However, the adaptive noise filter has disadvantages, that is, stability and low convergence rate. To address these issues, many adaptive denoising approaches are developed, including Wiener (WN) filter, Kalman (KLM) filter, wavelet transform (WL) filter, least mean square (LMS) filter, and normalized least mean square (NLMS) filter. Compared with the above conventional denoising approaches, recursive least squares (RLS) has better convergence performance and stability. We expect that the RLS filter can effectively remove artificial motion interference and environmental noise in ventricular fibrillation ECG, obtain more accurate physiological information in CPR compared with www.advancedsciencenews.com www.advsensorres.com traditional denoising methods, and assist and guide clinical staff to improve the success of defibrillation and resuscitation.

Data Collection
The ventricular fibrillation ECG data were retrospectively collected from previous studies on mild hypothermia improving CPR in a porcine model. [19] ECG and blood pressure waveform signals were collected with a Windaq hardware-/softwaresupported data acquisition system (Dataq Instruments Inc., Akron, OH, USA), with a data sampling rate of 300 Hz. The data included the initiation of a model of ventricular fibrillation, the initiation of chest compressions for CPR, and the recovery from successful defibrillation to self-circulation or the failure of resuscitation. Data included initiation of ventricular fibrillation models, initiation of chest compressions for CPR, and continued until successful defibrillation returned to spontaneous circulation or resuscitation failed. We divided the ventricular fibrillation ECG data during the procedure into two parts: with chest compressions and without chest compressions. Figure 1 shows ECG and blood pressure waveforms with and without chest compressions.

Noise Simulation
To test the RLS denoising effect on ventricular fibrillation ECG signals, ten noise models were simulated respectively from the intensity and noise distribution type. First, additive white Gaussian noise (AWGN) with five different SNRs (−5, −3, 3, 5, and 10 dB) was added to the ECG data. Second, the ECG data of ventricular fibrillation were mixed with five types of noise, that is, exponential distribution noise, Gaussian distribution noise, impulse noise, Poisson distribution noise, and colored noise. Exponential distribution noise is a continuous probability distribution with a memoryless (or constant failure rate) property, which can be used to represent the time intervals of independent random events. Gaussian noise obeys a Gaussian distribution, while its power spectral density is uniformly distributed. The impulsive noise is discontinuous and consists of irregular pulses or noise spikes of short duration and large magnitude. The duration and repetition rate of the impulsive noise are usually less than 0.5 s and 10 Hz intermittent noise, respectively. In addition, the peak noise intensity ratio of the impulsive noise is more than 10 dB. Poisson distribution noise is suitable to describe the probability distribution of the number of random events in unit time. Colored noise refers to a kind of noise that causes an uneven power spectral density function. The shape of the power spectral density function determines the "color" of the noise.

Adaptive Recursive Least Squares Denoising Approach
Adaptive denoising approach has the advantages of real-time processing, low computational complexity, good adaptability, and robustness. Previous studies demonstrated that LMS, NLMS, and their improved methods can improve the noise reduction metrics very well. [20][21][22][23][24] Combined with the prior knowledge of signal quality and energy, it is convenient to eliminate the adverse effects of chest compressions. [25][26][27] Adaptive denoising approaches are suitable for nonstationary stochastic processes because they can adjust their parameters automatically, and require little or no prior knowledge about the signals and noises.
RLS is the minimum square estimation of the tap weight vector of a filter given n−1 iterations. The latest estimation of the weight vector of n iterations is calculated based on newly arrived data. RLS is a transverse filter with length M and coefficient w(n). [28,29] At each time step, the coefficients are updated through the adaptive control unit using the input vector u(n). The prior estimation error represents the deviation between the expected output and the actual output. Equations (1)-(4) describe the relationship between variables.
where u(n) represents the input vector or training sample. w(n), y(n), (n), d(n), and n indicate weight vector, actual output, prior estimation error, expected output, and iteration number, respectively.
The coefficients are constantly updated by the input vector and the prior estimation error to achieve adaptive filtering. The detailed calculation process is shown in Equations (5)-(7) where k(n) represents the gain vector, P(n) indicates the covariance matrix of the noise, and denotes the forgetting factor. The convergence rate of the RLS filter is fast and does not vary with the diffusivity of the eigenvalues of the average correlation matrix R of the input vector u(n) set. Figure 2 is the block diagram of the adaptive RLS filter.

Other Denoising Approaches
In order to evaluate the denoising effect of RLS, six conventional denoising approaches are also performed on the ECG data. A brief introduction for each approach is described as follows:

Wiener Filter
Wiener filter applies a linear filter with least squares as the optimal criterion. Under certain constraints, the square variance between the output and the given function is minimal. The toblitz equation can be solved mathematically. Wiener filter parameters are fixed and suitable for stationary random signals. [30,31]

Morphological Filter
Morphological filter applies a kind of filter that consists of the basic operations of mathematical morphology, and its purpose is to analyze the shape and structure of the object. [32,33]

KLM Filter
KLM filter estimates the state of a linear system through the input and output observations of the system. The KLM filter can estimate the state of a dynamic system from a series of data with measurement noise when the measurement variance is known. The parameters of the KLM filter are time-varying and suitable for nonstationary random signals. [34]

Wavelet Filter
The most useful signal is the maximum value pair on the corresponding scale after the wavelet transform, while the noise signal still exhibits Gaussian distribution and its amplitude is small. Therefore, the pre-set adaptive threshold is used to estimate the wavelet coefficients on the scale with more serious noise, so as to achieve the purpose of denoising and complete signal reconstruction. The DB4 wavelet basis function used in this paper is decomposed by three wavelet layers. [35,36]

LMS Filter
The basic structure of the LMS algorithm is the same as that shown in Figure 2. The performance of LMS is mainly affected by three factors: step size, input vector u(n), and estimation error. [29] The advantages of the LMS algorithm are as follows: simplicity and ease of implementation, low complexity, and the suppressed side-lobe effect. Disadvantages include a slow convergence rate, poor tracking performance, and the stability of the system decreasing with the increase of the filter order (step size parameter). LMS requires the input vectors to be linearly independent at different times.

NLMS Filter
NLMS is an improvement of LMS. At iteration, the square of the euclidean norm (the modulus) of the input vector is normalized. That is, from one iteration to the next, the weight vector of the adaptive filter should change in a minimal way and be constrained by the output of the updated filter. [29]

Experiments and Results
The main evaluation metrics include SNR, root mean square error (RMSE), and correlation factor R, which reflect the performance of each denoising approach. SNR represents the ratio of useful signal power to noise signal power, and the evaluation indicators are expressed in decibels (dB). A higher SNR means better performance. RMSE reflects the difference between the denoised signal and the original signal. The RMSE value is another indicator that signifies the ability of denoising. The smaller the value is, the better the denoising effect is achieved. R is a statistical metric used to study the degree of linear correlation between variables. The larger the absolute value of the correlation coefficient is, the stronger the correlation is. The correlation coefficient is closer to 1, and the stronger the correlation is. Therefore, large SNR, small RMSE, and large R indicate strong denoising ability. SNR, RMSE, and R are calculated as Equations (8)-(10), where X i and Y i are the original ECG signals and denoised ECG signals. n represents the signal sample number.
In addition, performance can be further evaluated by mean error (ME), error variance (EV), total harmonic distortion (THD), and algorithm processing time (TIME). The ME is the average value of the difference between the denoised signal and the original signal. The EV is the average of the sum of squared deviations between the error value and the error mean of the denoised and original signal at each point. It describes the dispersion of the error and is also the distance of this variable from its expected value. The value of the THD reflects the degree of the signal's harmonic distortion. THD is usually expressed as a percentage.

White Gaussian Noise with Different SNRs Mixed into the ECG Data
First, ventricular fibrillation ECG data were divided into three groups: with chest compressions, without chest compressions, and both with and without chest compressions. White Gaussian noise with SNRs of −5, −3, 3, 5, and 10 dB was successively mixed into each group. The denoising effects of the Wiener filter, morphology filter, KLM filter, wavelet filter, LMS filter, NLMS filter, and RLS filter were compared. SNR, RMSE, R, THD, ME, EV, and TIME were calculated for each approach. SNR, RMSE, and R are the main evaluation metrics, and the rest are secondary evaluation metrics. Wiener filter, morphological filter, KLM filter, LMS filter, NLMS filter, and RLS filter denoise mixed ECG signals with Gaussian white noise at different SNRs, as shown in Figures 3 and 4. Four secondary evaluation metrics such as THD, ME, EV, and TIME after denoising were further analyzed. The results show that these metrics of THD, ME, EV, and TIME after RLS denoising are different from the MP method. Combined with the SNR, RMSE, and R indicators, MP is the worst performance among the seven denoising methods. In  the chest compressions group, the RLS program processes only faster than the WL filter and slower than the other five methods.
Then, paired sample t-test was used to analyze the denoising results of the chest compressions group and the without chest compressions group. Only RMSE (p = 0) and THD (p = 0) had significant differences, SNR (p = 0.260) and correlation factor (p = 0.242) showed no significant difference, and ME and EV did not have statistical results. Figure 5 shows the waveform of the 9.3-s ventricular fibrillation ECG signals (both with and without chest compressions) mixed with −5 dB white Gaussian noise, and the waveform after denoising with each algorithm mentioned in the paper. From the waveform in the figure combined with the evaluation metrics after denoising, it can be concluded that the effects of morphological and KLM denoising are poor, while Wiener, wavelet, and RLS denoising perform better. From the graph, LMS and NLMS denoising obviously show the problem of slow convergence, which leads to a poor denoising effect at the beginning of the iteration. With the increase in the amount of data, the denoising effect gradually improves.

ECG Data Mixed with Different Types of Noise
Furthermore, the denoising effect of seven algorithms is tested from the noise distribution type. The ECG signals were mixed with exponential noise, Gaussian noise, pulse noise, Poisson noise, and color noise, respectively. All noises have a signal-tonoise ratio of 5 dB. Figures 6 and 7 show the evaluation metrics of different types of noise signals after denoising. Similarly, the mixed signals were divided into three groups: with chest compressions, without chest compressions, and both with and without chest compressions.
For the denoising results of five mixed signals, a single-factor ANOVA analysis was carried out again.  SNR after denoising (11.749 ± 3.807 vs 13.08 ± 3.494 vs 16.846 ± 4.941), RMSE is the smallest (0.026 ± 0.009 vs 0.033 ± 0.013 vs 0.018 ± 0.009) and R is the largest (0.976 ± 0.011 vs 0.972 ± 0.027 vs 0.991 ± 0.007). The results of multiple comparisons of seven denoising algorithms are as follows. In the three groups, the SNR index of RLS after denoising is different from the other six methods and far greater than them; The RMSE (p = 0.01 vs p = 0.004 vs p = 0.007) and R (p = 0.007 vs p = 0.041 vs p = 0.013) metrics after RLS denoising are only significantly different from MP method in the three groups; The four secondary evaluation metrics after RLS denoising were also only statistically different from the MP method in the three groups.
Again, paired sample t-test was used to analyze the denoising results of the chest compressions group and the without chest compressions group. SNR (p = 0.327), RMSE (p = 0.311), R (p = 0.687), ME (p = 0.105), EV (p = 0.704), and TIME (p = 0.88) showed no significant differences. Only THD showed a significant difference between the two groups (p = 0).
The ECG of mixed exponential noise, Gaussian noise, pulse noise, Poisson noise, colored noise, and their signal waveform denoised by RLS are shown in Figure 8. As seen from the figure, regardless of the type of noise mixed with the ventricular fibrillation ECG signal, RLS filtering processing can have a strong inhibitory effect on noise, and stable and reliable data can be obtained.

Discussions
RLS has been introduced for ventricular fibrillation ECG signals denoising. Experiment results show that RLS achieves a better denoising effect on the data mixed with different intensity noise and different types of noise compared with the six conventional approaches. RLS can almost completely eliminate the influence of artificial motion interference and a variety of environmental noises.
Artifacts produced by CC alter the underlying ECG signals during CPR, affecting the reliability of waveform analysis, the identification of defibrillable rhythms, and the evaluation of successful defibrillation. [17,18] Obtaining accurate ventricular fibrillation ECG signals without interruption of chest compressions to improve the prediction of whether to defibrillate or continue compressions is critical for the patient. Therefore, many methods have been proposed to eliminate compression artifacts in the context of continuous chest compressions. The frequency of CC in CPR is about 2 Hz, and artifacts can be eliminated with filters of a specific cutoff frequency. However, the basic frequency of the human VF signal is 3-8 Hz, and the motion artifacts are superimposed on each other, making this method ineffective. [37,38] Next, the application of adaptive denoising combined with reference data synchronously recorded by ECG (e.g., transthoracic impedance, arterial blood pressure waveform, and compressions depth) to eliminate motion artifacts significantly increased the VF signal destroyed by motion artifacts. [39] However, the acquisition of the reference signal requires modification of the AED hardware. Therefore, adaptive filtering has become the focus of research. [23,24] In addition, Li. Y., Bisera. J. et al. proposed a new morphological consistency evaluation algorithm based on continuous wavelet transform to detect unorganized VFs from organized sinus rhythm (SR) without interrupting chest compressions. [40] Coult. J., Kwok. H. et al. found www.advancedsciencenews.com www.advsensorres.com that the prior regression of tissue rhythm (ROR) combined with AMSA and median slope (MS) led to successful defibrillation. [41] There are some limitations to the study. First, only retrospective data and ten types of noise models were introduced for evaluating the performance of RLS. Artificial motion interference and the ten types of noises simulated in this study are typical major noises during CPR, but they cannot represent and simulate all noises. Whether there is noise unsuitable for RLS denoising needs further discovery and analysis. Second, the data are collected from porcine. The approach has not been tested and verified in a clinical patient. Nevertheless, porcine is still considered an ideal animal model for clinical research. Some of the results, based on porcine models, were included in the American Heart Association's resuscitation guidelines after clinical validation. In most medical research, animal models are the first step, followed by clinical studies, which are routine procedures. Therefore, although the results of this study may have good reliability and clinical applicability, further verification and optimization are needed before clinical application. Under the background of original strong noise, how to obtain high quality and high precision clinical dynamic ECG data still needs more research.

Conclusions
In this paper, we study the denoising of ECG signals of ventricular fibrillation by using an RLS filter. Experiment results demonstrate that the RLS denoising approach has high SNR, small RMSE, and strong correlation characteristics when mixed with different intensity noise and different types of noise. RLS denoising can significantly remove the effects of various noises on ventricular fibrillation signals. After RLS filtering, stable and reliable ECG signals can be obtained for further research and clinical treatment.