A method for removing myoelectric noise from electrocardiogram signals based on singular value decomposition

Through the method of singular value decomposition and trajectory matrix construction, the periodic nature of the ECG signal is used to remove the EMG noise, which solves the problem of difficulty in removing the EMG noise in the ECG signal in the existing technology, and achieves stronger noise reduction effect and Higher signal-to-noise ratio.

CN115251947BInactive Publication Date: 2024-09-10SICHUAN UNIV
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202210730311.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2024-09-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively remove the electromyographic noise in the ECG signal, especially in sports scenes where the signal-to-noise ratio is high, and fails to fully utilize the quasi-periodic nature of the ECG signal, resulting in poor noise reduction effects.

Method used

A method based on singular value decomposition is used to extract the main waveform features of the ECG signal by constructing a trajectory matrix and singular value decomposition. The periodic nature of the ECG signal is used to remove the EMG noise and improve the signal-to-noise ratio and signal quality before and after filtering.

Benefits of technology

It achieves effective myoelectric noise removal under different noise levels, improves the output signal-to-noise ratio and signal quality, reduces the root mean square error, avoids signal distortion, and is suitable for high signal-to-noise ratio situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115251947B
    Figure CN115251947B
Patent Text Reader

Abstract

The present invention discloses a method for removing myoelectric noise in an electrocardiogram signal based on singular value decomposition, which specifically includes the following steps: S1, synthesizing noisy electrocardiogram signals: the synthesized noise signals are mainly used to verify the effectiveness of the algorithm and evaluate the noise reduction effect, and use clean electrocardiogram signals and myoelectric noise to superimpose simulated noise signals with different degrees of pollution at different amplification factors; S2, finding the QRS wave of the electrocardiogram signal: finding the QRS wave of the electrocardiogram signal to extract the main features of the electrocardiogram signal, and the electrocardiogram signal includes P wave, T wave, QRS wave, etc. The present invention relates to the technical field of electrocardiogram signal noise reduction. Compared with the traditional noise reduction method, the method for removing myoelectric noise in an electrocardiogram signal based on singular value decomposition has a strong noise reduction effect when the electrocardiogram signal is seriously polluted by noise. Its output signal-to-noise ratio and noise improvement are higher than those of the wavelet transform threshold method and the bandpass filter, which represents a stronger noise reduction ability. At the same time, the root mean square error is smaller than that of the traditional method, indicating that its distortion is smaller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electrocardiogram signal noise reduction, and in particular to a method for removing myoelectric noise in electrocardiogram signals based on singular value decomposition. Background Art

[0002] At present, cardiovascular disease has become one of the most serious diseases threatening the residents of our country. The prevention and monitoring of cardiovascular disease has become an issue that cannot be ignored. ECG signals, as the most direct physiological signals of the human body, can reflect the health of the heart, but ECG signals are easily interfered by various noises, including baseline drift, mains interference, and myoelectric noise. Among them, myoelectric noise is mainly generated by tiny movements of human muscles. Its frequency domain range overlaps with the frequency domain of ECG signals, and it cannot be removed by filters based on frequency domain segmentation. The removal of myoelectric noise has become a difficulty in ECG signal filtering.

[0003] At present, the methods for removing EMG noise mainly use bandpass filters, wavelet transform threshold method and other methods. Bandpass filters are mainly based on Fourier transform frequency domain filtering, which has the advantage of simple calculation, but cannot remove EMG noise and the overlapping part of ECG signal in frequency domain; wavelet transform is a new transform analysis method, which inherits and develops the localization idea of ​​short-time Fourier transform, and overcomes the disadvantage that the window size does not change with frequency, and can analyze time (space) localization. The wavelet threshold method uses wavelet transform to decompose ECG signal into detail coefficients and similarity coefficients at different levels, and then uses soft and hard threshold methods to remove noise from the coefficients, and finally uses inverse wavelet transform to reconstruct the subband signal to obtain a clean ECG signal. Wavelet transform can highlight the characteristics of the signal, but the selection of threshold is more difficult. If the threshold is too large, it will cause signal distortion and excessive noise reduction. If the threshold is too small, noise removal will not be completed.

[0004] Existing methods are only applicable to ECG signals that contain no or a small amount of myoelectric noise. Bandpass filters and wavelet transform threshold methods can only remove weak myoelectric noise. For motion scenes, the ECG signal contains a large amount of myoelectric noise, and the noise reduction effect is weak, which cannot be applied to situations with a large signal-to-noise ratio. At the same time, the existing methods do not consider the quasi-periodic nature of the ECG signal itself, that is, the regularity of the human heart beat. Bandpass filters use different frequencies of noise and signal for filtering, but the myoelectric noise and ECG signal frequency domain have overlapping parts. Wavelet transform considers decomposing the signal into sub-band signals and then using the threshold method to remove them, but the myoelectric noise in the sub-band signal cannot be measured. Summary of the invention

[0005] 1. Technical issues to be solved

[0006] In view of the shortcomings of the prior art, the present invention provides a method for removing electromyographic noise in electrocardiogram signals based on singular value decomposition. The method of the present invention can utilize the quasi-periodic nature of the electrocardiogram signals to construct a trajectory matrix, and then use singular value decomposition to extract the main waveform features, thereby improving the correlation and output signal-to-noise ratio of the electrocardiogram signals before and after filtering, reducing the root mean square error, and achieving effective removal of electromyographic noise at different noise levels.

[0007] (II) Technical solution

[0008] To achieve the above objectives, the present invention is implemented by the following technical scheme: a method for removing myoelectric noise in electrocardiogram signals based on singular value decomposition, which specifically comprises the following steps:

[0009] S1. Synthetic noisy ECG signal: The synthetic noise signal is mainly used to verify the effectiveness of the algorithm and evaluate the noise reduction effect. Clean ECG signals and electromyographic noise are superimposed on different amplification factors to synthesize simulated noise signals with different pollution levels.

[0010] S2. Find the QRS wave of the ECG signal: Find the QRS wave of the ECG signal to extract the main features of the ECG signal. The ECG signal contains P wave, T wave, QRS wave, etc. Among them, the QRS wave has the largest amplitude and energy, which is an indispensable step in ECG signal analysis;

[0011] S3. Calculate the interval between adjacent R waves: Calculate the interval between adjacent R waves based on the existing R wave position to calculate the RR interval (interval between two adjacent R waves) to obtain RR wave intervals of different lengths. The RR wave array is as follows: RR = [R1R2, R2R3, R3R4, ... R n-1 R n ];

[0012] S4. Segmentation of heartbeats: Segmentation of heartbeats divides the ECG signal into different segments centered on the R wave. The specific idea is as follows: According to the RR interval array obtained in the previous step, the interval R between the left R peak and the left R peak is obtained. l R, right R peak interval RR r , maximum heart beat interval RR max , take 0.5R to the left of the selected R peak l R, take 0.5RR to the right of the R peak r The length is taken as a complete heartbeat. In this case, the lengths of the split heartbeats are not equal, and the left and right sides are filled with 0 to 0.5RR at the same time. max , the total length of the heart beat is unified as RR max +1;

[0013] S5. Constructing a trajectory matrix: Constructing a periodic trajectory matrix. The series of heartbeat sequences processed previously are superimposed to form a two-dimensional trajectory matrix, where the formula of the A trajectory matrix is:

[0014]

[0015] S6. Singular value decomposition: Singular value decomposition decomposes a two-dimensional matrix into eigenvalues ​​and eigenvectors that interact with each other. Singular value decomposition is a matrix decomposition method, which is defined as: A = UΣV T ,U,V are the left and right singular matrices after the matrix A is split. All the elements above the main diagonal of Σ are 0. The elements on the main diagonal are called singular values. The singular values ​​are arranged from large to small. The largest singular value represents the main component of the signal;

[0016] S7, select singular values: when reconstructing the ECG signal, select the largest singular value as the clean signal, set the other singular values ​​as noise to 0, and then reconstruct the two-dimensional signal matrix, and finally take out each row in the matrix to restore the clean ECG signal;

[0017] S8. ECG signal restoration: restore the two-dimensional matrix into a filtered clean signal.

[0018] Preferably, R1R2 in the array in step S3 represents the interval between the first R peak and the second R peak.

[0019] Preferably, in step S5, S1 is the position of the first R peak, Z is half the length of the maximum RR interval as the reference length, each row in the matrix represents a heartbeat after segmentation, and an ECG signal consists of n heartbeats, where the R position S of each heartbeat is n are strictly aligned.

[0020] Preferably, the formula of the two-dimensional signal matrix reconstructed in step S7 is: A′=u1σ1v1, wherein A′ is the reconstructed signal matrix, σ1 is the maximum singular value, and u1 and v1 are singular vectors corresponding to the singular values, respectively.

[0021] (III) Beneficial effects

[0022] The present invention provides a method for removing myoelectric noise in electrocardiogram signals based on singular value decomposition. It has the following beneficial effects:

[0023] (1) Compared with the traditional denoising method, the method for removing electromyographic noise from ECG signals based on singular value decomposition has a stronger denoising effect when the ECG signals are seriously polluted by noise. Its output signal-to-noise ratio and noise improvement are higher than those of the wavelet transform threshold method and the bandpass filter, which represents a stronger denoising ability. At the same time, the root mean square error is smaller than that of the traditional method, indicating that its distortion is smaller.

[0024] (2) Compared with the traditional noise removal scheme, the method for removing electromyographic noise in ECG signals based on singular value decomposition takes into account the inherent periodic nature of the ECG signal itself, that is, the QRS wave in the ECG signal is the main feature, which is periodic and corresponds to the human heartbeat. The singular value decomposition can extract the main components of the matrix. At the same time, the heart beat segmentation method fully considers the different lengths of each heart beat interval to avoid QRS wave misalignment caused by fixed-length heart beat segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is a flow chart of the myoelectric noise removal method of the present invention;

[0026] Figure 2 This is a schematic diagram of the heart beat segmentation method of the present invention;

[0027] Figure 3 A comparison diagram of the present invention and the existing method in removing electromyographic noise;

[0028] Figure 4 It is a noise reduction evaluation diagram under different input signal-to-noise ratios of the present invention. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] See also Figure 1-4 The embodiment of the present invention provides a technical solution: a method for removing myoelectric noise in an electrocardiogram signal based on singular value decomposition, which is used for ECG noise reduction, and specifically includes the following steps:

[0031] S1. Synthesize ECG signal containing myoelectric noise (EMG): (1) Use python to read the myoelectric noise signal MA from the MIT-BIH noise pressure database. The MIT-BIH noise pressure database collects myoelectric noise, mains interference, and baseline drift, and is the gold standard for testing noise reduction algorithms. The MIT-BIH arrhythmia database contains common arrhythmia beats such as atrial premature beats, ventricular premature beats, conduction block, etc. This embodiment uses these two databases to verify the effect of the present invention and reads clean ECG signal No. 101 from the MIT-BIH arrhythmia database;

[0032] (2) According to the noise superposition principle, ECG stimulate =ECG clear +σEMG,ECG stimulatTo synthesize the mixed signal, σ is the noise superposition ratio, EMG is the electromyographic noise MA, the clean signal length is selected as 2500 data points, the corresponding electromyographic noise data is selected as 2500 points of data, 2dB, 4dB, 8dB, and 16dB noise are input respectively, and different signal-to-noise ratios are calculated according to different σ values.

[0033] S2. Searching for QRS wave mainly searches for QRS wave from ECG signal. QRS wave is the most obvious peak in electrocardiogram signal. Currently, common peak searching algorithms include pan-Tompks algorithm and wavlet algorithm. The present invention selects pan-Tompks algorithm to extract R wave from electrocardiogram signal and obtains the corresponding position of R wave. The corresponding R wave position array is [154,407,561,923,1195,1468,1736,1996,2246], which includes 9 R wave positions of heart beats.

[0034] S3. Calculate the intervals between adjacent RR waves and construct an RR interval array. According to the obtained R wave position data, calculate the RR wave interval (the distance between adjacent R wave peaks in ECG). The RR interval array is [253, 154, 362, 272, 273, 268, 260, 250]. It can be found from the array that the maximum RR interval is 362.

[0035] S4, heart beat segmentation, such as Figure 2 As shown, the red heartbeat is the heartbeat to be segmented. Here, the second heartbeat is selected for specific description, where the left distance L1w is 253, and the right distance L2 is 154. According to the segmentation method, the left side takes 0.5*L1 length 121, and the right side takes 0.5*L2 length 77. At the same time, the left and right sides are filled to half of the maximum length and 181. At this time, the total length of the heartbeat is 363. All heartbeats are segmented and filled to obtain a series of equal-length heartbeats.

[0036] S5. Construct a trajectory matrix and use the numpy high-performance library function in Python to store heartbeats. Each row of the matrix is ​​a separate heartbeat, such as Figure 3 Shown are the data plots for the first three rows of the matrix.

[0037] S6. Singular value decomposition of the trajectory matrix to extract the main waveform features of the ECG signal. The singular value decomposition uses the np.linalg.svd(traix) function in the numpy library of python. Numpy() is a computing library developed by python specifically for scientific computing, which includes matrix decomposition, matrix singular value decomposition, matrix QR decomposition, etc. In this embodiment, the numpy library function is used to implement singular value decomposition.

[0038] S7. Select the maximum singular value as the feature of the ECG signal and reconstruct the signal matrix. The singular values ​​obtained by singular value decomposition are [14.95642755, 2.32091189, 1.63704141, 1.12070935, 0.83488297, 0.52250907, 0.40032248, 0.33921127, 0.18226298]. It can be seen that the first singular value occupies the main component. 14.95 is selected as the clean signal feature in the ECG signal, and the other singular values ​​are set to 0 to reconstruct the two-dimensional trajectory matrix.

[0039] S8, restore the two-dimensional signal matrix to a filtered clean signal, and the restored ECG signal has removed the myoelectric noise, such as Figure 3 As shown, the noisy signal contains a 4db noise signal. It can be seen that the ECG signal is seriously polluted by noise. The signal after singular value decomposition basically does not contain electromyographic noise. The signal after wavelet transform threshold filtering is seriously distorted, and the bandpass filter has basically no noise reduction effect. In order to quantify the improvement and improvement of the present invention, the output signal-to-noise ratio, percentage root mean square error, correlation coefficient, and root mean square error evaluation algorithm are used. Figure 4 The corresponding output signal-to-noise ratio, percentage root mean square error, correlation coefficient, and root mean square error value of the present invention, the bandpass filter, and the wavelet transform threshold method at different input signal-to-noise ratios of 0dB, 4dB, 8dB, 12dB, and 16dB (the smaller the input signal-to-noise ratio, the higher the myoelectric noise content). Figure 4 It can be seen from a that under high EMG noise pollution conditions (0 dB, 4 dB), the method of the present invention has an output signal-to-noise ratio of 7.1 dB, which is better than the wavelet transform and the bandpass filter in noise removal capability. As the noise content gradually decreases, the present invention still maintains a high output signal-to-noise ratio. Figure 4 It can be seen from b and c that at different noise levels, the error of the method of the present invention is smaller than that of the wavelet transform and the bandpass filter, indicating that the degree of signal distortion is small; Figure 4 In d, under high EMG noise pollution (0dB input signal-to-noise ratio), the filtered signal of the method of the present invention and the clean signal still maintain a 94% correlation. The correlation of wavelet transform and bandpass filter is less than 80% under 0dB input signal-to-noise ratio, and the signal is seriously distorted.

[0040] Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.

[0041] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0042] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for removing myoelectric noise in electrocardiogram signals based on singular value decomposition, characterized in that: The specific steps include: S1. Synthetic noisy ECG signal: The synthetic noise signal is used to verify the effectiveness of the algorithm and evaluate the noise reduction effect. Clean ECG signals and electromyographic noise are superimposed on different amplification factors to synthesize simulated noise signals with different pollution levels. S2. Find the QRS wave of the ECG signal: Find the QRS wave of the ECG signal and extract the main features of the ECG signal; S3. Calculate the interval between adjacent R waves: Calculate the RR interval based on the existing R wave position to obtain RR wave intervals of different lengths. The RR wave array is as follows: , in the array Indicates the interval between the first R peak and the second R peak; S4. Segmentation of heartbeats: Segmentation of heartbeats divides the ECG signal into different segments centered on the R wave. The interval array gives the interval between the left R peak and , right R peak interval , maximum heart beat interval , to the selected Take the peak on the left ,Towards Take the right side of the peak The length is regarded as a complete heartbeat. In this case, the lengths of the heartbeats obtained by segmentation are not equal, and the left and right sides are filled with 0 to , the total length of the heart beat is unified as +1; S5. Constructing a trajectory matrix: Constructing a periodic trajectory matrix. Superimposing a series of heartbeat sequences processed previously to form a two-dimensional trajectory matrix, where The formula of the trajectory matrix is: ; For the first The location of the peak, For maximum Half the length of the interval is used as the reference length. Each row in the matrix represents a heartbeat after segmentation. An ECG signal consists of heartbeats, each of which Location are strictly aligned; S6. Singular value decomposition: Singular value decomposition decomposes a two-dimensional matrix into eigenvalues ​​and eigenvectors. Singular value decomposition is a matrix decomposition method, which is defined as: , For the matrix The left and right singular matrices after partitioning are: All elements except the main diagonal are 0. The main diagonal elements are called singular values. The singular values ​​are arranged from large to small. The largest singular value represents the main component of the signal. S7, select singular values: When reconstructing the ECG signal, select the largest singular value as the clean signal, set the other singular values ​​as noise to 0, and then reconstruct the two-dimensional signal matrix. Finally, take out each row in the matrix to restore the clean ECG signal. The formula of the two-dimensional signal matrix reconstructed in step S7 is: ,in is the reconstructed signal matrix, is the maximum singular value, , are the singular vectors corresponding to the singular values ​​respectively; S8. ECG signal restoration: restore the two-dimensional matrix into a filtered clean signal.

Citation Information

Patent Citations

  • Electrocardiosignal-based identity identification method and device

    CN107122788A

  • Electrocardiogram signal denoising method and device based on optimization theory

    CN107174236A

  • Electrocardio recognition method based on multi-characteristic extraction

    CN108537123A

  • A GRNN-based identification method

    CN109165556A

  • Heart ventricular septum abnormality analysis method and system based on magnetocardiogram, medium and terminal

    CN110074774A