Abstract
The frequency characteristics of wavelets and the vanishing moments of wavelet filters are both important parameters of wavelets. Clarifying the relationship between the wavelet frequency characteristics and the vanishing moments of the wavelet filter can provide a theoretical basis for selecting the best wavelet. In this paper, the frequency characteristics of wavelets were analyzed by mathematical modeling, the mathematical relationship between wavelet frequency characteristics and vanishing moments was clarified, the optimal wavelet base function was selected hierarchically according to the amplitude frequency characteristics of ECG signal, and an accurate notch filter was realized according to the frequency characteristics of the noise. The experimental results showed that the optimal orthogonal wavelet analysis for the ECG signals with different frequency characteristics could make the high frequency energy distribution sparser, and the method proposed in this paper could effectively preserve the singularity of the signal and reduce the signal distortion.
Introduction
Electrocardiogram (ECG) signals collected from the surface of the human body inevitably contain noise, such as from EMG interference and power frequency interference. Removal of this noise is required for further analysis of ECG signals. At present, digital filtering algorithms used with ECG mainly include EMD decomposition, wavelet transform, and other methods. In ref. 1, Sharmila and P. Geethanjali proposed an adaptive ECG signal denoising method2. Ensemble empirical mode decomposition (EEMD) and a threshold-based genetic algorithm (GA) are used to remove mixed noise by using a similarity measurement method based on a probability density function. The experimental results in this paper show that this method has certain advantages, however, adaptive threshold estimates are based on probability and statistics and, therefore, contain not only the complexity of the calculation but also the uncertainty of the results. Reference 3 proposes an IMF threshold technique based on GAs. The experimental results show that this method is superior to the traditional method based on EMD noise reduction. In ref. 4, an ECG signal enhancement technique is proposed for the elimination of noise components. By eliminating ECG signal noise in the time domain, the signal-to-noise ratio (SNR) can be improved while maintaining a lower RMSE (root mean square error). The methods discussed in refs 3 and 4 do not consider the characteristics of the signal itself, so it is possible to eliminate singular points in the signal while denoising. The EMD-based algorithm has some limitations, and its practical application is limited. At present, wavelet transform is widely used in biomedical engineering. Reference 5 proposes a method for extraction of ECG signals based on wavelet analysis. Firstly, CWT (continuous wavelet transform) is performed on signals obtained from human abdomen and chest regions, and the decomposition coefficient is processed by an LMS algorithm. The correlation of the processed wavelet coefficient is then calculated. Experimental results show that this method is superior to the EMD algorithm in noise immunity. However, there is no further discussion on how to choose the wavelet basis function and how to deal with it hierarchically. In recent literature, the main methods of dealing with physiologically-based digital signals are the classical wavelet transform and lifting format wavelet transform. However, most of the methods using wavelet transform involve specific parameters and features of wavelets, e.g., wavelet vanishing moments, wavelet support length, etc. The types of wavelet basis used, as well as other parameters, are mainly determined by experience and experiment, and there is a lack of systematic theoretical analysis. Based on the analysis of vanishing moment and frequency characteristics of the wavelet filter, this paper analyze how to select and use the appropriate wavelet basis function and how to filter the noise of the specific frequency characteristic in the process of wavelet transform6.
Wavelet vanishing moments and optimal wavelet basis selection
For ECG signal analysis and processing by wavelet transform, there are several purposes: denoising, feature detection, and data compression. Whatever the purpose, it is hoped that, after the wavelet decomposition of the ECG signal, the signal energy can achieve the maximum concentration in low-pass components, and the energy of high-pass components can achieve maximum thinning7. According to the current literature, under the premise of not considering the computational complexity of wavelet transform, it is generally thought that the higher vanishing moment of the wavelet can produce a better effect8. Some other articles contend that the effect of high-pass component thinning and the shape of the wavelet scale function are related to the similarity of the shape of the signal9, 10. This paper provides an in-depth study on this issue and offers an answer.
Wavelet vanishing moment and filter amplitude-frequency characteristics
For any N, there are 2N non-zero real-scale coefficients , which can constitute a [0, 2N−1] scale function and wavelet function. With an appropriate choice of these coefficients, the 2N−1 order polynomial can be written as: , where Q(z) is the N−1 order polynomial, and Q(−1) ≠ 0. H N(z) is the N-order vanishing moment, and is subject to Taylor expansion at z = −1:
1 |
At i < N, , the above formula can be expressed as:
2 |
The Fourier transform is a special case of the Laplace transform in imaginary axis s = jΩ, and thus is mapped as a unit circle in the Z-plane. The Z-transform of the sequence H on the unit circle is equal to the ideal Fourier transform of the sampled signal10, 11. Let the digital frequency (ω) be the parameter of the unit circle in the Z-plane. Ω is the angle of the Z-plane, denoted as . Then,
3 |
For the orthogonal wavelet, the perfect reconstruction satisfies:
4 |
Therefore:
5 |
Theorem 1
: The order of the vanishing moment of an orthogonal wavelet is proportional to its corresponding filter order.
Proof
: For , take the first derivative, resulting in the rate of change with :
6 |
Similarly,
7 |
In the transition band of the high-pass filter, the approximation of is equal to 1, so the filter slope at the edge of the transition band is: . This shows that the larger the vanishing moment, the steeper the slope of the edge in the transition band of the corresponding filter, and the higher the order of the filter Figure 1 shows the amplitude-frequency characteristics of orthogonal wavelet high-pass filters with vanishing moments of 2, 4, 6, 8, 10, and 12.
Selection of wavelet for ECG signal processing
It can be deduced from the above cases that the low and high frequency energies after wavelet transform are related to the frequency characteristics of the signal and also to the vanishing moments of the wavelet. For a signal whose frequency is stable, there must be a wavelet with a vanishing moment of N, so that the high-frequency energy after the wavelet transformation is the lowest12, 13. Therefore, the following theorem can be introduced:
Theorem 2
: The signal f(x) is a periodic signal with stable frequency characteristics. For a wavelet series W with order vanishing moments from N1 to N2, there exists a unique wavelet Wk (vanishing moment k: N1kN2) such that its energy is minimized after wavelet transform.
Proof
: According to the Mallat principle, let x j(k), d j(k) be a discrete approximation coefficient in multiresolution analysis where h 0(k), h 1(k) are two filters that satisfy the orthonormal two-scale difference equation. Then, for X j(k), d j(k), there are recursive relations as follows:
8 |
If , then, in accordance with the Fourier convolution theorem:
9 |
Also, according to the Parseval theorem, the following equation exists:
10 |
At x(n) = h(n),
11 |
Therefore,
12 |
At ,
13 |
At , H(ω) = 0; at , ; therefore,
14 |
Let
, ; with the necessary conditions for extreme values with the function, we get,
15 |
Obviously, at , there is a sole linear solution:
16 |
In general, for the signal processing, there are minimum requirements on the order of the vanishing moments in the filter14. The reason being that, the lower the vanishing moments, the more signal detail is lost during processing and the greater the distortion. If the lower limit of the vanishing moments is given, it can be understood from Theorem 2 that for a given a signal and set of wavelets with given frequency characteristics, there must be an optimal wavelet for minimizing the energy contained in the processed high-pass component. This facilitates the subsequent filtering process and the signal compression process. Real-time ECG signal Fourier transform is as shown in Fig. 2a, and we can clearly find the corresponding frequency characteristics, as shown in Fig. 2b.
The real-time ECG signals are decomposed by four-order, six-order, eight-order and ten-order orthogonal filters, respectively, and the corresponding high-pass components are shown in Figs 3b,d and 4b,d. As shown in Table 1, the energy of the decomposed high-pass signal is smallest when the wavelet vanishing moment N = 6. It can be seen that the orthogonal wavelet with the vanishing moment N = 6 is the best choice when the first layer is decomposed.
Table 1.
DBN | DB4 | DB6 | DB8 | DB10 |
---|---|---|---|---|
0.316127 | 0.171010 | 0.203272 | 0.227824 |
According to Theorem 2, prior to the processing of the ECG signal, an optimal wavelet should be selected to achieve filtering. There should be a complete wavelet set, where the wavelet should have a lowest vanishing moment such as four-order, until the fast wavelet transform can support up to the highest order, such as 24-order. If the vanishing moment is too low, then it will affect the accuracy of signal processing; if the vanishing moment is too high, the calculation will be too complex15. The high-frequency filter bank of each wavelet is extended by zero-padding (length Γ), and then Fourier-transformed. The typical 2-cycle ECG signal (length Γ) is taken as a sample, and is Fourier-transformed. According to Formula (12), the total energy of the high-pass component corresponding to the vanishing moment wavelet is obtained, and then the wavelet with the smallest energy is selected as the optimal choice.
Hierarchical processing in ECG signal wavelet transform
A filter with a different vanishing moment is selected according to the frequency characteristics of the signal in each layer
After a layer of wavelet is decomposed, low-pass components enter a new layer of wavelet transform. In this wavelet decomposition, should the original filter or the more matched filter for processing be used? It is clear that the sampling frequency is reduced by a factor of two, and so is the frequency of the signal after the bisectional extraction. However, since the processed signal contains only the low-pass portion of the original signal, there is a significant difference in the spectral distribution between layers j + 1 and j. In order to let the high-frequency components contain less energy, we should reselect an optimally matched filter for processing. Figure 5b shows the frequency characteristics of the original signal. Figure 5d shows frequency characteristics of low-frequency signals after wavelet decomposition.
As can be seen from Fig. 5, there is a clear difference between the original and filtered frequency distributions. In this paper, the decomposed low-pass signals are re-decomposed through the filter with vanishing moments of 4, 6, 8, and 10. The high-pass components after such decomposition are shown in Fig. 6a,b,c and d, respectively. It can be seen that there is a significant difference. At N = 4, the total energy of the decomposed high-pass component is the smallest (the specific data are shown in Table 2). This indicates that, in the wavelet transform process, it is necessary to choose wavelets with different vanishing moments to deal with the different levels of wavelet transform, so as to realize the optimization of energy distribution. In general, for the first and second layers, different filter banks should be used and the rest of the layers can be determined according to need.
Table 2.
DBN | DB4 | DB6 | DB8 | DB10 |
---|---|---|---|---|
1.841969 | 2.00026 | 1.965258 | 1.862453 |
Wavelet transform to remove power frequency interference
One of the main sources of noise is 50 Hz frequency interference, which is generally removed prior to further signal analysis and processing. If using Fourier-transform for the mathematical signal processing, this problem can easily be addressed by setting the corresponding frequency component to 0. However, the problem of how to use wavelet transform for frequency notching has not been discussed in the literature. The general practice is to set the threshold for high-frequency components for filtering, but the desired accuracy of the results is difficult to achieve16, 17.
If the wavelet transform is made for signal f (x) with sampling frequency P0, then the high-pass component will contain the frequency component from and the low-pass component will contain frequency components: between high-pass filter and low-pass filter , there are two intersection points in the region [0, 2π]: . These two points are also a transition area from low frequency to high frequency. From the Fourier convolution theorem, we can see that the effect of G(ω), H(ω) on the signal is equivalent to the transfer function in the analysis of the filter circuit. In the following, we further analyze the suppression factor of the signal at these two critical points:
= = ; For ; so . Apparently, . Therefore: . Obviously, this is a function of N featuring faster convergence. For example, at N = 4, ; at N = 6, . For any given positive ε close to 0, N0 is always present, such that:
17 |
So, when the appropriate vanishing moment (N) is taken, it is possible to make the suppression factor of the critical point infinitely small, so that the gain of the signal outside the region of this point is close to zero, theoretically equivalent to the truncated state.
Let the sampling frequency of the signal at P0, which contains the noise at the frequency of . Suppose that the frequency tolerated in denoising through notching is: , where ΔP is the frequency bandwidth increment. After a wavelet transform, the high-pass component contains the frequency component from ; and the low-pass component contains . If this time the band of the high-pass component is wide, and if this part of the signal is removed by setting at zero, then, undoubtedly, the effective frequency will be removed; or if there is a cutoff according to the threshold, noise will not be filtered completely. Both of these conditions can cause signal distortion. It is clear that the high-frequency component can be continuously decomposed by the wavelet, and the band of the high-frequency component is further narrowed and gradually approximated to . Obviously, the higher the order of the filter used for the notch processing, the smaller the overlapping region of high-pass and low-pass frequencies, the steeper the filter frequency curve, and the more concentrated the energy18.
In order to facilitate the calculation, this paper uses the normalized frequency as the unit. The normalized frequency R of the actual frequency P t in the frequency interval [P 1, P 2] is defined as follows:
18 |
Any frequency range [P 1, P 2] can be expressed as a real number domain [0, 1] after the normalized processing. It can be known from Shannon’s Theorem that the sampling frequency should be no less than twice of the maximum frequency in analog signal spectrum. So the normalized frequency R should be in the range of [0, 0.5] when the sampling signal is directly filtered and [0, 1] for the second layer and above filtration.
Theorem 3
, Let the range of normalized frequency of Signal S is [0, P t], for normalized frequency , if Then the signal of the frequency interval D can be extracted by band-pass filtering from [P 1, P 2] by N wavelet transform.
Proof
: Perform a wavelet transform on Signal S, SD represents the transformed low-pass component, and SH represents the transformed high-pass component; the following operations can be carried out as discussed above:
If , it indicates , and returns the result D H, and the algorithm ends.
If P s < 0.25, it indicates , and needs to perform a wavelet transform on Signal SD. . Repeat the algorithm.
If , it indicates , and needs to perform a wavelet transform on Signal s D. . Repeat the algorithm.
As shown in Fig. 7, the ECG signal has high frequency noise with a normalized frequency Freq = 0.4. Since 0.25 < Freq < 0.75, the noise is distributed in the high frequency component. The high-pass component is set to zero to complete band-pass denoising, and the effect is shown in Fig. 8a. Because the bandwidth of denoising is [0.25, 0.75], many signal details are lost. The frequency characteristics of the denoised signal are shown in Fig. 8b. The component of the signal frequency is basically zero in [0.25, 0.75].
Therefore, there is a need for secondary filtering to implement band-pass denoising: the high-pass component after the first filtering is decomposed by the wavelet; then, the low-pass component after the secondary decomposition contains the bandwidth [0.25, 0.40] and the high-pass component contains the bandwidth [0.375, 0.500]. So, this part of the high-pass component is set to 0 to complete filtering. Afterwards, the two-part signal is recombined into the detail signal of the first layer, as shown in Fig. 9. The final filtering effect is shown in Fig. 8b. If ΔP = 0.100; the notching can be implemented in a very narrow area, thus preserving some of the key details of the high frequency signal.
Experimental result
Based on the above discussion, the two key steps of the wavelet-based denoising algorithm proposed in this paper are as follows: First, the amplitude-frequency characteristic of the ECG signal is analyzed to determine the wavelet loss moment order, and on this basis, the optimal wavelet basis function is selected for different levels of wavelet decomposition. Second, by analyzing the noise frequency characteristics, determining the level and coefficient of band-pass filter, so as to realize the fixed-point removal of noise in the process of wavelet decomposition. Ten sampling records (data of the first 10 minutes for each record) are selected from ECG ID database for a contrast experiment. The adaptive genetic algorithm based on EEMD (Genetic EEMD), the adaptive threshold denoising algorithm based on discrete wavelet transform (Threshold DWT) and the wavelet denoising algorithm which is optimized by this paper (Proposed DWT) are applied for filtering processing. The filtering effect is evaluated from the aspects of filtering time consumption, denoising effect, signal loss and so on. To explain the effective energy loss procedure after signal denoising, mean squared error (MSE) was used to explain the difference between the denoised signal and the original signal. The smaller the MSE, the smaller the signal loss, the better the signal reduction effect. NSR (Noise Suppression Ratio) is defined to reflect the noise suppression effect. The smaller NSR is, the better the denoising effect achieved16.
18 |
19 |
From the experimental results shown in Table 3, the Proposed DWT algorithm is significantly superior to the other two representative denoising algorithms in terms of MSE, NSR and TIME. For the denoising effect, Proposed DWT has especially obvious advantages compared with Threshold DWT. For the CPU time consumption, the optimistic algorithms save half the time of Genetic EEMD. Figure 10 illustrates the comparison of the results after denoising of the first 10 seconds of data recorded by Person_01/rec_1.
Table 3.
Threshold DWT | Genetic EEMD | Proposed DWT | |||||||
---|---|---|---|---|---|---|---|---|---|
MSE | NSR | TIME(us) | MSE | NSR | TIME | MSE | NSR | TIME | |
Person_01/rec_1 | 0.116 | 0.101 | 48.2 | 0.087 | 0.073 | 78.1 | 0.067 | 0.051 | 37.9 |
Person_02/rec_1 | 0.117 | 0.102 | 48.1 | 0.077 | 0.064 | 78.2 | 0.067 | 0.057 | 37.5 |
Person_03/rec_1 | 0.116 | 0.101 | 48.3 | 0.097 | 0.082 | 78.2 | 0.087 | 0.069 | 38.6 |
Person_04/rec_1 | 0.117 | 0.103 | 48.2 | 0.077 | 0.073 | 78.1 | 0.087 | 0.065 | 39.6 |
Person_05/rec_1 | 0.115 | 0.102 | 48.1 | 0.087 | 0.089 | 78.3 | 0.077 | 0.073 | 37.4 |
Person_06/rec_1 | 0.116 | 0.101 | 48.2 | 0.077 | 0.079 | 78.2 | 0.087 | 0.065 | 39.7 |
Person_07/rec_1 | 0.117 | 0.101 | 48.3 | 0.077 | 0.068 | 78.1 | 0.067 | 0.059 | 37.9 |
Person_08/rec_1 | 0.116 | 0.103 | 48.2 | 0.097 | 0.097 | 78.1 | 0.077 | 0.082 | 36.4 |
Person_09/rec_1 | 0.115 | 0.101 | 48.3 | 0.077 | 0.085 | 78.3 | 0.067 | 0.078 | 37.6 |
Person_010/rec_1 | 0.116 | 0.103 | 48.1 | 0.097 | 0.077 | 78.2 | 0.077 | 0.069 | 38.5 |
average | 0.1161 | 0.1018 | 48.2 | 0.085 | 0.0787 | 78.18 | 0.076 | 0.0668 | 38.11 |
Conclusion
Although a classic method of processing an ECG signal is by using wavelet transform, there is still much confusion about ECG signal processing with wavelet. For example, on the premise that wavelet supporting width can be tolerated, is it true that the larger the order number of the vanishing moment, the more concentrated the energy generated when the signal is decomposed by the wavelet? How can we realize the precise filtering of ECG signal by wavelet transform and keep the singular point in the signal? In this paper, a quantitative analysis was performed to study the correlation between the vanishing moment and frequency characteristics of the wavelet, an optimal wavelet base function was selected based on the amplitude frequency characteristics of ECG signals, and wavelet bases of different orders were used to deal with different wavelet spaces. We also found that the accurate bandpass filtering could be realized in the process of wavelet transform according to the different frequency characteristics of noise, which effectively avoided the damage to the signal during the denoising process. Experimental results showed that the proposed wavelet transform with optimized parameters had a remarkable effect on ECG signal denoising and has a strong practical significance, including the ECG monitoring watch developed by myself.
Acknowledgements
This research was supported by National Natural Science Foundation of China (61632009, 61472451, 61462006), Natural Science Foundation of Hunan Province (2017JJ5038), Guangxi Natural Science Foundation(2014GXNSFAA118391).
Author Contributions
Z.P. and G.W. conceived and designed the experiments, Z.P. performed the experiments, G.W. analyzed the data and contributed analysis tools. Z.P. Wrote and Edited the main manuscript text, All authors reviewed the manuscript.
Competing Interests
The authors declare that they have no competing interests.
Footnotes
Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
- 1.Sharmila, Geethanjali P. Detection of Epileptic Seizure from Electroencephalogram Signals Based on Feature Ranking and Best Feature Subset Using Mutual Information Estimation. J. Med. Imaging Health Inf. 2016;6:1850–1864. doi: 10.1166/jmihi.2016.1938. [DOI] [Google Scholar]
- 2.Phuong N, Kim JM. Adaptive ECG denoising using genetic algorithm-based thresholding and ensemble empirical mode decomposition. Information Science. 2016;373:499–511. doi: 10.1016/j.ins.2016.09.033. [DOI] [Google Scholar]
- 3.Samit A, Manab KD, Anil C. ECG signal enhancement using S-Transform. Computers in Biology and Medicine. 2013;43:649–666. doi: 10.1016/j.compbiomed.2013.02.015. [DOI] [PubMed] [Google Scholar]
- 4.Wu SC, Shen Y, Zhou Z, et al. Research of fetal ECG extraction using wavelet analysis and adaptive filtering. Computers in Biology and Medicine. 2013;43:1622–1627. doi: 10.1016/j.compbiomed.2013.07.028. [DOI] [PubMed] [Google Scholar]
- 5.Wang Z, Wan F, Wong CM, Zhang M. Adaptive Fourier decomposition based ECG denoising. Computers in Biology and Medicine. 2016;77:195–205. doi: 10.1016/j.compbiomed.2016.08.013. [DOI] [PubMed] [Google Scholar]
- 6.Rajendra U, Hamido F, Muhammad A, et al. Automated characterization and classification of coronary artery disease and myocardial infarction by decomposition of ECG signals: A comparative study. Information Sciences. 2017;377:17–29. doi: 10.1016/j.ins.2016.10.013. [DOI] [Google Scholar]
- 7.Satish B, Ranga K, et al. Classification of atrial fibrillation episodes from sparse electrocardiogram data. Journal of Electrocardiology. 2008;41:292–299. doi: 10.1016/j.jelectrocard.2008.01.004. [DOI] [PubMed] [Google Scholar]
- 8.Galiano G, Velasco J. Rearranged nonlocal filters for signal denoising. Mathematics and Computers in Simulation. 2015;118:213–223. doi: 10.1016/j.matcom.2014.11.020. [DOI] [Google Scholar]
- 9.Galiano G, Velasco J. On a nonlocal spectrogram for denoising one-dimensional signals. Applied Mathematics and Computation. 2014;244:859–869. doi: 10.1016/j.amc.2014.07.003. [DOI] [Google Scholar]
- 10.Anton A, Gottfried M, Strohmenger HU. N(a)-histogram analysis of the ventricular brillation ECG-signal as predictor of countershock success. Chaos, Solitons and Fractals. 2000;11:1205–1212. doi: 10.1016/S0960-0779(99)00028-4. [DOI] [Google Scholar]
- 11.Marian G, Claudia G, William B. Deterministic models for simulating electrocardiographic signals. Commun Nonlinear Sci Numer Simulat. 2011;16:3871–3880. doi: 10.1016/j.cnsns.2011.01.022. [DOI] [Google Scholar]
- 12.Mohammad N, Hanna B, Bertrand R, Christian J, PierreComon B. sourceseparationofunderdeterminedmixtures of event-relatedsources. Signal Processing. 2014;101:52–64. doi: 10.1016/j.sigpro.2014.01.031. [DOI] [Google Scholar]
- 13.Peng X, Yao D. A novel method based on realistic head model for EEG denoising. computer methods and programs in biomedicine. 2006;83:104–110. doi: 10.1016/j.cmpb.2006.06.002. [DOI] [PubMed] [Google Scholar]
- 14.Mariyappa N, Sengottuvel S, Rajesh PC, Parasakthi K, et al. Denoising of multichannel MCG data by the combination of EEMD and ICA and its effect on the pseudo current density maps. Biomedical Signal Processing and Control. 2015;18:204–213. doi: 10.1016/j.bspc.2014.12.012. [DOI] [Google Scholar]
- 15.Abdulhay E, Khnouf R, Bakeir A, Razan A, Heba K. Electromyogram Pattern Recognition for Real-Time Control of Upper Limb Prosthesis. J. Med. Imaging Health Inf. 2016;6:1872–1880. doi: 10.1166/jmihi.2016.1940. [DOI] [Google Scholar]
- 16.Bairy GM, Bhat S, et al. Automated Classification of Depression Electroencephalographic Signals Using Discrete Cosine Transform and Nonlinear Dynamics. J. Med. Imaging Health Inf. 2015;5:635–640. doi: 10.1166/jmihi.2015.1418. [DOI] [Google Scholar]
- 17.Lahmiri S, Boukadoum M. A weighted bio-signal denoising approach using empirical mode decomposition. Biomedical Engineering Letters. 2015;5(2):131–139. doi: 10.1007/s13534-015-0182-2. [DOI] [Google Scholar]
- 18.Lahmiri S. A Comparative study of ECG signal denoising by wavelet thresholding in empirical and variational mode decomposition domains. IET Healthcare Technology Letters. 2014;1(3):104–109. doi: 10.1049/htl.2014.0073. [DOI] [PMC free article] [PubMed] [Google Scholar]