A method and apparatus for ecg signal adaptive threshold wavelet filtering
By optimizing the wavelet threshold parameter through autocorrelation function, the problem of wavelet threshold selection depending on noise estimation in traditional ECG signal denoising methods is solved, achieving efficient and accurate ECG signal filtering, which is suitable for practical detection.
Patent Information
- Application Number
- CN202310411642.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2043-04-18
AI Technical Summary
Traditional ECG signal denoising methods have shortcomings in terms of denoising effect and computational efficiency. In particular, the selection of wavelet threshold depends on noise estimation, which leads to the loss of useful signals or noise residue, making it difficult to effectively denoise in real-time applications.
The autocorrelation function is used to evaluate the wavelet filtering quality of one-dimensional electrocardiogram (ECG) signals. The filtering process of ECG signals is optimized by adaptively adjusting the wavelet threshold parameter. The optimal wavelet threshold is determined by signal estimation rather than noise estimation, taking advantage of the periodicity of ECG signals.
It achieves efficient optimization of wavelet threshold parameters without relying on a pure, noise-free reference signal, improving the signal-to-noise ratio of ECG signals, making it suitable for practical detection, reducing computational load, and retaining more useful information.
Smart Images

Figure CN116421194B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electrocardiogram signal processing, and particularly relates to an adaptive threshold wavelet filtering method and apparatus for electrocardiogram signals. Background Technology
[0002] Monitoring electrocardiograms (ECGs) and respiratory signals allows for the early prevention and clinical diagnosis of cardiovascular diseases such as cardiopulmonary sleep disorders, hypertension, and coronary heart disease (angina pectoris, myocardial infarction), as well as monitoring the progression of arrhythmias. However, traditional contact-based monitoring techniques not only hinder the daily lives of those being monitored but also reduce measurement accuracy. Therefore, several non-contact vital sign monitoring technologies have been developed to enable long-term monitoring of vital signs without irritating or damaging the skin, including cardiopulmonary bypass (BCG), Doppler electrocardiography (DCG), electrocardiography (ECG), and magnetocardiography (MCG). These biomedical and health signals are often overwhelmed by various noises, such as respiratory noise, limb movement noise, and power noise, rendering psychological characteristics unusable. Therefore, noise reduction should be implemented before further artificial or intelligent signal demodulation.
[0003] Cardiac pulse-time (BCG) is a multi-period non-smooth random signal that varies periodically with cardiac activity. Similar frequency components appear at different time points, and direct denoising using Empirical Mode Decomposition (EMD) fails to obtain the expected intrinsic mode functions from these signal components. More accurate and effective noise removal from ECG signals has been a research hotspot. Commonly used ECG denoising methods include bandpass filtering, weighted mean filtering, EMD, wavelet transform, neural networks, principal component analysis (PCA), independent component analysis (ICA), and adaptive dual thresholding. Each method has its own characteristics, advantages, and limitations in ECG signal filtering and denoising. Systems based on adaptive filtering and neural networks require additional reference signals and training phases, making them unsuitable for real-time applications. The statistical models of PCA and ICA are highly sensitive to small changes in the signal, limiting their long-term use. EMD suffers from high computational cost, mode confusion, and endpoint effects, resulting in significant noise in the reconstructed signal. Furthermore, EMD's overly strict dependence on intrinsic mode functions makes it unsuitable for practical applications, and the intrinsic mode functions often lead to a sharp decline in denoising performance. Wavelet thresholding denoising has advantages such as low computational cost and good filtering effect, but its denoising quality largely depends on the signal to be denoised and the selection of wavelet parameters. In particular, the wavelet threshold plays an important role in signal denoising; a large threshold may lead to the loss of useful signal data, while a small threshold will retain noisy data. Summary of the Invention
[0004] The purpose of this invention is to provide an adaptive threshold wavelet filtering method and apparatus for electrocardiogram (ECG) signals. The method evaluates the wavelet filtering quality of one-dimensional ECG signals using an autocorrelation function and further assesses the optimal wavelet threshold parameters, thereby achieving adaptive filtering of ECG signals simply and effectively.
[0005] This invention discloses an adaptive threshold wavelet filtering method for electrocardiogram (ECG) signals, applied to ECG signal measurement, comprising the following steps:
[0006] Step 1: Set the initial values and step size of the wavelet filtering parameters, which include the wavelet basis, the number of decomposition levels, the threshold function, and the wavelet threshold parameters.
[0007] Step 2: Adjust the wavelet threshold of each decomposition layer of the wavelet filter from the initial value according to the set step size. At the same time, calculate the autocorrelation function according to the fast algorithm of the autocorrelation function. After each filtering, record the autocorrelation value of the filtering result. When the autocorrelation value reaches the maximum value, record the corresponding wavelet threshold as the optimal wavelet threshold. The autocorrelation function is calculated from the sequence correlation of the denoised signal itself by utilizing the correlation and autocorrelation characteristics of adjacent time points of the electrocardiogram signal.
[0008] Step 3: Perform adaptive filtering of the electrocardiogram signal using the optimal wavelet threshold.
[0009] This invention provides an adaptive threshold wavelet filtering device for electrocardiogram (ECG) signals, applied to ECG signal measurement, comprising an initialization module, a filtering parameter threshold optimization module, and an adaptive filtering module;
[0010] The initialization module is used to set the initial values and step size of the wavelet filtering parameters, which include the wavelet basis, the number of decomposition layers, the threshold function, and the wavelet threshold parameters.
[0011] The filtering parameter threshold optimization module is used to adjust the wavelet threshold of each decomposition layer of the wavelet filter from the initial value according to a set step size. At the same time, it calculates the autocorrelation function according to a fast algorithm. After each filtering, it records the autocorrelation value of the filtering result. When the autocorrelation value reaches the maximum value, the corresponding wavelet threshold is recorded as the optimal wavelet threshold. The autocorrelation function is calculated from the sequence correlation of the denoised signal itself by utilizing the correlation and autocorrelation characteristics of adjacent time points of the electrocardiogram signal.
[0012] The adaptive filtering module is used to adaptively filter electrocardiogram signals using the optimal wavelet threshold.
[0013] The fast algorithm for the autocorrelation function specifically includes:
[0014] Step (1) Calculate the wavelet filtering result of the measured signal.
[0015] Based on the wavelet basis ψ, the noise signal is subjected to wavelet transform DWT. The binary algorithm is used to find the optimal wavelet threshold λ for each decomposition layer of the wavelet filter and shrink the wavelet coefficients as shown in formula (1):
[0016]
[0017] Among them, w j,k and w λ(i,j) These are the wavelet coefficients before and after wavelet thresholding, respectively.
[0018] The denoised signal is reconstructed using the inverse wavelet transform (IDWT) of the contracted wavelet coefficients to obtain the wavelet filtering result x. i ;
[0019] Step (2) Calculate the autocorrelation function, as shown in formula (2):
[0020]
[0021] Among them, the wavelet filtering result x i For a finite discrete signal, i = 1, 2, ..., N, where N is the signal length, j represents the time hysteresis, and its value range is j ∈ 1, 2, ..., (2N-1)-N. The asterisk indicates complex conjugate.
[0022] The calculation steps for finding the optimal wavelet threshold for each decomposition layer using the binary search algorithm include:
[0023] (1) Decompose the input noise signal into 8 layers using wavelet basis;
[0024] (2) Set wavelet threshold for the first decomposition layer And in wavelet threshold Wavelet thresholding with step size S on both sides
[0025] (3) Use each wavelet threshold Denoise the noisy signal;
[0026] (4) Calculate the wavelet threshold sequence The autocorrelation value FCL-ACF sequence corresponding to the denoised signal
[0027] (5) Find the maximum value of the autocorrelation value FCL-ACF sequence. and its corresponding wavelet threshold
[0028] (6) For the two wavelet thresholds Interpolation is performed on both sides, and then the wavelet threshold is applied. The initial half-step yields a new wavelet threshold sequence on both sides.
[0029] (7) Repeat steps (3) to (6) until the corresponding wavelet threshold is reached. With adjacent wavelet thresholds The difference is less than 10 -10 That is, for wavelet threshold sequences like but To determine the optimal wavelet threshold, record the current decomposition layer and its corresponding optimal wavelet threshold.
[0030] (8) Repeat steps (2) to (7) to find the optimal wavelet threshold for the next decomposition layer until the number of layers reaches 8.
[0031] This invention does not employ noise level estimation, but instead optimizes the wavelet threshold parameters of wavelet filtering by leveraging the sensitivity of the autocorrelation function to the signal. Utilizing the periodicity of electrocardiogram (ECG) signals, it evaluates the denoising effect by replacing noise estimation with signal estimation, and further assesses the optimal wavelet threshold parameters for each layer after wavelet filtering decomposition. This has the following technical effects or advantages:
[0032] 1. The wavelet threshold parameter can be optimized by calculating the autocorrelation function. The effect of wavelet filtering can be evaluated based solely on the autocorrelation of the ECG signal, without the need for a clean and noise-free reference signal. This allows for optimization of the wavelet threshold, making it more widely applicable and more suitable for use in actual testing.
[0033] 2. Compared to the traditional method of determining the optimal wavelet threshold by evaluating the signal-to-noise ratio, information entropy, or root mean square error of the wavelet denoising results, the algorithm of this invention only needs to calculate the correlation function of the ECG signal itself, which requires less computation. Combined with the acceleration algorithm proposed in this invention, the computational efficiency is even higher. Attached Figure Description
[0034] Figure 1(a) is a schematic diagram of a clean electrocardiogram signal in the prior art;
[0035] Figure 1(b) is a schematic diagram of the autocorrelation function corresponding to the clean electrocardiogram signal in Figure 1(a) in the prior art;
[0036] Figure 1(c) is a schematic diagram of the noisy electrocardiogram signal after adding noise to the clean electrocardiogram signal in Figure 1(a) in the prior art;
[0037] Figure 2 This is a graph showing the relationship between the autocorrelation function evaluation index and the signal-to-noise ratio in this invention;
[0038] Figure 3 This is a graph showing the relationship between the wavelet threshold and the autocorrelation function during the wavelet threshold parameter optimization process of this invention.
[0039] Figure 4 The flowchart below shows the specific process of the fast algorithm for optimizing wavelet thresholding in this invention.
[0040] Figure 5 This invention provides a comparison of threshold relationships between different decomposition levels obtained using different threshold processing methods.
[0041] Figure 6 This is a graph showing the relationship between the signal-to-noise ratio of the filtering results after obtaining different decomposition layer thresholds using different threshold processing methods.
[0042] Figure 7(a)-7(e) This is a graph showing the relationship between the actual electrocardiogram filtering effects obtained by different threshold processing methods at different decomposition levels.
[0043] Figure 8 This is a flowchart illustrating the method of Embodiment 1 of the present invention;
[0044] Figure 9 This is a schematic diagram of the device in Embodiment 2 of the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0046] Since noise itself is uncorrelated, while electrocardiogram (ECG) signals are correlated at adjacent time points, this invention provides an adaptive threshold wavelet filtering method and apparatus for ECG signals. Based on adaptive wavelet filtering of the autocorrelation function, the wavelet threshold parameters are optimized to improve the signal-to-noise ratio of the ECG signal. The filtering quality of the one-dimensional ECG signal is evaluated by the correlation function estimated by the signal rather than the noise, which can simply and effectively realize adaptive filtering of ECG signals.
[0047] The electrocardiogram signal in this embodiment of the invention is taken from the MIT-BIH arrhythmia database. The principle of wavelet denoising is to select a suitable threshold to obtain the wavelet coefficients after processing the wavelet transform. The denoising result is mainly determined by four parameters: wavelet basis, number of decomposition layers, threshold function and wavelet threshold. Since the signal is continuous in the time domain and the noise is random, the wavelet coefficients of the signal in the wavelet domain are usually greater than the wavelet coefficients of Gaussian white noise. Therefore, the wavelet coefficients of noise can usually be removed by various thresholding methods (such as general thresholding method, precise minimax thresholding method, deterministic thresholding method, cross-validation thresholding method, false detection rate thresholding method, Bayesian method, Ogden method, etc.). To calculate the wavelet filtering result of the measured signal, firstly, the wavelet transform DWT is performed on the noise signal based on the wavelet basis ψ, and the wavelet threshold λ of each decomposition layer is sought using the binary algorithm as a fast algorithm. The wavelet coefficients are shrunk as shown in formula (1):
[0048]
[0049] Among them, w j,k and ω λ(i,j) The wavelet coefficients before and after wavelet thresholding are respectively. The denoised signal is reconstructed using the inverse wavelet transform (IDWT) of the shrunken wavelet coefficients to obtain the wavelet filtering result x. i Choosing the appropriate wavelet threshold and decomposition level is crucial for wavelet denoising of electrocardiogram signals.
[0050] The autocorrelation function can be used to detect periodic signals and fabric texture, and can determine the optimal wavelet threshold. Figure 1(a) shows a clean electrocardiogram signal obtained from 109 records in the MIT-BIH arrhythmia database, whose autocorrelation function is calculated by equation (2):
[0051]
[0052] Where, x i (i = 1, 2, ..., N) is a finite discrete signal, N is the signal length, j represents the time hysteresis, and its value range is j∈1, 2, ..., (2N-1)-N. The asterisk indicates complex conjugate.
[0053] Figure 1(b) shows the autocorrelation function of a clean electrocardiogram signal. Since the autocorrelation function has the property of an even function, its function curve is symmetrical about the zero point. As the hysteresis j increases, the curve exhibits periodic changes. The magnitude of the first periodic peak point FCL-ACF that reappears after the zero peak is used as the evaluation index of the autocorrelation function, called the autocorrelation value, as shown by the asterisk position in the figure.
[0054] To investigate the relationship between the autocorrelation value (FCL-ACF) of a noise signal and the signal-to-noise ratio (SNR), Gaussian white noise was added to the clean signal, resulting in a noise signal with a SNR of 5 dB, as shown in Figure 1(c). The SNR and root mean square error (RMSE) were used to measure the denoising effect.
[0055]
[0056]
[0057] Where x(n) is the clean ECG and y(n) is the denoised ECG; as the signal-to-noise ratio (SNR) increases, the FCL-ACF gradually increases until it saturates, as shown below. Figure 2 As shown, the signal-to-noise ratio (SNR) of the denoised signal increases with the increase of the threshold, because a larger threshold can remove more noise. However, the SNR gradually decreases later because an excessively large threshold destroys some signal components. Since the autocorrelation value FCL-ACF is monotonically increasing with the SNR, FCL-ACF first increases and then decreases with the increase of the threshold. The largest FCL-ACF represents the highest SNR of the denoised signal, and the corresponding wavelet threshold is optimal. Therefore, the FCL-ACF can be used to evaluate the denoising effect, thereby improving the wavelet threshold. However, since the FCL-ACF saturates at both very low and high SNRs, theoretically only FCL-ACF with an SNR of -10 to 30 dB is suitable for the wavelet threshold query algorithm proposed in this invention. To achieve the maximum FCL-ACF, each wavelet threshold should be traversed. This requires a large amount of computation, especially for a high-precision wavelet threshold.
[0058] To save computation time, this invention proposes a binary search algorithm to find the autocorrelation value FCL-ACF and the corresponding optimal wavelet threshold, such as... Figure 3 As shown. The calculation steps for finding the optimal wavelet threshold for each decomposition layer using the binary search algorithm in this invention are as follows: Figure 4 As shown:
[0059] (1) Decompose the input noise signal into 8 layers using wavelet basis;
[0060] (2) Set wavelet threshold for the first decomposition layer And in wavelet threshold Wavelet thresholding with step size S on both sides
[0061] (3) Use each wavelet threshold Denoise the noisy signal;
[0062] (4) Calculate the wavelet threshold sequence The autocorrelation value FCL-ACF sequence corresponding to the denoised signal
[0063] (5) Find the maximum value of the autocorrelation value FCL-ACF sequence. and its corresponding wavelet threshold
[0064] (6) For the two wavelet thresholds Interpolation is performed on both sides, followed by wavelet thresholding. The initial half-step yields a new wavelet threshold sequence on both sides.
[0065] (7) Repeat steps (3) to (6) until the corresponding wavelet threshold is reached. With adjacent wavelet thresholds The difference is less than 10 -10 That is, for wavelet threshold sequences like but To determine the optimal wavelet threshold, record the current decomposition layer and its corresponding optimal wavelet threshold, such as... Figure 3 As shown;
[0066] (8) Repeat steps (2) to (7) to find the optimal wavelet threshold for the next decomposition layer until the number of layers reaches 8.
[0067] In this case, for each wavelet decomposition coefficient, only 79 binary search operations are needed to find the value with an accuracy of 10. -10 The optimal wavelet threshold.
[0068] To verify the accuracy of the autocorrelation function optimization results of this invention and its advantages over other existing methods, the specific optimization process was demonstrated through the following experiments. By comparing with the general thresholding methods (hard and soft thresholding) and local adaptive thresholding methods provided by MATLAB, the wavelet thresholding based on different decomposition levels of the autocorrelation function was verified. Figures 1(a) and 1(c) show a clean ECG signal and a noisy ECG signal with 5dB of added noise, respectively. Figure 5 The ACF thresholds obtained from the wavelet thresholding fast lookup algorithm for decomposition levels 1-8 are compared with those obtained from Matlab software using local adaptive, soft thresholding, and hard thresholding. ACF also employs two strategies: soft thresholding and hard thresholding. Soft universal thresholding and hard universal thresholding are fixed and therefore unaffected by increasing decomposition levels, while local thresholding and ACF thresholding vary with the number of levels. The signal-to-noise ratio (SNR) of the denoised signals obtained from these thresholds is compared to evaluate their performance. Figure 6As shown. When the decomposition levels are 1–3, the ACF threshold can achieve the same signal-to-noise ratio (SNR) as other thresholds, with the highest SNR being 5–8, although the ACF threshold is the lowest. This means that the ACF threshold is accurate for each decomposition level. The SNR obtained by local thresholding is consistent with that obtained by hard thresholding. Both local and hard thresholds are at their minimum. The SNR obtained by soft thresholding is between that of hard and soft thresholds. Although the values of the above thresholds are different, all thresholding methods achieve the same SNR at decomposition levels 1–3. Although local adaptive thresholding is used at different decomposition levels, the SNR of the signal after local thresholding is lower than that of soft thresholding at decomposition levels 4–8. Conversely, the ACF thresholding achieves the highest SNR, outperforming other thresholding methods. The SNR of local thresholding is the same as that of hard thresholding, both being at their minimum. The SNR obtained by soft thresholding is in the middle position. It is worth mentioning that the ACF threshold is zero at levels 6–8, which means that no noise or signal components are eliminated because the SNR reaches its maximum value. Meanwhile, by comparing ACF thresholding methods using different threshold functions, it can be seen that the threshold obtained by the ACF method using the hard threshold function gradually decreases and changes more smoothly from layers 4 to 8 compared to the soft threshold function, but the threshold is not zero at layer 8. Regarding the change in signal-to-noise ratio (SNR), the ACF method using the hard threshold gradually increases and tends to stabilize with the increase of the decomposition layer, while the ACF method using the soft threshold, although it also tends to stabilize after layers 5 to 8, shows a slight decrease in SNR at layer 5. Therefore, the ACF method using the hard threshold function has a better denoising effect.
[0069] The signals denoised using ACF with a soft threshold function, ACF with a hard threshold function, local adaptive denoising, soft thresholding, and hard thresholding are compared, as shown in Figure 7. The noise signal is decomposed according to different decomposition levels and shrunken using ACF thresholding, such as... Figure 7(a) and 7(b) As shown in the figure, the denoised signal becomes cleaner with increasing decomposition level (levels 1-4), and then remains essentially unchanged (levels 5-8). Figure 6 As shown Figure 7(a) and 7(b)In comparison, Figures 7(c), 7(d), and 7(e), which use local adaptive thresholding, soft thresholding, and hard thresholding respectively for denoising, show identical waveforms in the first three denoised signal layers due to the same signal-to-noise ratio. However, the waveforms of the denoised signals from layers 4 to 8 differ significantly. The amplitude of the denoised signal obtained by soft thresholding decreases significantly, and the results obtained by local and hard thresholding at layer 8 even lose almost all signal components. The reason for these differences is that traditional wavelet thresholding not only removes noise but also removes signal components as the decomposition level increases. In contrast, the adaptive ACF thresholding method can find an accurate threshold at each decomposition level, thus accurately distinguishing between signal and noise components. Figure 5 As shown, when the wavelet coefficients of layers 6 to 8 contain no noise components, the ACF threshold is 0.
[0070] By comparing the thresholds obtained by the adaptive thresholding algorithm and the traditional thresholding algorithm, the results show that the adaptive thresholding algorithm can find a more accurate threshold at each decomposition level, and its value has a higher signal-to-noise ratio than the filtering result obtained by the traditional method. This optimization method does not rely on noise level estimation, but evaluates from the perspective of signal intrinsic correlation. Combined with a fast algorithm, it can obtain more efficient and accurate threshold selection results.
[0071] Example 1
[0072] This embodiment provides an adaptive threshold wavelet filtering method for electrocardiogram (ECG) signals, applied to ECG signal measurement, such as... Figure 8 As shown, it includes:
[0073] Step 1: Set the initial values and step size of the wavelet filtering parameters, which include the wavelet basis, the number of decomposition levels, the threshold function, and the wavelet threshold parameters.
[0074] Step 2: Adjust the wavelet threshold of each layer of wavelet filtering from the initial value according to the set step size. At the same time, calculate the autocorrelation function according to the fast algorithm of the autocorrelation function. After each filtering, record the autocorrelation value of the filtering result. When the autocorrelation value reaches the maximum value, record the corresponding wavelet threshold as the optimal wavelet threshold. The autocorrelation function is calculated from the sequence correlation of the denoised signal itself by utilizing the correlation and autocorrelation characteristics of adjacent time points of the electrocardiogram signal.
[0075] Step 3: Perform adaptive filtering of the electrocardiogram signal using the optimal wavelet threshold.
[0076] The fast algorithm for the autocorrelation function can quickly select the range of wavelet threshold variation, reduce the number of times the autocorrelation function is calculated, and find the optimal wavelet threshold for the corresponding decomposition level more quickly.
[0077] Preferably, the fast algorithm for the autocorrelation function specifically includes:
[0078] Step (1) Calculate the wavelet filtering result of the measured signal.
[0079] First, the noise signal is subjected to wavelet transform (DWT) based on the wavelet basis ψ. The optimal wavelet threshold λ for each decomposition layer of the wavelet filter is then sought using a binary algorithm. The wavelet coefficients are then reduced as shown in formula (1).
[0080]
[0081] Among them, w j,k and w λ(i,j) These are the wavelet coefficients before and after wavelet thresholding, respectively.
[0082] The denoised signal is reconstructed using the inverse wavelet transform (IDWT) of the contracted wavelet coefficients to obtain the wavelet filtering result x. i ;
[0083] Step (2) Autocorrelation, also known as sequence correlation, is the cross-correlation between a signal and itself at different time points. Its autocorrelation function can be calculated by equation (2):
[0084]
[0085] Among them, the wavelet filtering result x i (i = 1, 2, ..., N) is a finite discrete signal, N is the signal length, j represents the time hysteresis, and its value range is j∈1, 2, ..., (2N-1)-N. The asterisk indicates complex conjugate.
[0086] Based on the same inventive concept, the present invention also provides an apparatus corresponding to the method of Embodiment 1, as detailed in Embodiment 2.
[0087] Example 2
[0088] This embodiment provides an adaptive threshold wavelet filter for electrocardiogram (ECG) signals, applied to ECG signal measurement, such as... Figure 9 As shown, it includes an initialization module, a filter parameter threshold optimization module, and an adaptive filtering module;
[0089] The initialization module is used to set the initial values and step size of the wavelet filtering parameters, which include the wavelet basis, the number of decomposition layers, the threshold function, and the wavelet threshold parameters.
[0090] The filtering parameter threshold optimization module is used to adjust the wavelet threshold of each decomposition layer of the wavelet filter from the initial value according to a set step size. At the same time, it calculates the autocorrelation function according to a fast algorithm. After each filtering, it records the autocorrelation value of the filtering result. When the autocorrelation value reaches the maximum value, the corresponding wavelet threshold is recorded as the optimal wavelet threshold. The autocorrelation function is calculated from the sequence correlation of the denoised signal itself by utilizing the correlation and autocorrelation characteristics of adjacent time points of the electrocardiogram signal.
[0091] The adaptive filtering module is used to adaptively filter electrocardiogram signals using the optimal wavelet threshold.
[0092] This invention selects the optimal wavelet threshold for wavelet filtering by calculating the autocorrelation function. The autocorrelation function method utilizes the periodic correlation between electrocardiogram signals to evaluate the filtering effect of wavelet filtering methods in the absence of a clean, noise-free reference signal, thereby optimizing the wavelet threshold parameters. Compared with traditional wavelet threshold estimation algorithms, the algorithm of this invention can better retain useful information while obtaining a higher signal-to-noise ratio. Combined with the fast algorithm proposed in this invention, the computational efficiency is higher and the threshold selection is more accurate, which can meet the needs of clinical applications.
[0093] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An adaptive threshold wavelet filtering method for electrocardiogram (ECG) signals, applied to ECG signal measurement, characterized in that... Includes the following steps: Step (1): Set the initial values and step size of the wavelet filtering parameters, which include the wavelet basis, the number of decomposition layers, the threshold function, and the wavelet threshold parameters. Step (2): Adjust the wavelet threshold of each decomposition layer of the wavelet filter from the initial value according to the set step size. At the same time, calculate the autocorrelation function according to the fast algorithm of the autocorrelation function. After each filtering, record the autocorrelation value of the filtering result. When the autocorrelation value reaches the maximum value, record the corresponding wavelet threshold as the optimal wavelet threshold. The autocorrelation function is calculated from the sequence correlation of the denoised signal itself by utilizing the correlation and autocorrelation characteristics of adjacent time points of the electrocardiogram signal. Step (3): Adaptive filtering of electrocardiogram signals using the optimal wavelet threshold; The fast algorithm for the autocorrelation function includes: Step (1) Calculate the wavelet filtering result of the measured signal. Based on wavelet basis The noisy signal is subjected to wavelet transform (DWT), and the optimal wavelet threshold λ for each decomposition layer of the wavelet filter is found using a binary search algorithm. The wavelet coefficients are then reduced as shown in formula (1): (1) in, and These are the wavelet coefficients before and after wavelet thresholding, respectively. The denoised signal is reconstructed using the inverse wavelet transform (IDWT) of the contracted wavelet coefficients to obtain the wavelet filtering result. ; Step (2) Calculate the autocorrelation function, as shown in formula (2): (2) Among them, wavelet filtering results For a finite discrete signal, i = 1, 2, ..., N, For signal length, Indicates time lag, and its range of values is... The asterisk indicates complex conjugation.
2. The adaptive threshold wavelet filtering method for electrocardiogram signals according to claim 1, characterized in that... The calculation steps for finding the optimal wavelet threshold for each decomposition layer using the binary search algorithm include: (1) Decompose the input noise signal into 8 layers using wavelet basis; (2) Set wavelet threshold for the first decomposition layer and at wavelet threshold Wavelet thresholding with step size S on both sides ( , ); (3) Use each wavelet threshold ( , , Denoise the noise signal; (4) Calculate the wavelet threshold sequence ( , , The corresponding autocorrelation value FCL-ACF sequence of the denoised signal () , , ); (5) Find the maximum value of the autocorrelation value FCL-ACF sequence. and its corresponding wavelet threshold ; (6) For the two wavelet thresholds ( , Interpolation is performed on both sides, and then the wavelet threshold is applied. The initial half-step yields a new wavelet threshold sequence on both sides. , , , , ); (7) Repeat steps (3) to (6) until the corresponding wavelet threshold is reached. With adjacent wavelet thresholds The difference is less than 10 10 That is, for wavelet threshold sequences ( , , , , , , , , ),like ,but To determine the optimal wavelet threshold, record the current decomposition layer and its corresponding optimal wavelet threshold. (8) Repeat steps (2) to (7) to find the optimal wavelet threshold for the next decomposition layer until the number of layers reaches 8.
3. An adaptive threshold wavelet filtering device for electrocardiogram (ECG) signals, applied to ECG signal measurement, characterized in that: It includes an initialization module, a filter parameter threshold optimization module, and an adaptive filtering module; The initialization module is used to set the initial values and step size of the wavelet filtering parameters, which include the wavelet basis, the number of decomposition layers, the threshold function, and the wavelet threshold parameters. The filtering parameter threshold optimization module is used to adjust the wavelet threshold of each decomposition layer of the wavelet filter from the initial value according to a set step size. At the same time, it calculates the autocorrelation function according to a fast algorithm. After each filtering, it records the autocorrelation value of the filtering result. When the autocorrelation value reaches the maximum value, the corresponding wavelet threshold is recorded as the optimal wavelet threshold. The autocorrelation function is calculated from the sequence correlation of the denoised signal itself by utilizing the correlation and autocorrelation characteristics of adjacent time points of the electrocardiogram signal. The adaptive filtering module is used to adaptively filter electrocardiogram signals using the optimal wavelet threshold. The fast algorithm for the autocorrelation function includes: Step (1) Calculate the wavelet filtering result of the measured signal. Based on wavelet basis The noisy signal is subjected to wavelet transform (DWT), and the optimal wavelet threshold λ for each decomposition layer of the wavelet filter is found using a binary search algorithm. The wavelet coefficients are then reduced as shown in formula (1): (1) in, and These are the wavelet coefficients before and after wavelet thresholding, respectively. The denoised signal is reconstructed using the inverse wavelet transform (IDWT) of the contracted wavelet coefficients to obtain the wavelet filtering result. ; Step (2) Calculate the autocorrelation function, as shown in formula (2): (2) Among them, wavelet filtering results For a finite discrete signal, i = 1, 2, ..., N, For signal length, Indicates time lag, and its range of values is... The asterisk indicates complex conjugation.
4. The adaptive threshold wavelet filter for electrocardiogram signals according to claim 3, characterized in that, The calculation steps for finding the optimal wavelet threshold for each decomposition layer using the binary search algorithm include: (1) Decompose the input noise signal into 8 layers using wavelet basis; (2) Set wavelet threshold for the first decomposition layer and at wavelet threshold Wavelet thresholding with step size S on both sides ( , ); (3) Use each wavelet threshold ( , , Denoise the noise signal; (4) Calculate the wavelet threshold sequence ( , , The corresponding autocorrelation value FCL-ACF sequence of the denoised signal () , , ); (5) Find the maximum value of the autocorrelation value FCL-ACF sequence. and its corresponding wavelet threshold ; (6) For the two wavelet thresholds ( , Interpolation is performed on both sides, and then the wavelet threshold is applied. The initial half-step yields a new wavelet threshold sequence on both sides. , , , , ); (7) Repeat steps (3) to (6) until the corresponding wavelet threshold is reached. With adjacent wavelet thresholds The difference is less than 10 10 That is, for wavelet threshold sequences ( , , , , , , , , ),like ,but To determine the optimal wavelet threshold, record the current decomposition layer and its corresponding optimal wavelet threshold. (8) Repeat steps (2) to (7) to find the optimal wavelet threshold for the next decomposition layer until the number of layers reaches 8.
