Method, device, electronic device and storage medium for denoising electrocardiogram signals
Through multiple iterative denoising and wavelet transform algorithm processing, the problem of false removal of effective signals in ECG signal denoising is solved, and better denoising effect and complete signal retention are achieved, which is suitable for ECG signal processing.
Patent Information
- Application Number
- CN202310517954.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-09
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2043-05-09
AI Technical Summary
The existing technology is not effective in the process of ECG signal denoising, and it is easy to remove some valid signals as noise signals, resulting in the inability to obtain a complete ECG signal.
A multiple-iteration denoising method is used to separate the effective signal and the noise signal through a sequence of characteristic signal points, determine whether the noise signal is mixed with effective signal components, and reconstruct the signal if mixed, until the noise signal contains only the characteristic points of the noise signal; a secondary denoising is performed in combination with the wavelet transform algorithm to ensure the removal of residual noise.
It effectively preserves the complete ECG signal, improves the denoising effect, and avoids the problem of mistakenly removing the effective signal. It is suitable for large-scale applications in the field of ECG signal processing.
Smart Images

Figure CN116530993B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electrocardiogram signal processing, and in particular relates to an electrocardiogram signal denoising method, device, electronic equipment and storage medium. Background Art
[0002] With the development of clinical medicine, electrocardiogram (ECG) has become an important tool for diagnosing heart diseases. ECG signals are usually collected by placing corresponding electrode sensors on the upper torso of the subject. However, some noise will inevitably be introduced into the ECG signal during the measurement process, such as power frequency noise, baseline drift, and myoelectric noise. Therefore, how to effectively eliminate various interferences and noises and accurately extract useful ECG signals is an important part of the ECG signal processing process. The denoising effect will directly affect the processing and analysis results of the ECG signal.
[0003] At present, when denoising ECG signals, most of them are single denoising, and the effect is mostly poor. In the denoising process, it is easy to regard some valid ECG signals as noise signals and remove them. This will result in the inability to obtain complete and valid ECG signals. Based on this, how to provide a denoising method with good denoising effect and can obtain complete and valid ECG signals has become an urgent problem to be solved. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device, electronic device and storage medium for denoising an electrocardiogram signal, so as to solve the problem that the existing technology uses a single denoising method, the denoising effect is poor, and part of the valid signal is easily treated as a noise signal and removed during the denoising process, resulting in the inability to obtain a complete and valid electrocardiogram signal.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, a method for denoising an electrocardiogram signal is provided, comprising:
[0007] Acquiring a target ECG signal and performing feature extraction processing on the target ECG signal to obtain a plurality of characteristic signal points of the target ECG signal, so as to form a characteristic signal point sequence of the target ECG signal using the plurality of characteristic signal points;
[0008] Initializing the denoising times m, and performing denoising on the target ECG signal based on the characteristic signal point sequence, to obtain a valid ECG signal characteristic point sequence during the mth denoising and a noise signal characteristic point sequence during the mth denoising;
[0009] Determining whether the noise signal feature point sequence during the m-th denoising operation contains only noise signal feature points;
[0010] If not, performing signal reconstruction processing on the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising to obtain the effective reconstructed ECG signal sequence and the noise reconstructed signal sequence during the m-th denoising;
[0011] Updating the characteristic signal point sequence to the noise reconstructed signal sequence during the m-th denoising, adding 1 to m, and re-performing denoising on the target ECG signal based on the characteristic signal point sequence until the noise signal characteristic point sequence during the m-th denoising contains only noise signal characteristic points, and then performing signal reconstruction on the effective ECG signal characteristic point sequence during the m-th denoising to obtain m effective reconstructed ECG signal sequences, wherein the initial value of m is 1;
[0012] Performing signal superposition processing on the m valid reconstructed ECG signal sequences to obtain an initial denoised target ECG signal;
[0013] The initial denoised target ECG signal is denoised again using a wavelet transform algorithm, so as to obtain a denoised target ECG signal after the denoising process is completed.
[0014] Based on the above-disclosed content, the present invention first performs feature extraction processing on the target ECG signal to obtain a characteristic signal point sequence of the target ECG signal; then, the present invention adopts an iterative denoising method and, based on the characteristic signal point sequence, performs multiple iterative denoising on the target ECG signal to complete the initial denoising processing of the target ECG signal; then, the signal after the initial denoising processing is denoised again to obtain the denoised target ECG signal.
[0015] Specifically, during the m-th denoising, the characteristic signal point sequence can be first used to obtain the effective ECG signal characteristic point sequence and the noise signal characteristic point sequence of the target ECG signal during this denoising; in this way, this step is equivalent to using the characteristic signal points to separate the effective signal and the noise signal of the target ECG signal; then, the present invention determines whether the noise signal characteristic point sequence during the m-th denoising contains only noise signal characteristic points; if not, it means that the separated noise signal is mixed with effective ECG signal components. At this time, it is necessary to perform signal reconstruction processing on both the effective ECG signal characteristic point sequence and the noise signal characteristic point sequence during this denoising to obtain the effective reconstructed ECG signal sequence and the noise reconstructed signal sequence during the m-th denoising.
[0016] Then, m is incremented by 1, and the feature point sequence is updated to the noise reconstructed signal sequence at the time of the mth denoising, and the effective signal and the noise signal are separated again. In this way, the above denoising process is repeated until the separated noise signal feature point sequence contains only noise feature signal points, and the loop is ended. At this time, the effective ECG signal feature point sequence separated at the end of the loop is reconstructed again, and m effective reconstructed ECG signal sequences can be obtained at the end of the iteration. Based on this, the m effective reconstructed ECG signal sequences are superimposed to complete the initial denoising processing of the target ECG signal. Finally, the wavelet transform algorithm is used to denoise the signal obtained after the initial denoising again, and the complete denoising processing process of the target ECG signal can be completed, thereby obtaining the denoised target ECG signal.
[0017] Through the above design, when separating the effective signal and the noise signal of the target ECG signal, the present invention will determine whether the noise signal is mixed with effective signal components, and if it is mixed with effective signal components, the noise signal will be reconstructed, and then the reconstructed noise signal is used as the initial signal to separate the effective signal and the noise signal again, and the above process is repeated until the separated noise signal only contains the characteristic points of the noise signal; in this way, the present invention can avoid the problem of treating part of the effective ECG signal as a noise signal and removing it in the traditional technology, and can retain the complete and effective ECG signal; at the same time, the present invention adopts a dual denoising process, and can remove the residual noise in the initial denoising signal in the secondary denoising process. Based on this, the present invention can retain the complete and effective ECG signal while improving the denoising effect, and is suitable for large-scale application and promotion in the field of ECG signal processing.
[0018] In one possible design, feature extraction processing is performed on the target ECG signal to obtain multiple feature signal points of the target ECG signal, including:
[0019] Sampling the target ECG signal to obtain a sampling signal sequence, wherein the sampling signal points in the sampling signal sequence are arranged in descending order according to sampling time;
[0020] Acquire feature extraction parameters, and perform feature extraction processing on the target ECG signal based on the feature extraction parameters and the sampling signal sequence and according to the following formula (1) to obtain multiple feature signal points of the target ECG signal;
[0021] X a =[x(a),x(a+γ),x(a+2γ)+,...,x(a+(v-1)γ)],a=1,2,3,...,A (1)
[0022] In the above formula (1), Xa represents the a-th characteristic signal point, x(a) represents the a-th sampling signal point in the sampling signal sequence, γ represents the feature extraction delay time in the feature extraction parameters, v represents the feature extraction dimension in the feature extraction parameters, wherein A is the total number of characteristic signal points, A=n-(v-1)λ, and n represents the total number of sampling signal points.
[0023] In one possible design, based on the characteristic signal point sequence, the target ECG signal is denoised to obtain an effective ECG signal characteristic point sequence during the mth denoising and a noise signal characteristic point sequence during the mth denoising, including:
[0024] Using the characteristic signal point sequence and according to the following formula (2), a characteristic matrix of the target ECG signal at the time of m-th denoising is constructed;
[0025] R m =XX T / A (2)
[0026] In the above formula (2), R m represents the characteristic matrix during the mth denoising, X represents the matrix corresponding to the characteristic signal point sequence, and T represents the transposition operation, wherein X=[X1,X2,...,X A ], X A represents the Ath characteristic signal point in the characteristic signal point sequence, X A is a row vector containing v elements, and v represents the feature extraction dimension when the target ECG signal is subjected to feature extraction processing;
[0027] Performing singular value decomposition on the characteristic matrix during the m-th denoising to obtain a number of singular values and a eigenvector corresponding to each of the singular values;
[0028] Sorting the singular values in descending order, and constructing an energy spectrum image of the target ECG signal at the time of m-th denoising using the sorted singular values, wherein the energy spectrum image at the time of m-th denoising includes a plurality of energy points, and each energy point corresponds to a singular value and a eigenvector corresponding to the singular value;
[0029] Based on the energy spectrum image during the m-th denoising, the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising are determined, wherein the effective ECG signal feature point sequence during the m-th denoising includes a plurality of first energy points, the noise signal feature point sequence during the m-th denoising includes a plurality of second energy points, the first target energy point is greater than the second target energy point, and the first target energy point is the first energy point with the smallest singular value among the plurality of first energy points, and the second target energy point is the second energy point with the largest singular value among the plurality of second energy points.
[0030] In one possible design, performing signal reconstruction processing on the effective ECG signal feature point sequence during the m-th denoising to obtain the effective reconstructed ECG signal sequence during the m-th denoising includes:
[0031] Based on the effective ECG signal feature point sequence during the m-th denoising, and according to the following formula (3), the signal reconstruction coefficient of each first energy point in the effective ECG signal feature point sequence during the m-th denoising is calculated;
[0032]
[0033] In the above formula (3), represents the signal reconstruction coefficient of the kth first energy point in the effective ECG signal feature point sequence during the mth denoising, x(i+j)∈x, x represents the sampling signal sequence of the target ECG signal, wherein the sampling signals in the sampling signal sequence are arranged in order from the earliest to the latest sampling time, x(i+j) represents the i+jth sampling signal in the sampling signal sequence, q k represents the eigenvector corresponding to the kth first energy point, k=1, 2, ..., K, K represents the total number of first energy points, and n represents the total number of sampled signals;
[0034] Based on the signal reconstruction coefficient of each first energy point and the eigenvector corresponding to each first energy point, an effective reconstructed electrocardiogram signal point of each first energy point during the mth denoising process is obtained;
[0035] The effective reconstructed ECG signal points of each first energy point during the m-th denoising are used to form the effective reconstructed ECG signal sequence during the m-th denoising.
[0036] In one possible design, the initial denoised target ECG signal is denoised again using a wavelet transform algorithm to obtain a denoised target ECG signal after the denoising process is completed, including:
[0037] Using a wavelet transform algorithm, the initial denoised target ECG signal is subjected to multi-scale decomposition to obtain wavelet transform signals at different decomposition scales, wherein any ECG signal point in the wavelet transform signal at any decomposition scale corresponds to a wavelet coefficient;
[0038] Calculating the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale, and calculating the denoising standard coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale based on the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale;
[0039] For any wavelet coefficient in any wavelet transform signal at each decomposition scale, determining whether a denoising coefficient of the wavelet coefficient is greater than a denoising standard coefficient corresponding to the wavelet coefficient;
[0040] If yes, any of the wavelet coefficients is set to 0, and after all the wavelet coefficients in all the wavelet transform signals are processed, a pre-processed wavelet transform signal corresponding to each wavelet transform signal is obtained;
[0041] Calculating the noise reduction threshold based on the wavelet coefficients corresponding to each ECG signal point in each preprocessed wavelet transform signal;
[0042] Based on the de-noising threshold, updating each wavelet coefficient in the wavelet transform signal at each decomposition scale, so as to obtain a denoised wavelet transform signal corresponding to each wavelet transform signal after the coefficient is updated;
[0043] Signal reconstruction processing is performed on each denoised wavelet transformed signal to obtain the denoised target electrocardiogram signal after the signal reconstruction processing.
[0044] In a possible design, the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale is calculated, including:
[0045] For any ECG signal point in the wavelet transform signal at any decomposition scale, the denoising coefficient of any ECG signal point is calculated using the following formula (4);
[0046] S z,g =ω z,g ·ω z+1,g (4)
[0047] In the above formula (4), S z,g represents the denoising coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z,g represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z+1,grepresents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z+1, z=1,2,...,Z, g=1,2,...,G, where Z represents the maximum decomposition scale and G represents the total number of ECG signal points in the wavelet transform signal at the decomposition scale z;
[0048] Accordingly, based on the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale, the denoising standard coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale is calculated, which includes:
[0049] For any ECG signal point in the wavelet transform signal at any decomposition scale, the denoising standard coefficient of any ECG signal point is calculated using the denoising coefficient of the any ECG signal point and according to the following formula (5);
[0050]
[0051] In the above formula (5), B z,g represents the denoising standard coefficient of the g-th ECG signal point in the wavelet transform signal under the decomposition scale z, U ω (g) represents the first intermediate parameter, U S (g) represents the second intermediate parameter;
[0052]
[0053]
[0054] In one possible design, based on the denoising threshold, updating each wavelet coefficient in the wavelet transform signal at each decomposition scale includes:
[0055] For any wavelet coefficient in the wavelet transform signal at any decomposition scale, update the coefficient of any wavelet coefficient in the wavelet transform signal at any decomposition scale according to the following formula (8);
[0056]
[0057] In the above formula (8), ω z,g represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z ' ,g represents the updated wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at decomposition scale z, sgn() represents the sign function, β and ε represent update constants, h represents the denoising threshold, and G represents the total number of ECG signal points in the wavelet transform signal at decomposition scale z, where z = 1, 2, ..., Z, g = 1, 2, ..., G, and Z represents the maximum decomposition scale.
[0058] In a second aspect, a device for denoising an electrocardiogram signal is provided, comprising:
[0059] a feature extraction unit, configured to acquire a target ECG signal and perform feature extraction processing on the target ECG signal to obtain a plurality of feature signal points of the target ECG signal, so as to form a feature signal point sequence of the target ECG signal using the plurality of feature signal points;
[0060] A first denoising unit is configured to initialize m denoising times and perform denoising on the target ECG signal based on the characteristic signal point sequence to obtain a valid ECG signal characteristic point sequence at the mth denoising time and a noise signal characteristic point sequence at the mth denoising time;
[0061] A first denoising unit is configured to determine whether the noise signal feature point sequence during the m-th denoising operation contains only noise signal feature points;
[0062] a first denoising unit, configured to, when the judgment result is negative, perform signal reconstruction processing on the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising, to obtain an effective reconstructed ECG signal sequence and a noise reconstructed signal sequence during the m-th denoising;
[0063] a first denoising unit, configured to update the characteristic signal point sequence to the noise reconstructed signal sequence during the m-th denoising, increment m by 1, and re-perform denoising on the target ECG signal based on the characteristic signal point sequence until the noise signal characteristic point sequence during the m-th denoising contains only noise signal characteristic points, and then perform signal reconstruction on the effective ECG signal characteristic point sequence during the m-th denoising to obtain m effective reconstructed ECG signal sequences, wherein the initial value of m is 1;
[0064] The first denoising unit is further configured to perform signal superposition processing on the m valid reconstructed ECG signal sequences to obtain an initial denoised target ECG signal;
[0065] The second denoising unit is configured to perform denoising processing on the initial denoised target ECG signal again by using a wavelet transform algorithm, so as to obtain a denoised target ECG signal after the denoising processing is completed.
[0066] In a third aspect, another electrocardiogram signal denoising device is provided. Taking the device as an electronic device as an example, the device includes a memory, a processor and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the electrocardiogram signal denoising method as described in the first aspect or any possible design of the first aspect.
[0067] In a fourth aspect, a storage medium is provided, on which instructions are stored. When the instructions are run on a computer, the electrocardiogram signal denoising method as described in the first aspect or any possible design of the first aspect is executed.
[0068] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, causes the computer to execute the electrocardiogram signal denoising method as described in the first aspect or any possible design of the first aspect.
[0069] Beneficial effects:
[0070] (1) When separating the effective signal and the noise signal of the target ECG signal, the present invention determines whether the noise signal contains effective signal components, and reconstructs the noise signal when it contains effective signal components. Then, the reconstructed noise signal is used as the initial signal to separate the effective signal and the noise signal again, and the above process is repeated until the separated noise signal contains only the characteristic points of the noise signal. In this way, the present invention can avoid the problem of treating part of the effective ECG signal as a noise signal and removing it in the traditional technology, and can retain the complete and effective ECG signal. At the same time, the present invention adopts a double denoising process, which can remove the residual noise in the initial denoising signal in the secondary denoising process. Based on this, the present invention can retain the complete and effective ECG signal while improving the denoising effect, and is suitable for large-scale application and promotion in the field of ECG signal processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 A schematic flow chart of the steps of a method for denoising an electrocardiogram signal provided by an embodiment of the present invention;
[0072] Figure 2 A schematic structural diagram of an electrocardiogram signal denoising device provided in an embodiment of the present invention;
[0073] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0074] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly introduced below in conjunction with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0075] It should be understood that although the terms "first," "second," etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element without departing from the scope of the exemplary embodiments of the present invention.
[0076] It should be understood that the term "and / or" that may appear in this document is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may indicate three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this document describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B may indicate two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0077] Example:
[0078] See also Figure 1 As shown, the ECG signal denoising method provided in this embodiment uses a multiple noise separation method to perform initial denoising on the target ECG signal. During each noise separation process, it is determined whether the separated noise signal contains valid signal components. When it is determined that the separated noise signal contains valid signal components, the separated noise signal is reconstructed to separate the valid signal from the noise signal again. In this way, the aforementioned process is repeated until the separated noise signal contains only noise components, and the initial denoising process is terminated. Finally, the signal after the initial denoising is subjected to secondary denoising to obtain the final denoised signal. Based on this, the present invention can avoid the problem of treating part of the valid ECG signal as a noise signal and removing it in the traditional technology. At the same time, the dual denoising process can be used to remove the residual noise in the initial denoising signal during the secondary denoising process. Thus, the denoising effect can be improved while retaining the complete valid ECG signal. It is suitable for large-scale application and promotion in the field of ECG signal processing. In this embodiment, the method can be, but is not limited to, run on the signal processing end side, wherein the signal processing end can be, but is not limited to, a personal computer. computer, PC), tablet computer or smart phone. It can be understood that the aforementioned execution subject does not constitute a limitation on the embodiments of the present application. Accordingly, the operation steps of the present method can be but are not limited to the following steps S1 to S7.
[0079] S1. Acquire a target ECG signal, and perform feature extraction processing on the target ECG signal to obtain a plurality of feature signal points of the target ECG signal, so as to utilize the plurality of feature signal points to form a feature signal point sequence of the target ECG signal; in this embodiment, the target ECG signal can be, but is not limited to, acquired by using an ECG electrode sensor, wherein the feature extraction processing on the target ECG signal is to extract feature points in the target ECG signal, so as to perform separation of effective signals and noise signals in the target ECG signal based on the feature points; optionally, for example, the feature extraction processing on the target ECG signal can be, but is not limited to, implemented by the following steps S11 and S12.
[0080] S11. The target ECG signal is sampled and processed to obtain a sampling signal sequence, wherein the sampling signal points in the sampling signal sequence are arranged in descending order according to the sampling time; in specific applications, the sampling sequence can be, but is not limited to,: x = {x(1), x(2), ..., x(i), ..., x(n)}, where x represents the adopted signal sequence, x(i) represents the i-th sampling signal point, and n represents the total number of sampling signal points.
[0081] After the sampling process of the target ECG signal is completed, feature extraction may be performed based on the corresponding sampling signal sequence. The feature extraction process may be, but is not limited to, as shown in the following step S12.
[0082] S12. Acquire feature extraction parameters, and perform feature extraction processing on the target ECG signal based on the feature extraction parameters and the sampling signal sequence and in accordance with the following formula (1) to obtain multiple feature signal points of the target ECG signal.
[0083] X a =[x(a),x(a+γ),x(a+2γ)+,...,x(a+(v-1)γ)],a=1,2,3,...,A (1)
[0084] In the above formula (1), X a represents the a-th characteristic signal point, x(a) represents the a-th sampling signal point in the sampling signal sequence, γ represents the feature extraction delay time in the feature extraction parameters, v represents the feature extraction dimension in the feature extraction parameters, wherein A is the total number of characteristic signal points, A=n-(v-1)λ, and n represents the total number of sampling signal points.
[0085] In specific applications, the cao method can be used but is not limited to calculate the feature extraction dimension, and the mutual information method can be used to determine the feature extraction delay time. In this embodiment, for example, v is preferably 20 and γ is preferably 7; of course, the aforementioned cao method for obtaining the feature extraction dimension and the mutual information method for obtaining the delay time are both commonly used calculation methods for feature extraction dimension and delay time, and their principles will not be elaborated on.
[0086] At the same time, the above formula (1) is explained below with an example:
[0087] When a is 1, v is 20, and γ is 7:
[0088] X1=[x(1),x(1+7),x(1+14)+,...,x(1+(20-1)7)]=[x(1),x(8),x(15)+,...,x(134)], so X1 is a row vector containing 20 elements, and is composed of the first sampling signal point, the 8th sampling signal point, the 15th sampling signal point,..., the 134th sampling signal point in the sampling signal sequence; of course, the process of obtaining the remaining characteristic signal points is the same as the above example and will not be repeated here; therefore, the characteristic signal point sequence based on the above characteristic signal points is: X={X1,X2,...,X A}.
[0089] After the feature extraction of the target ECG signal is achieved through the aforementioned steps S11 and S12, the target ECG signal can be separated into valid signals and noise signals multiple times based on the sequence of characteristic signal points obtained by feature extraction. When the noise signal is separated, the number of separations is determined by judging whether the separated noise signal is mixed with valid signal components. That is, when it is judged that the separated noise signal is mixed with valid signal components, the separated noise signal is reconstructed and noise separation is performed again until the separated noise signal contains only noise components, and the separation process is stopped. The aforementioned separation process can be, but is not limited to, as shown in the following steps S2 to S5.
[0090] S2. Initialize the number of denoising times m, and perform denoising on the target ECG signal based on the characteristic signal point sequence to obtain a valid ECG signal characteristic point sequence during the m-th denoising and a noise signal characteristic point sequence during the m-th denoising. In this embodiment, the characteristic matrix of the target ECG signal can be constructed by, but is not limited to, the characteristic signal point sequence, and then, the singular value representing the signal energy in the target ECG signal is obtained by solving the characteristic matrix. Finally, the division between the valid signal and the noise signal is completed based on the solved singular value. Optionally, the aforementioned noise separation process can be, but is not limited to, as shown in the following steps S21 to S24.
[0091] S21. Using the characteristic signal point sequence and according to the following formula (2), construct the characteristic matrix of the target ECG signal during the m-th denoising. In this embodiment, the aforementioned characteristic signal point sequence can be first formed into a matrix, that is, a matrix of 1 row and v columns. Then, based on the matrix composed of the characteristic point sequence and according to the following formula (2), the characteristic matrix of the target ECG signal during the m-th denoising is constructed.
[0092] Among them, the characteristic matrix of the mth denoising is: R m =XX T / A (2)
[0093] In the above formula (2), R m represents the characteristic matrix during the mth denoising, X represents the matrix corresponding to the characteristic signal point sequence, and T represents the transposition operation, wherein X=[X1,X2,...,X A ], X A represents the Ath characteristic signal point in the characteristic signal point sequence, X A is a row vector containing v elements, and v represents the feature extraction dimension when the target ECG signal is subjected to feature extraction processing; based on the above explanation, X is a v×A matrix. Thus, based on the above formula (2), the feature matrix of the target ECG signal during the mth denoising can be constructed.
[0094] After obtaining the characteristic matrix of the mth denoising, the characteristic matrix can be solved to obtain the singular value used to characterize the signal energy in the target ECG signal, so as to subsequently separate the effective signal and the noise signal based on the singular value. The solution process of the characteristic matrix can be, but is not limited to, as shown in the following step S22.
[0095] S22. Perform singular value decomposition on the characteristic matrix during the m-th denoising to obtain a number of singular values and a characteristic vector corresponding to each of the singular values; in specific applications, singular value decomposition is a commonly used method in the matrix solving process, and the characteristic vector is the singular vector corresponding to the singular value, and the principle of obtaining it will not be repeated; and after obtaining the singular values of the characteristic matrix, the energy spectrum image of the target ECG signal during the m-th denoising can be constructed based on the singular values, so as to separate the effective signal and the noise signal based on the energy spectrum image, wherein the construction process of the energy spectrum image during the m-th denoising is shown in the following step S23
[0096] S23. Sort the singular values in descending order, and use the sorted singular values to construct an energy spectrum image of the target ECG signal during the m-th denoising, wherein the energy spectrum image during the m-th denoising contains a number of energy points, and each energy point corresponds to a singular value, and a eigenvector corresponding to the singular value; in this embodiment, the singular values represent the relative relationship between the energy occupied by different components in the target ECG signal in the entire signal, wherein a larger singular value corresponds to a signal component with larger energy in the target ECG signal, and vice versa. Small singular values correspond to signal components with smaller energy in the target ECG signal. In this way, the singular values are arranged in order from large to small and plotted to obtain the energy spectrum image of the target ECG signal at the mth denoising. Based on this, the energy spectrum image of the target ECG signal at the mth denoising contains singular value points arranged in order from large to small, and each singular value point corresponds to an energy point, and an energy point corresponds to a signal component. Therefore, the effective signal and the noise signal can be separated based on the energy spectrum image, as shown in the following step S24.
[0097] S24. Based on the energy spectrum image during the m-th denoising, determine the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising, wherein the effective ECG signal feature point sequence during the m-th denoising includes a plurality of first energy points, and the noise signal feature point sequence during the m-th denoising includes a plurality of second energy points, the first target energy point is greater than the second target energy point, and the first target energy point is the first energy point with the smallest singular value among the plurality of first energy points, and the second target energy point is the second energy point with the largest singular value among the plurality of second energy points; in the specific implementation, it has been explained above that a larger singular value corresponds to a component with larger energy in the signal, and in the ECG signal, the energy of its effective ECG signal component is greater than that of the noise signal, so it can be determined that the signal component corresponding to the smaller singular value is divided into noise; based on this, the first d energy points in the energy spectrum image during the m-th denoising (that is, the singular value points in the first d positions of the sort, and the value of d can be preset according to actual use) can be selected as the effective ECG signal components of the target ECG signal during the m-th denoising, and the remaining energy points are used as noise components; if it is assumed that d is 3, then the first three energy points in the energy spectrum image constitute the effective ECG signal feature point sequence during the m-th denoising; and the energy points after the third energy point in the energy spectrum image constitute the noise signal feature point sequence during the m-th denoising; in this way, during the m-th denoising, the effective ECG signal feature point sequence of the target ECG signal contains 3 signal components; of course, when the value of d is different, the construction process of the effective ECG signal feature point sequence and the noise signal feature point sequence is the same as the above example, and will not be repeated here.
[0098] Based on the aforementioned steps S21 to S24, the characteristic signal point sequence of the target ECG signal can be used to construct its corresponding energy spectrum image during the mth denoising, thereby achieving separation of the effective signal and the noise signal during the mth denoising.
[0099] When the mth denoising is completed, after the effective signal and the noise signal in the target ECG signal are separated, it is also necessary to determine whether the separated noise signal (i.e., the noise signal feature point sequence during the mth denoising) is mixed with effective signal components. The determination process is shown in the following step S3.
[0100] S3. Determine whether the noise signal feature point sequence during the m-th denoising process contains only noise signal feature points. In this embodiment, the energy spectrum image and the noise signal feature point sequence during the m-th denoising process can be visualized on the signal processing end, but is not limited to being displayed to the staff for viewing. Then, the signal processing end obtains the judgment result in response to the human-computer interaction with the staff, that is, the staff determines whether the noise signal feature point sequence contains only noise signal feature points based on the energy spectrum image and the noise signal feature point sequence. For example, if the energy points in the sequence are the 4th to the 10th, and the 4th and 5th energy points are represents a valid signal component, then the judgment result obtained by the signal processing end in response to the human-computer interaction with the staff is no (that is, there are valid signal components mixed in); and if it is judged that there are valid signal components mixed in, it is necessary to reconstruct the signal of the valid ECG signal feature point sequence and the noise signal feature point sequence during the mth denoising, so as to use the reconstructed noise signal to perform noise separation again, and to judge again whether the separated noise signal is mixed with valid signal components. In this way, the above process is repeated continuously to complete the initial noise separation of the target ECG signal, wherein the signal reconstruction process is shown in the following step S4.
[0101] S4. If not, signal reconstruction is performed on the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising to obtain the effective reconstructed ECG signal sequence and the noise reconstructed signal sequence during the m-th denoising; in a specific implementation, if the noise signal feature point sequence in step S3 only contains noise signal feature points, it means that the separated noise signal is not mixed with effective signal components, and therefore, the effective ECG signal feature point sequence during the m-th denoising can be directly reconstructed; optionally, since the signal reconstruction process of the effective ECG signal feature point sequence and the noise signal feature point sequence is the same, the following takes the effective ECG signal feature point sequence during the m-th denoising as an example to specifically illustrate the signal reconstruction process, as shown in the following steps S41 to S43.
[0102] S41. Based on the effective ECG signal feature point sequence during the m-th denoising, and according to the following formula (3), calculate the signal reconstruction coefficient of each first energy point in the effective ECG signal feature point sequence during the m-th denoising.
[0103]
[0104] In the above formula (3), represents the signal reconstruction coefficient of the kth first energy point in the effective ECG signal feature point sequence during the mth denoising, x(i+j)∈x, x represents the sampling signal sequence of the target ECG signal, wherein the sampling signals in the sampling signal sequence are arranged in order from the earliest to the latest sampling time, x(i+j) represents the i+jth sampling signal in the sampling signal sequence (i+j is less than or equal to n), q k represents the eigenvector corresponding to the kth first energy point, k=1,2,...,K, K represents the total number of first energy points, and n represents the total number of sampled signals; in specific applications, the value of i is: 0≤i≤nK, and can be randomly selected within this range. At the same time, q k represents the eigenvector (that is, singular vector) corresponding to the kth first energy point; so, assuming that i is 2 and K is 3, then for the first energy point, its signal reconstruction coefficient is: Of course, the calculation process of the signal reconstruction coefficients corresponding to other different first energy points is the same as the above example, and will not be repeated here.
[0105] After obtaining the signal reconstruction coefficients of each first energy point, signal reconstruction can be performed, as shown in the following step S42.
[0106] S42. Based on the signal reconstruction coefficient of each first energy point, the effective reconstructed ECG signal point of each first energy point during the mth denoising is obtained; in specific applications, for the kth first energy point, the following formula (9) can be used, but is not limited to, to construct the effective reconstructed ECG signal point corresponding to the kth first energy point.
[0107]
[0108] In the above formula (9), x′ k The effective reconstructed ECG signal point corresponding to the kth first energy point.
[0109] In addition, this embodiment discloses another signal reconstruction method, and its reconstruction formula is shown in the following formula (10):
[0110]
[0111] In the above formula (10), ηk represents the singular value corresponding to the kth first energy point, Indicates the pth k singular functions of singular points, Furthermore, the process of obtaining the singular points is as follows: differential processing is performed on the target ECG signal, and then the points in the signal whose absolute value of the difference is greater than the noise threshold are used as pre-selected singular points. The absolute values of the difference of the singular value points are then sorted from large to small, and the first K bits of the sort are taken as singular points.
[0112] In this way, based on the aforementioned formula (9) or formula (10), the effective reconstructed ECG signal points of each first energy point during the mth denoising can be reconstructed, and then, using each effective reconstructed ECG signal, an effective reconstructed ECG signal sequence during the mth denoising can be formed, as shown in the following step S43.
[0113] S43. Utilize the effective reconstructed ECG signal points of each first energy point during the m-th denoising to form the effective reconstructed ECG signal sequence during the m-th denoising. Of course, in this embodiment, the reconstruction process of the noise signal feature point sequence during the m-th denoising is the same as the reconstruction process of the effective ECG signal feature point sequence, and will not be repeated here.
[0114] Therefore, based on the aforementioned steps S41 to S43, the target ECG signal can be separated once, and the effective reconstructed ECG signal sequence and the noise reconstructed signal sequence during the mth denoising are obtained; at this time, it is necessary to use the noise reconstructed signal sequence as the feature point signal sequence, and perform the separation of the effective signal and the noise signal again, that is, based on the noise reconstructed signal sequence, perform the second denoising process on the target ECG signal, and obtain the effective ECG signal feature point sequence and the noise signal feature point sequence during the second denoising; then, it is determined again whether the separated noise signal is mixed with effective signal components, and the aforementioned process is repeated until the separated noise signal contains only noise components, and the iterative denoising process is terminated, wherein the loop process is shown in the following step S5.
[0115] S5. Update the characteristic signal point sequence to the noise reconstructed signal sequence during the m-th denoising, add 1 to m, and re-perform denoising on the target ECG signal based on the characteristic signal point sequence until the noise signal characteristic point sequence during the m-th denoising contains only noise signal characteristic points, and then perform signal reconstruction on the effective ECG signal characteristic point sequence during the m-th denoising to obtain m effective reconstructed ECG signal sequences, wherein the initial value of m is 1.
[0116] In this embodiment, an example is used to illustrate the aforementioned iterative denoising process:
[0117] When m is 1, the target ECG signal is subjected to the first denoising process based on the characteristic signal point sequence to obtain the effective ECG signal characteristic point sequence and the noise signal characteristic point sequence during the first denoising process. At this time, it is determined whether the noise signal characteristic point sequence during the first denoising process contains only noise signal characteristic points. If not, the effective ECG signal characteristic point sequence and the noise signal characteristic point sequence during the first denoising process are subjected to signal reconstruction process to obtain the effective reconstructed ECG signal sequence and the noise reconstructed signal sequence during the first denoising process.
[0118] The characteristic signal point sequence is updated to the noise reconstructed signal sequence during the first denoising, and m is incremented by 1; then, based on the newly obtained characteristic signal point sequence, the target ECG signal is subjected to a second denoising process to obtain a valid ECG signal characteristic point sequence and a noise signal characteristic point sequence during the second denoising; at this time, it is determined whether the noise signal characteristic point sequence during the second denoising contains only noise signal characteristic points; if so, the loop is terminated, and the valid ECG signal characteristic point sequence during the second denoising is subjected to signal reconstruction to obtain a valid reconstructed ECG signal sequence during the second denoising; in this way, two valid reconstructed ECG signal sequences (i.e., the valid reconstructed ECG signal sequences during the first and second denoising) can be obtained; and then, the initial denoised target ECG signal can be obtained based on the two valid reconstructed ECG signal sequences.
[0119] Furthermore, during the signal reconstruction process, if the aforementioned formula (10) is used, when m is 1, the target ECG signal is differentially processed to obtain a singular point; when m is 2, the noise signal of the first denoising is obtained based on the noise reconstruction signal sequence, and then the noise signal is differentially processed to obtain a singular point; when m is 3, the noise signal of the second denoising is obtained based on the noise reconstruction signal sequence, and then the noise signal of the second denoising is superimposed on the first and second denoising, and the superimposed signal is differentially processed to obtain a singular point; in this way, the singular point corresponding to each signal reconstruction can be obtained by continuously looping.
[0120] After the aforementioned steps S1 to S5, the initial denoising process of the target ECG signal is completed. In this embodiment, during this initial denoising process, the noise signal is determined to contain valid signal components to determine whether to reconstruct the noise signal, thereby performing noise separation again until the separated noise signal contains only noise components. In this way, the problem of treating part of the valid ECG signal as a noise signal and removing it can be avoided in traditional technologies.
[0121] After the iterative denoising process is performed to obtain m valid reconstructed ECG signal sequences, the aforementioned sequences are superimposed to obtain the target ECG signal after initial denoising, as shown in the following step S6.
[0122] S6. Perform signal superposition processing on the m valid reconstructed ECG signal sequences to obtain an initial denoised target ECG signal. In this embodiment, the signal points at the same time in the sequence are superimposed, such as the signal points corresponding to k being 1 in each valid reconstructed ECG signal sequence are superimposed, and the signal points corresponding to k being 2 are superimposed. Based on this principle, the initial denoised target ECG signals corresponding to different time moments can be obtained.
[0123] After the initial denoising of the target ECG signal is completed, in order to improve the denoising effect, this embodiment further provides a secondary denoising process, wherein the secondary denoising process can be but is not limited to the following step S7.
[0124] S7. Use the wavelet transform algorithm to perform denoising processing on the initial denoised target ECG signal again, so as to obtain a denoised target ECG signal after the denoising processing is completed; in this embodiment, the specific process of performing denoising processing on the initial denoised target ECG signal using the wavelet transform algorithm can be, but is not limited to, as shown in the following steps S71 to S77.
[0125] S71. Use the wavelet transform algorithm to perform multi-scale decomposition on the initial denoising target ECG signal to obtain wavelet transform signals at different decomposition scales, wherein any ECG signal point in the wavelet transform signal at any decomposition scale corresponds to a wavelet coefficient; in the specific application process, the wavelet transform algorithm performs multi-scale decomposition on the signal, which is a commonly used method for signal processing, and its principle will not be repeated here; and after obtaining the wavelet transform signals at different scales, the wavelet coefficients in the wavelet transform signals at different scales can be used to realize signal denoising, and the process is shown in the following steps S72 to S77.
[0126] S72. Calculate the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale, and calculate the denoising standard coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale based on the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale; in specific applications, since the calculation process of the denoising coefficient corresponding to each wavelet coefficient in different wavelet transform signals at each decomposition scale is the same, the following takes any ECG signal point in the wavelet transform signal at any decomposition scale as an example to specifically explain the calculation process of its corresponding denoising coefficient.
[0127] In this embodiment, for any ECG signal point in the wavelet transform signal at any decomposition scale, the denoising coefficient of the ECG signal point can be calculated using, but not limited to, the following formula (4).
[0128] S z,g =ω z,g ·ω z+1,g (4)
[0129] In the above formula (4), S z,g represents the denoising coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z,g represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z+1,g Represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z+1, z = 1, 2, ..., Z, g = 1, 2, ..., G, where Z represents the maximum decomposition scale and G represents the total number of ECG signal points in the wavelet transform signal at the decomposition scale z.
[0130] Thus, the denoising coefficient corresponding to each wavelet coefficient in each wavelet transform signal can be calculated by the above formula (4); similarly, the denoising standard coefficient is also explained based on the above example, namely:
[0131] For any ECG signal point in the wavelet transform signal at any decomposition scale, the denoising standard coefficient of any ECG signal point can be calculated by using, but not limited to, the denoising coefficient of the any ECG signal point and according to the following formula (5).
[0132]
[0133] In the above formula (5), B z,g represents the denoising standard coefficient of the g-th ECG signal point in the wavelet transform signal under the decomposition scale z, U ω (g) represents the first intermediate parameter, U S (g) represents the second intermediate parameter.
[0134] Furthermore, the calculation formulas of the first intermediate parameter and the second intermediate parameter are shown in the following formulas (6) and (7).
[0135] in,
[0136]
[0137] Therefore, through the above formulas (4) and (5), the denoising coefficient and denoising standard coefficient corresponding to each wavelet coefficient in each wavelet transform signal at different decomposition scales can be calculated; then, the denoising coefficient and denoising standard coefficient of each wavelet coefficient can be used to perform denoising processing, as shown in the following steps S73 and S74.
[0138] S73. For any wavelet coefficient in any wavelet transform signal at each decomposition scale, determine whether the denoising coefficient of any wavelet coefficient is greater than the denoising standard coefficient corresponding to the wavelet coefficient.
[0139] S74. If yes, any of the wavelet coefficients is set to 0, and after all the wavelet coefficients in all the wavelet transform signals are processed, the preprocessed wavelet transform signal corresponding to each wavelet transform signal is obtained; in this embodiment, the meaning represented by the above judgment condition is: since the wavelet coefficients of the effective signal have a strong correlation between the scales, and the wavelet coefficients of the noise have no obvious correlation between the scales, therefore, the size relationship between the above denoising standard coefficient and the denoising coefficient can be used to determine the position of the effective signal, and the wavelet signal at the position is set to 0, then, what is left is the noise signal, so that the remaining wavelet coefficients can be used to calculate the denoising threshold, thereby facilitating the subsequent noise removal, wherein the calculation process of the denoising threshold can be but not limited to the following step S75.
[0140] S75. Calculate the noise reduction threshold based on the wavelet coefficients corresponding to each ECG signal point in each preprocessed wavelet transform signal. In this embodiment, the variance of all wavelet coefficients of each preprocessed wavelet transform signal can be calculated, but is not limited to, and then the noise reduction threshold h is calculated using the following formula (11).
[0141]
[0142] In the above formula (11), σ represents the threshold coefficient, σ=ψ / 0.6745, ψ represents the variance of all wavelet coefficients of each preprocessed wavelet transform signal, and N represents the number of sampling points of the initial denoising target ECG signal.
[0143] After calculating the denoising threshold, each wavelet coefficient in the wavelet transform signal at each decomposition scale can be updated based on the denoising threshold, so that the denoising processing of the initial denoising target ECG signal can be achieved after the coefficient update, as shown in the following step S76.
[0144] S76. Based on the denoising threshold, update the coefficients of each wavelet coefficient in the wavelet transform signal at each decomposition scale, so as to obtain the denoised wavelet transform signal corresponding to each wavelet transform signal after the coefficients are updated; in this embodiment, any wavelet coefficient in the wavelet transform signal at any decomposition scale is taken as an example to explain in detail, and it can be but not limited to using the following formula (8) to perform coefficient update.
[0145]
[0146] In the above formula (8), ω z,g represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z ' ,grepresents the updated wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, sgn() represents the sign function, β, ε represent the update constants, h represents the denoising threshold, and G represents the total number of ECG signal points in the wavelet transform signal at the decomposition scale z.
[0147] Therefore, through the above formula (8), the update of each wavelet coefficient in the wavelet transform signal at each decomposition scale can be completed. When the wavelet coefficient is updated to 0, it means that the signal component corresponding to the wavelet coefficient is identified as a noise signal and is removed. In this way, several denoised wavelet transform signals can be obtained; then, the above denoised wavelet transform signal is subjected to signal reconstruction processing to obtain the final denoised target ECG signal, as shown in the following step S77.
[0148] S77. Perform signal reconstruction processing on each denoised wavelet transform signal to obtain the denoised target ECG signal after the signal reconstruction processing; in this embodiment, the inverse wavelet transform can be used (such as using the wrcoef function) to realize the reconstruction of the aforementioned denoised wavelet transform signals, thereby obtaining the denoised target ECG signal; of course, the aforementioned inverse wavelet transform to realize signal reconstruction is a commonly used method of signal processing, and its principle will not be repeated here.
[0149] Thus, through the ECG signal denoising method described in detail in the aforementioned steps S1 to S7, the present invention adopts a multiple noise separation method to perform initial denoising processing on the target ECG signal. In each noise separation process, it is determined whether the separated noise signal is mixed with valid signal components. When it is determined that the separated noise signal is mixed with valid signal components, the separated noise signal is reconstructed to again separate the valid signal from the noise signal. In this way, the aforementioned process is repeated until the separated noise signal contains only noise components, and the initial denoising process is terminated. Finally, the signal after initial denoising is subjected to secondary denoising to obtain the final denoised signal. Based on this, the present invention can avoid the problem of treating part of the valid ECG signal as a noise signal and removing it in the traditional technology. At the same time, the dual denoising process is adopted to remove the residual noise in the initial denoised signal in the secondary denoising process. Therefore, the complete valid ECG signal can be retained while improving the denoising effect. The present invention is suitable for large-scale application and promotion in the field of ECG signal processing.
[0150] like Figure 2 As shown, the second aspect of this embodiment provides a hardware device for implementing the electrocardiogram signal denoising method described in the first aspect of the embodiment, including:
[0151] The feature extraction unit is used to acquire a target ECG signal and perform feature extraction processing on the target ECG signal to obtain multiple feature signal points of the target ECG signal, so as to use the multiple feature signal points to form a feature signal point sequence of the target ECG signal.
[0152] The first denoising unit is used to initialize the denoising times m and perform denoising on the target ECG signal based on the characteristic signal point sequence to obtain the effective ECG signal characteristic point sequence during the mth denoising and the noise signal characteristic point sequence during the mth denoising.
[0153] The first denoising unit is configured to determine whether the noise signal feature point sequence during the m-th denoising operation only includes noise signal feature points.
[0154] The first denoising unit is used to perform signal reconstruction processing on the effective ECG signal feature point sequence during the mth denoising and the noise signal feature point sequence during the mth denoising, when the judgment result is no, to obtain the effective reconstructed ECG signal sequence and the noise reconstructed signal sequence during the mth denoising.
[0155] The first denoising unit is configured to update the characteristic signal point sequence to the noise reconstructed signal sequence during the m-th denoising, add 1 to m, and re-perform denoising processing on the target ECG signal based on the characteristic signal point sequence until the noise signal characteristic point sequence during the m-th denoising contains only noise signal characteristic points, and then perform signal reconstruction processing on the effective ECG signal characteristic point sequence during the m-th denoising to obtain m effective reconstructed ECG signal sequences, wherein the initial value of m is 1.
[0156] The first denoising unit is further configured to perform signal superposition processing on the m valid reconstructed ECG signal sequences to obtain an initial denoised target ECG signal.
[0157] The second denoising unit is configured to perform denoising processing on the initial denoised target ECG signal again by using a wavelet transform algorithm, so as to obtain a denoised target ECG signal after the denoising processing is completed.
[0158] The working process, working details and technical effects of the device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0159] like Figure 3 As shown, the third aspect of this embodiment provides another electrocardiogram signal denoising device, taking the device as an electronic device as an example, comprising: a memory, a processor and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the electrocardiogram signal denoising method as described in the first aspect of the embodiment.
[0160] For example, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in first-out memory (FIFO), and / or first-in last-out memory (FILO); specifically, the processor may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor may be implemented in at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Furthermore, the processor may include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); and the coprocessor is a low-power processor for processing data in a standby state.
[0161] In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. For example, the processor may be, but is not limited to, a microprocessor of the STM32F105 series, a reduced instruction set computer (RISC) microprocessor, an X86 architecture processor, or a processor with an integrated embedded neural network processing unit (NPU); the transceiver may be, but is not limited to, a wireless fidelity (WIFI) wireless transceiver, a Bluetooth wireless transceiver, a general packet radio service technology (GPRS) wireless transceiver, a ZigBee protocol (a low-power local area network protocol based on the IEEE802.15.4 standard, ZigBee) wireless transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver. In addition, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0162] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0163] The fourth aspect of this embodiment provides a storage medium that stores instructions for the electrocardiogram signal denoising method described in the first aspect of the embodiment, that is, the storage medium stores instructions, and when the instructions are run on a computer, the electrocardiogram signal denoising method described in the first aspect is executed.
[0164] The storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive and / or a memory stick, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0165] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0166] A fifth aspect of this embodiment provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the electrocardiogram signal denoising method as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0167] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A method for denoising an electrocardiogram signal, characterized in that: include: Acquiring a target ECG signal and performing feature extraction processing on the target ECG signal to obtain a plurality of characteristic signal points of the target ECG signal, so as to form a characteristic signal point sequence of the target ECG signal using the plurality of characteristic signal points; Initializing the denoising times m, and performing denoising on the target ECG signal based on the characteristic signal point sequence, to obtain a valid ECG signal characteristic point sequence during the mth denoising and a noise signal characteristic point sequence during the mth denoising; Determining whether the noise signal feature point sequence during the m-th denoising operation contains only noise signal feature points; If not, performing signal reconstruction processing on the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising to obtain the effective reconstructed ECG signal sequence and the noise reconstructed signal sequence during the m-th denoising; Updating the characteristic signal point sequence to the noise reconstructed signal sequence during the m-th denoising, adding 1 to m, and re-performing denoising on the target ECG signal based on the characteristic signal point sequence until the noise signal characteristic point sequence during the m-th denoising contains only noise signal characteristic points, and then performing signal reconstruction on the effective ECG signal characteristic point sequence during the m-th denoising to obtain m effective reconstructed ECG signal sequences, wherein the initial value of m is 1; Performing signal superposition processing on the m valid reconstructed ECG signal sequences to obtain an initial denoised target ECG signal; The initial denoised target ECG signal is denoised again using a wavelet transform algorithm, so as to obtain a denoised target ECG signal after the denoising process is completed.
2. The method according to claim 1, characterized in that Performing feature extraction processing on the target ECG signal to obtain multiple feature signal points of the target ECG signal, including: Sampling the target ECG signal to obtain a sampling signal sequence, wherein the sampling signal points in the sampling signal sequence are arranged in descending order according to sampling time; Acquire feature extraction parameters, and perform feature extraction processing on the target ECG signal based on the feature extraction parameters and the sampling signal sequence and according to the following formula (1) to obtain multiple feature signal points of the target ECG signal; X a K[x(a),x(a+γ),x(a+2γ)+,...,x(a+(v-1)γ)],aD1,2,3,...,A (1) In the above formula (1), X a represents the a-th characteristic signal point, x(a) represents the a-th sampling signal point in the sampling signal sequence, γ represents the feature extraction delay time in the feature extraction parameters, v represents the feature extraction dimension in the feature extraction parameters, wherein A is the total number of characteristic signal points, A=n-(v-1)λ, and n represents the total number of sampling signal points.
3. The method according to claim 1, characterized in that Based on the characteristic signal point sequence, the target ECG signal is subjected to denoising processing to obtain an effective ECG signal characteristic point sequence during the mth denoising and a noise signal characteristic point sequence during the mth denoising, including: Using the characteristic signal point sequence and according to the following formula (2), a characteristic matrix of the target ECG signal at the time of m-th denoising is constructed; R m =XX T / A (2) In the above formula (2), R m represents the characteristic matrix during the mth denoising, X represents the matrix corresponding to the characteristic signal point sequence, and T represents the transposition operation, wherein X=[X1,X2,...,X A ], X A represents the Ath characteristic signal point in the characteristic signal point sequence, X A is a row vector containing v elements, and v represents the feature extraction dimension when the target ECG signal is subjected to feature extraction processing; Performing singular value decomposition on the characteristic matrix during the m-th denoising to obtain a number of singular values and a eigenvector corresponding to each of the singular values; Sorting the singular values in descending order, and constructing an energy spectrum image of the target ECG signal at the time of m-th denoising using the sorted singular values, wherein the energy spectrum image at the time of m-th denoising includes a plurality of energy points, and each energy point corresponds to a singular value and a eigenvector corresponding to the singular value; Based on the energy spectrum image during the m-th denoising, the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising are determined, wherein the effective ECG signal feature point sequence during the m-th denoising includes a plurality of first energy points, the noise signal feature point sequence during the m-th denoising includes a plurality of second energy points, the first target energy point is greater than the second target energy point, and the first target energy point is the first energy point with the smallest singular value among the plurality of first energy points, and the second target energy point is the second energy point with the largest singular value among the plurality of second energy points.
4. The method according to claim 3, characterized in that Performing signal reconstruction processing on the effective electrocardiogram signal feature point sequence during the m-th denoising to obtain an effective reconstructed electrocardiogram signal sequence during the m-th denoising, including: Based on the effective ECG signal feature point sequence during the m-th denoising, and according to the following formula (3), the signal reconstruction coefficient of each first energy point in the effective ECG signal feature point sequence during the m-th denoising is calculated; In the above formula (3), represents the signal reconstruction coefficient of the kth first energy point in the effective ECG signal feature point sequence during the mth denoising, x(i+j)∈x, x represents the sampling signal sequence of the target ECG signal, wherein the sampling signals in the sampling signal sequence are arranged in order from the earliest to the latest sampling time, x(i+j) represents the i+jth sampling signal in the sampling signal sequence, q k represents the eigenvector corresponding to the kth first energy point, k=1, 2, ..., K, K represents the total number of first energy points, and n represents the total number of sampled signals; Based on the signal reconstruction coefficient of each first energy point and the eigenvector corresponding to each first energy point, an effective reconstructed electrocardiogram signal point of each first energy point during the mth denoising is obtained; The effective reconstructed ECG signal points of each first energy point during the m-th denoising are used to form the effective reconstructed ECG signal sequence during the m-th denoising.
5. The method according to claim 1, wherein Using a wavelet transform algorithm, the initial denoised target ECG signal is subjected to denoising processing again to obtain a denoised target ECG signal after the denoising processing is completed, including: Using a wavelet transform algorithm, the initial denoised target ECG signal is subjected to multi-scale decomposition to obtain wavelet transform signals at different decomposition scales, wherein any ECG signal point in the wavelet transform signal at any decomposition scale corresponds to a wavelet coefficient; Calculating the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale, and calculating the denoising standard coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale based on the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale; For any wavelet coefficient in any wavelet transform signal at each decomposition scale, determining whether a denoising coefficient of the wavelet coefficient is greater than a denoising standard coefficient corresponding to the wavelet coefficient; If yes, any of the wavelet coefficients is set to 0, and after all the wavelet coefficients in all the wavelet transform signals are processed, a pre-processed wavelet transform signal corresponding to each wavelet transform signal is obtained; Calculating the noise reduction threshold based on the wavelet coefficients corresponding to each ECG signal point in each preprocessed wavelet transform signal; Based on the de-noising threshold, updating each wavelet coefficient in the wavelet transform signal at each decomposition scale, so as to obtain a denoised wavelet transform signal corresponding to each wavelet transform signal after the coefficient is updated; Signal reconstruction processing is performed on each denoised wavelet transformed signal to obtain the denoised target electrocardiogram signal after the signal reconstruction processing.
6. The method according to claim 5, characterized in that Calculate the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale, including: For any ECG signal point in the wavelet transform signal at any decomposition scale, the denoising coefficient of any ECG signal point is calculated using the following formula (4); S z,g =ω z,g ·oh z+1,g (4) In the above formula (4), S z,g represents the denoising coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z,g represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω z+1,g represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z+1, z=1,2,...,Z, g=1,2,...,G, where Z represents the maximum decomposition scale and G represents the total number of ECG signal points in the wavelet transform signal at the decomposition scale z; Accordingly, based on the denoising coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale, the denoising standard coefficient of each ECG signal point in the wavelet transform signal at each decomposition scale is calculated, which includes: For any ECG signal point in the wavelet transform signal at any decomposition scale, the denoising standard coefficient of any ECG signal point is calculated using the denoising coefficient of the any ECG signal point and according to the following formula (5); In the above formula (5), B z,g represents the denoising standard coefficient of the g-th ECG signal point in the wavelet transform signal under the decomposition scale z, U ω (g) represents the first intermediate parameter, U S (g) represents the second intermediate parameter; 7. The method according to claim 5, characterized in that Based on the noise reduction threshold, each wavelet coefficient in the wavelet transform signal at each decomposition scale is updated, including: For any wavelet coefficient in the wavelet transform signal at any decomposition scale, update the coefficient of any wavelet coefficient in the wavelet transform signal at any decomposition scale according to the following formula (8); In the above formula (8), ω z,g Represents the wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at the decomposition scale z, ω′ z,g represents the updated wavelet coefficient of the g-th ECG signal point in the wavelet transform signal at decomposition scale z, sgn() represents the sign function, β and ε represent update constants, h represents the denoising threshold, and G represents the total number of ECG signal points in the wavelet transform signal at decomposition scale z, where z = 1, 2, ..., Z, g = 1, 2, ..., G, and Z represents the maximum decomposition scale.
8. A device for denoising an electrocardiogram signal, characterized in that: include: a feature extraction unit, configured to acquire a target ECG signal and perform feature extraction processing on the target ECG signal to obtain a plurality of feature signal points of the target ECG signal, so as to form a feature signal point sequence of the target ECG signal using the plurality of feature signal points; A first denoising unit is configured to initialize m denoising times and perform denoising on the target ECG signal based on the characteristic signal point sequence to obtain a valid ECG signal characteristic point sequence at the mth denoising time and a noise signal characteristic point sequence at the mth denoising time; A first denoising unit is configured to determine whether the noise signal feature point sequence during the m-th denoising operation contains only noise signal feature points; a first denoising unit, configured to, when the judgment result is negative, perform signal reconstruction processing on the effective ECG signal feature point sequence during the m-th denoising and the noise signal feature point sequence during the m-th denoising, to obtain an effective reconstructed ECG signal sequence and a noise reconstructed signal sequence during the m-th denoising; a first denoising unit, configured to update the characteristic signal point sequence to the noise reconstructed signal sequence during the m-th denoising, increment m by 1, and re-perform denoising on the target ECG signal based on the characteristic signal point sequence until the noise signal characteristic point sequence during the m-th denoising contains only noise signal characteristic points, and then perform signal reconstruction on the effective ECG signal characteristic point sequence during the m-th denoising to obtain m effective reconstructed ECG signal sequences, wherein the initial value of m is 1; The first denoising unit is further configured to perform signal superposition processing on the m valid reconstructed ECG signal sequences to obtain an initial denoised target ECG signal; The second denoising unit is configured to perform denoising processing on the initial denoised target ECG signal again by using a wavelet transform algorithm, so as to obtain a denoised target ECG signal after the denoising processing is completed.
9. An electronic device, characterized in that: include: A memory, a processor, and a transceiver that are sequentially communicatively connected, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the electrocardiogram signal denoising method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed on a computer, the electrocardiogram signal denoising method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Electrocardiosignal denoising method adopting wavelet entropy threshold value based on EEMD
CN108338784A
Automatic noise reduction method of dynamic electrocardiograms
CN110840445A