1. Introduction
In recent years, cardiovascular diseases have caused great harm to the human heart, and their lethality has posed a threat to human health, which is now being taken seriously. In clinical medicine, ECG signals record the electrical activity characteristics of the heart, and can detect abnormalities in the heart, and can be used as an important reference basis for the prevention and diagnosis of cardiovascular diseases. However, ECG signals are weak and of low frequency; the acquisition equipment, environmental changes, and the human body’s own activities are inevitably affected by noise; and the presence of noise causes certain difficulties in the identification of the characteristics of the ECG signals. The most serious impact is caused by baseline drift interference, which causes the baseline of ECG signals to deviate from the horizontal position, and can even cause the loss or distortion of signal characteristics. Therefore, how to separate the real ECG signals from the strong noise interference and retain the morphological features of the signals has become a key research direction in this field, and is of great importance.
As the level of signal processing becomes more mature, there are more new methods for ECG signal processing. The main noises in ECG signals are EMG interference, industrial frequency interference, and baseline drift. Because of the difficulty in removing baseline drift from ECG signals, it has the most serious impact on the characteristics of ECG signals, and it will be focused on in this paper.
To filter industrial frequency noise and myoelectric noise, in 2006, Zhao et al. combined empirical mode decomposition (EMD) with an infinite impulse response (IIR) trap to filter the industrial frequency noise in ECG signals [
1]. Although there was a certain improvement in the denoising effect, the detailed information of the original signals could not be better preserved, and the mutation of the original signals could not be more accurately represented. In 2012, Kabir et al. combined the wavelet thresholding method and EMD to remove EMG noise [
2]. The wavelet thresholding method improved the time–frequency resolution; however, the soft thresholding function compressed the function signal and made the function signal produce constant deviation, causing signal distortion as a consequence. In 2014, Choudhry et al. [
3] used the wavelet thresholding method to filter EMG interference. However, the wavelet threshold denoising method needs to select the appropriate wavelet basis function, threshold function, threshold value, etc., and set the feasible number of decomposition layers according to the signal to be analyzed, which lacks a certain degree of adaptivity. In 2017, Xiao et al. decomposed ECG signals by EMD to obtain several IMF components, performed singular spectrum analysis (SSA) noise reduction on each IMF component, and finally reconstructed each IMF component to obtain the ECG signals with EMG interference removed [
4]. Although this overcame the problem of wavelet basis function selection, the EMD algorithm suffers from the problems of modal confusion and endpoint effect, so the signal denoising effect was poor and the algorithm operation time was too long. In 2020, Yin et al. used ensemble empirical mode decomposition (EEMD) to complete the decomposition of noisy signals and finally obtained ECG signals with the interference removed [
5]. This method can improve the modal mixing to a certain extent and is somewhat improved compared to the EMD algorithm; however, the workload and the time required for the whole algorithm are large and not complete. In the same year, Fu et al. [
6] introduced peak error on the basis of complete ensemble empirical mode decomposition (CEEMD) to adaptively determine the number of ensemble averages and complete industrial frequency interference removal. This method not only reduces the amount of integration, but also makes the reconstruction error close to zero and causes less noise residue. However, if the parameters of CEEMD are not selected appropriately, the IMF from each decomposition is different, and the signal decomposition generates randomness, and even generates the wrong components leading to noncompliance in IMF. In 2021, Yang et al. proposed an improved wavelet thresholding function containing two dynamic parameters [
7]. The method overcomes the shortcomings of soft and hard thresholding functions, and the denoising effect is more ideal, but the computation is large, the efficiency is low, and the algorithm’s structure is more complex. In 2022, Chen et al. proposed a wavelet packet analysis combined with singular value difference for an ECG signal denoising algorithm [
8].
For filtering baseline drift, in 2014, Pang et al. used a mathematical morphology method to remove baseline drift in ECG signals followed by R-wave localization, which improved the R-wave recognition rate by 0.5% to 5% compared to wavelet transform [
9]. In the same year, Ding et al. proposed a filtering algorithm based on the combination of EMD and morphological filtering to remove baseline drift, which is more effective compared to the single EMD method or the morphological filtering method [
10]. In 2015, Sharmna proposed a method to remove the baseline drift in ECG signals by Hilbert vibration decomposition (HVD) [
11]. In the same year, Gupta et al. used multivariate empirical modal decomposition (MEMD) to remove the baseline drift in ECG signals [
12]. In 2016, Satijia et al. proposed the use of sparse decomposition to remove baseline drift interference in ECG signals [
13]. In the same year, Prabhakararao et al. used variable modal decomposition (VMD), where the component corresponding to the baseline drift is estimated based on the center frequency, and then this component is subtracted from the noisy signal to achieve baseline drift removal [
14]. This method works well, but the optimal number of layers needs to be calculated by a priori estimation. In 2017, Singh et al. used the empirical wavelet transform (EWT) to remove baseline drift [
15]. Experiments show that the method has strong adaptive and real-time performance, but the algorithm is inefficient. In 2018, Jain et al. used EMD to decompose the band noise signal, then selected the components with baseline drift by spectral analysis, and used a Savitzky–Golay filter to weaken the baseline drift in the components. Finally, the processed IMF and the rest of the IMF were reconstructed to obtain the ECG signals without baseline drift [
16]. This method is susceptible to the influence of the reference signal and has poor robustness. In the same year, Sun et al. proposed a wavelet packet decomposition method for removing baseline drift and a modified wavelet thresholding method for denoising the original ECG signals [
17]. In 2020, Amit et al. proposed a Fourier decomposition method (FDM) to separate both baseline drift and PLI from ECG signals and obtain clean ECG data [
18]. In 2021, Romero et al. proposed a filtering algorithm for ECG signals containing baseline drift using deep learning, which requires a large amount of experimental data [
19].
In this paper, the latest intelligent optimization algorithm, the sparrow search algorithm (SSA), is applied to the parameter combination search of VMD, and is then combined with the SVD algorithm to form the final VMD–SSA–SVD noise reduction method. To verify its feasibility and superiority, the VMD–SSA–SVD denoising algorithm is applied to ECG signals and compared with other methods. The experimental results show that it can achieve the correction of baseline drift and the filtering of random noise interference, while retaining the complete characteristics of the signals.
3. Methodology
3.1. VMD Algorithm
The VMD algorithm is adaptive and non-recursive for signal processing [
23]. The theoretical framework of the algorithm is to search for the optimal solution of the entire variational model through several iterations, then determine the center frequency and bandwidth of each intrinsic mode component, and finally decompose the IMF components with a predetermined number of scales of
k fixed bandwidths to achieve an effective dissection in the frequency domain of the signal. The VMD method has many advantages, such as high decomposition accuracy, fast computational speed, strong theoretical support, and high robustness, due to its own Wiener filtering characteristics.
The parameters of the VMD algorithm are closely related to its decomposition performance, including the modal number , quadratic penalty factor , fidelity coefficient , and convergence tolerance . In the process of decomposing different signals, these parameters need to change adaptively to achieve the optimal decomposition effect. On the premise of avoiding modal mixing, the effective parameter setting has a great influence on the decomposition effect of the whole signal. In fact, the combined study found that and in the VMD algorithm have a particularly significant effect on the decomposition effect, while and have little effect on the decomposition result, and the standard default value is generally used.
3.2. SSA Algorithm
SSA, a new swarm intelligence optimization algorithm, has a bionic principle that simulates the foraging and anti-predation behavior of sparrows [
24]. In this paper, in view of the SSA advantages such as fewer parameter adjustments, strong robustness, and easy implementation, as well as the VMD disadvantage of difficult parameter selection, the SSA algorithm is applied to the parameter optimization of VMD to achieve the adaptive selection of VMD parameters, which to some extent makes up for its deficiencies, thus obtaining the optimal parameter combination [
,
].
Considering that the SSA algorithm needs to determine an adaptation function when searching for parameters, the adaptation value of individual sparrows is calculated each time their positions are updated, comparing the adaptation values of each position in the population [
25]. In order to search for the best global component, the local minimal entropy value is used as the fitness function in the optimization search process.
Compared with the traditional optimization algorithm, the SSA algorithm has a great advantage both in finding the best component and in iteration speed. The VMD–SSA method requires determining the range of the VMD parameters and , and setting the model parameters of SSA. In this paper, takes an integer in the interval [2, 15]; takes an integer in the interval [500, 5000]; and the maximum number of iterations is set to 15. The number of populations is set to 30. As the number of current iterations increases, the fitness values at each position are continuously calculated and compared for updating until after they are greater than the maximum number of iterations. Finally, the best fitness value of the population and the optimal parameters and are output, and we save the values.
In this paper, in order to test the performance of the SSA algorithm to optimize the VMD decomposition, and to demonstrate the strong local optimization-seeking ability of SSA, a set of test signals were selected for verification. The composition of the signals is shown in Equation (1).
In order to verify the superiority of the decomposition ability of the VMD–SSA algorithm, different intelligent optimization algorithms were selected to optimize the parameter combinations of VMD and compare their decomposition effects with the VMD–SSA algorithm. Among many traditional optimization algorithms, three optimization algorithms, the representative particle swarm optimization algorithm (PSO), gray wolf optimization algorithm (GWO), and whale optimization algorithm (WOA), were selected. The VMD decomposition of the same test signal was performed by the four optimization algorithms based on the same parameters set, and the differences in the optimization aspects of the four algorithms were finally compared. The optimal combination of parameters for each of the four optimization algorithms is listed in
Table 1.
The curve of the fitness value of the four optimization algorithms with the number of iterations is shown in
Figure 3. From the figure, it can be observed that the convergence values of the fitness functions of the different optimization algorithms vary, among which the best fitness value of the SSA algorithm is relatively the smallest among the four algorithms, converging at 2.1223.
Comparing the convergence speed of the four optimization algorithms from the convergence curves of the fitness values, it can be seen that PSO completes the global search the fastest, and the curve smooths out at the fifth iteration. However, the decomposition result of the VMD–PSO algorithm is the least satisfactory; it does not separate the noise component effectively, and its decomposition ability performs poorly compared with the other optimization algorithms. This is followed by SSA converging in the sixth generation, WOA converging in the eighth generation, and GWO converging in the eleventh generation. The decomposition results of the VMD–SSA algorithm have a single-center frequency for each component of the test signal and do not interfere with each other, and the useful signal components are well separated from the noise components, so the global search effect of the SSA algorithm optimizing the VMD parameter combination is the best.
3.3. Selection of Effective Components Based on the Number of Interrelationships
To extract the signal feature information more accurately, the interrelation number method was used to select the effective IMF components, and the amount of correlation information between two components was measured, which is more accurate compared with the traditional correlation coefficient selection method. To achieve the selection of effective IMF components, we found the number of interrelationships between each IMF component and the original signal after decomposition, calculated the threshold value by the formula, and compared each correlation coefficient with its threshold value to select the component greater than the threshold value as the effective component. The number of interrelationships and the threshold value are calculated as
where
is the maximum correlation coefficient,
is the IMF component,
is the original signal, and
and
are the mean values of the IMF component and the original signal, respectively.
3.4. SVD Algorithm
Sanliturk et al. introduced the Hankel matrix for SVD, and the results showed its ability to extract the effective signal from the noise to an acceptable degree [
26]. In its subsequent development and improvement, it gradually became widely used. The principle of SVD noise reduction is as follows: first, the original noisy signal is constructed into a Hankel matrix
H of order
; then, the SVD is used to decompose the matrix
H into singular values to obtain the singular value matrix of the signal
. Finally, the singular values corresponding to the noise are set to zero, and then the signal is reconstructed using the SVD inverse operation to obtain the noise-reduced signal.
The SVD decomposition of the Hankel matrix
H yields
where
is the singular value corresponding to the demarcation between the real signal and the noisy signal [
27]. In the SVD noise reduction process, the most critical step is to select the component matrices that match the characteristics of the original signal for reconstruction. Selecting fewer matrix components in the reconstruction process leads to serious distortion in the reconstructed signal, while selecting more matrix components results in too much noise in the reconstructed signal. In this paper, we use the singular value difference spectrum method to select the appropriate matrix components to reconstruct the noise-reduced signal.
3.5. VMD–SSA–SVD Noise Reduction Method
ECG signals are characterized by being nonstationary and low frequency, and having weak anti-interference ability. Additionally, the ECG signal itself is susceptible to noise interference generated by the human body or external environmental factors, among which the effect of baseline drift is especially obvious, as it causes difficulties in subsequent signal detection. Therefore, removing baseline drift and suppressing noise interference are the most critical steps in ECG signal preprocessing.
In this paper, the proposed noise reduction algorithm based on VMD–SSA–SVD was applied to real ECG signals from the MIT-BIH database. Firstly, the SSA algorithm was used to find the globally optimal combination of parameters [,] in the VMD; then, a series of IMF components were obtained by effectively decomposing the signal according to the VMD–SSA method, and the mean value of each IMF component was counted. Any IMF component with a mean value greater than a set threshold means that the component is associated with the baseline drift signal. The estimated baseline drift was extracted and directly removed from the original signal; then, the interrelationship between the original signal and each IMF component and the threshold value were calculated; the effective IMF component and the high-frequency noise component were discriminated based on the threshold value setting; the effective IMF component was retained; and the high-frequency noise component was rejected. Because the effective IMF components still contained a small amount of noise, the effective IMF components were further converted into Hankel matrices, and then the SVD noise reduction process was performed to determine the effective order based on the position of the maximum peak in the singular value difference spectrum to reconstruct the noise-reduced IMF components. The effective IMF components were reconstructed after the noise reduction process to finally obtain the noise-reduced ECG signal, achieving the baseline correction and random noise removal in the noisy ECG signal. In addition, the noise reduction performance of the algorithm proposed in this paper was compared with that of the wavelet packet decomposition algorithm, EMD algorithm, EEMD algorithm, and complete ensemble empirical mode decomposition with adaptive noise (CEEMDAN) algorithm, and the effectiveness and superiority of the algorithm in this paper were verified by the noise reduction effect graphs and evaluation indices of the five algorithms.
5. Conclusions
In this paper, the VMD–SSA–SVD-based denoising method was proposed and applied to the noise reduction of ECG signals to achieve the correction of baseline drift and the suppression of random noise interference. Firstly, VMD–SSA decomposition was performed on a noisy ECG signal to find the optimal combination of parameters, and the components containing baseline drift were selected from all IMF components after the decomposition and subtracted from the original signal. Then, the effective IMF components were selected from the remaining components. A Hankel matrix was constructed for each effective IMF component, and the SVD noise reduction process was performed separately. Three types of noisy ECG signals, namely simulated signals with simulated basis drift and simulated noise, simulated signals with real basis drift, and actual ECG signals, were used for validation, and the advantages and disadvantages of each noise reduction method were analyzed. The VMD–SSA–SVD has the highest SNR and the smallest MSE, and its denoising effect and signal fidelity are better than those of the other four methods, which shows its effectiveness, superiority, and strong adaptability in ECG signal denoising. Therefore, the proposed VMD–SSA–SVD-based denoising method can achieve the correction of baseline drift and the filtering of random noise interference simultaneously, while retaining the complete characteristics of the signal, which is a novel method for ECG signal noise reduction. Regarding future improvements, the optimization algorithm takes a slightly longer time for the global search of optimal parameter combinations, so the computing efficiency needs to be further improved. Additionally, the measured ECG signals of various patients in hospitals should be collected in large numbers so that the ECG signals of different patients with different characteristics can be selected as test signals to further verify the universality of the denoising method in the application of ECG signal denoising.