Electrocardio waveform noise reduction method and device
By detecting the R wave peak and RR interval, dynamically adjusting the noise reduction threshold, local and adaptive noise reduction of the ECG signal is solved, and the balance between noise reduction effect and calculation complexity and power consumption in the prior art is solved, and high-efficiency and low-power noise removal is achieved.
Patent Information
- Application Number
- CN202510166894.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-03
AI Technical Summary
In the prior art, when denoising the ECG signal, it is difficult to find a balance between noise reduction effect, calculation complexity and power consumption, especially in low-power embedded systems, there are resource limitations.
By detecting the R wave peak, determining the average value of the RR interval and the R wave peak, dynamically adjusting the noise reduction threshold, local processing and adaptive noise reduction on the original ECG signal.
It realizes efficient removal of ECG signal noise in low-power systems, retains key signal characteristics, and reduces system power consumption, and is suitable for various heart rate ranges.
Smart Images

Figure CN120078425A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of medical diagnosis, and particularly to a method and device for noise reduction of electrocardiogram waveforms. Background Art
[0002] As a direct reflection of heart activities, the electrocardiogram (ECG) is crucial for clinical diagnosis and treatment in terms of its accuracy. However, during the acquisition process, the electrocardiogram signal is vulnerable to various noises, such as electrode contact noise, electromyographic noise, and power frequency interference. Therefore, it is necessary to process these noises. Common traditional filtering methods include low-pass filtering, high-pass filtering, band-pass filtering, and adaptive filtering. Although traditional filtering methods can effectively remove certain specific types of noises, they usually require global processing of the entire signal, resulting in a large amount of computation and high power consumption. Although adaptive filtering can dynamically adjust filtering parameters according to signal characteristics, the algorithm is complex and requires high computing power and storage resources. Wavelet transform and Fourier transform can provide time-frequency analysis of signals, but they also face the problem of high computational complexity. It can be seen that although these methods in the prior art can remove noises to a certain extent, they are usually accompanied by complex algorithm implementations, which is particularly problematic in resource-constrained low-power embedded systems.
[0003] That is to say, current filtering methods are difficult to find a balance among noise reduction effect, computational complexity, and power consumption, which makes it face significant resource limitations when applying traditional filtering methods in low-power embedded systems. Therefore, developing new methods that can effectively reduce noise and adapt to these system constraints will be an important research direction in the field of electrocardiogram signal processing. Summary of the Invention
[0004] The purpose of the present application aims to solve at least one of the above technical defects.
[0005] On the one hand, embodiments of the present application provide a method for noise reduction of electrocardiogram waveforms, the method including:
[0006] Obtain an original electrocardiogram signal, and perform R-wave peak detection processing on the original electrocardiogram signal to determine a plurality of R-wave peaks corresponding to the original electrocardiogram signal;
[0007] According to the plurality of R-wave peaks corresponding to the original electrocardiogram signal, determine the average value of the R-wave peaks corresponding to the original electrocardiogram signal;
[0008] Obtain the time interval information between the plurality of R-wave peaks, and determine the RR interval according to the time interval information, where the RR interval includes the time information of each threshold interval;
[0009] Determine the dynamic thresholds corresponding to each threshold interval according to the average value of the R-wave peaks and the RR intervals, and perform noise reduction processing on the original electrocardiogram (ECG) signal according to the dynamic thresholds corresponding to each threshold interval to obtain the denoised ECG signal.
[0010] Optionally, perform R-wave peak detection processing on the original ECG signal to determine multiple R-wave peaks corresponding to the original ECG signal, including:
[0011] Perform R-wave peak detection processing on the original ECG signal through the Pan-Tompkins algorithm to determine multiple R-wave peaks corresponding to the original ECG signal.
[0012] Optionally, perform R-wave peak detection processing on the original ECG signal through the Pan-Tompkins algorithm to determine multiple R-wave peaks corresponding to the original ECG signal, including:
[0013] Perform initial processing on the original ECG signal to obtain the processed ECG signal. The initial processing includes at least one of filtering processing, squaring operation processing, and integration operation processing;
[0014] Obtain a first detection threshold and a second detection threshold, where the second detection threshold is half of the first detection threshold;
[0015] Perform R-wave peak detection processing on the processed ECG signal based on the first detection threshold to obtain multiple initial R-wave peaks;
[0016] Screen the multiple initial R-wave peaks based on the second detection threshold, and use the initial R-wave peaks with wave peaks greater than the second detection threshold as the multiple R-wave peaks corresponding to the original ECG signal.
[0017] Optionally, the multiple R-wave peaks are eight R-wave peaks consecutive with the first R-wave peak. According to the multiple R-wave peaks corresponding to the original ECG signal, determine the average value of the R-wave peaks corresponding to the original ECG signal, including:
[0018] Determine the average value of the R-wave peaks corresponding to the original ECG signal according to eight R-wave peaks consecutive with the first R-wave peak.
[0019] Optionally, the time interval information includes the sampling frequency during R-wave peak detection processing and the number of samples corresponding to two consecutive R-wave peaks. Determine the RR interval through the following formula:
[0020]
[0021] where N is the number of samples corresponding to two consecutive R-wave peaks, and F is the sampling frequency during R-wave peak detection processing.
[0022] Optionally, denoise the original electrocardiogram (ECG) signal according to the dynamic thresholds corresponding to each threshold interval to obtain the denoised ECG signal, including:
[0023] Compare the original ECG signal with the dynamic thresholds corresponding to each threshold interval, and denoise the signals in the original ECG signal that are greater than the dynamic thresholds to obtain the denoised ECG signal.
[0024] Optionally, each threshold interval includes the Blank interval before the R-wave peak, within 120 ms after the R-wave peak, the interval from RR_interval after the R-wave peak to 180 ms, within 200 ms to 500 ms after the R-wave peak, and after 500 ms after the R-wave peak.
[0025] Optionally, no dynamic threshold is set for the Blank interval, the dynamic threshold corresponding to within 120 m after the R-wave peak is the average value of the R-wave peaks, the dynamic threshold corresponding to the interval from RR_interval after the R-wave peak to 180 ms is 50% of the average value of the R-wave peaks, the dynamic threshold corresponding to within 200 ms to 500 ms after the R-wave peak is 25% of the average value of the R-wave peaks, and the dynamic threshold corresponding to after 500 ms after the R-wave peak is 12.5% of the average value of the R-wave peaks.
[0026] Optionally, after obtaining the denoised ECG signal, it further includes:
[0027] Smooth the denoised ECG signal and use the smoothed ECG signal as the final ECG signal.
[0028] On the other hand, an embodiment of the present application provides a device for denoising an ECG waveform. The device includes:
[0029] A signal acquisition module, configured to acquire the original ECG signal, perform R-wave peak detection processing on the original ECG signal, and determine multiple R-wave peaks corresponding to the original ECG signal;
[0030] An average value determination module, configured to determine the average value of the R-wave peaks corresponding to the original ECG signal according to the multiple R-wave peaks corresponding to the original ECG signal;
[0031] An interval determination module, configured to obtain the time interval information between multiple R-wave peaks, and determine the RR interval according to the time interval information. The RR interval includes the time information of each threshold interval;
[0032] A denoising processing module, configured to determine the dynamic thresholds corresponding to each threshold interval according to the average value of the R-wave peaks and the RR interval, and denoise the original ECG signal according to the dynamic thresholds corresponding to each threshold interval to obtain the denoised ECG signal.
[0033] Optionally, when the signal acquisition module performs R-wave peak detection processing on the original electrocardiogram signal to determine multiple R-wave peaks corresponding to the original electrocardiogram signal, it is specifically used for:
[0034] Performing R-wave peak detection processing on the original electrocardiogram signal through the Pan-Tompkins algorithm to determine multiple R-wave peaks corresponding to the original electrocardiogram signal.
[0035] Optionally, when the signal acquisition module performs R-wave peak detection processing on the original electrocardiogram signal through the Pan-Tompkins algorithm to determine multiple R-wave peaks corresponding to the original electrocardiogram signal, it is specifically used for:
[0036] Performing initial processing on the original electrocardiogram signal to obtain a processed electrocardiogram signal, where the initial processing includes at least one of filtering processing, squaring operation processing, and integration operation processing;
[0037] Obtaining a first detection threshold and a second detection threshold, where the second detection threshold is half of the first detection threshold;
[0038] Performing R-wave peak detection processing on the processed electrocardiogram signal based on the first detection threshold to obtain multiple initial R-wave peaks;
[0039] Screening the multiple initial R-wave peaks based on the second detection threshold, and taking the initial R-wave peaks with wave peaks greater than the second detection threshold as the multiple R-wave peaks corresponding to the original electrocardiogram signal.
[0040] Optionally, the multiple R-wave peaks are eight R-wave peaks consecutive to the first R-wave peak. When the mean determination module determines the average value of the R-wave peaks corresponding to the original electrocardiogram signal according to the multiple R-wave peaks corresponding to the original electrocardiogram signal, it is specifically used for:
[0041] Determining the average value of the R-wave peaks corresponding to the original electrocardiogram signal according to eight R-wave peaks consecutive to the first R-wave peak.
[0042] Optionally, the time interval information includes the sampling frequency during R-wave peak detection processing and the number of samples corresponding to two consecutive R-wave peaks. The inter-beat interval determination module determines the RR interval through the following formula:
[0043]
[0044] where N is the number of samples corresponding to two consecutive R-wave peaks, and F is the sampling frequency during R-wave peak detection processing.
[0045] Optionally, when the noise reduction processing module performs noise reduction processing on the original electrocardiogram signal according to the dynamic threshold corresponding to each threshold interval to obtain a noise-reduced electrocardiogram signal, it is specifically used for:
[0046] Compare the original electrocardiogram (ECG) signal with the dynamic thresholds corresponding to each threshold interval, and perform noise reduction on the signals in the original ECG signal that are greater than the dynamic thresholds to obtain the denoised ECG signal.
[0047] Optionally, each threshold interval includes the Blank interval before the R-wave peak, within 120 ms after the R-wave peak, the interval from RR_interval after the R-wave peak to 180 ms, within 200 ms to 500 ms after the R-wave peak, and after 500 ms after the R-wave peak.
[0048] Optionally, no dynamic threshold is set for the Blank interval, the dynamic threshold corresponding to within 120 m after the R-wave peak is the average value of the R-wave peak, the dynamic threshold corresponding to the interval from RR_interval after the R-wave peak to 180 ms is 50% of the average value of the R-wave peak, the dynamic threshold corresponding to within 200 ms to 500 ms after the R-wave peak is 25% of the average value of the R-wave peak, and the dynamic threshold corresponding to after 500 ms after the R-wave peak is 12.5% of the average value of the R-wave peak.
[0049] Optionally, after obtaining the denoised ECG signal, the noise reduction processing module is further configured to:
[0050] Perform smoothing processing on the denoised ECG signal and use the smoothed ECG signal as the final ECG signal.
[0051] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory:
[0052] The memory is configured to store machine-readable instructions, and when the instructions are executed by the processor, the processor executes any one of the methods in a method for noise reduction of an electrocardiogram waveform.
[0053] The beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:
[0054] In the present application, the RR interval and the average value of the R-wave peak are determined by the detected R-wave peak, and then the dynamic thresholds for noise reduction processing are determined based on the RR interval and the average value of the R-wave peak, that is, the R-wave peak and the RR interval are combined to dynamically adjust the noise reduction threshold, realizing the combination of local processing and adaptive noise reduction. At this time, compared with traditional filtering methods, it can more effectively remove the noise in the ECG signal while retaining the key features of the signal.
[0055] In the present application, during the noise reduction processing, it only needs to compare the original ECG signal with the dynamic thresholds corresponding to each threshold interval to complete the noise reduction processing. The algorithm implementation is simpler, the calculation amount is smaller, global processing is avoided, thereby reducing the system power consumption, and thus it can be applied to various low-power embedded systems.
[0056] In the present application, since the noise reduction algorithm only requires the electrocardiogram (ECG) signal to complete and has no requirement for the rate of the ECG signal, it can be applied to the noise reduction processing of various heart rate ranges, and the application range is wider. Moreover, the smoothed processing can be performed on the denoised ECG signal, further reducing the noise and improving the signal quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0058] Figure 1 It is a schematic flowchart of a method for reducing noise of an electrocardiogram waveform provided by an embodiment of the present application;
[0059] Figure 2 It is a schematic diagram of an electrocardiogram waveform provided by an embodiment of the present application;
[0060] Figure 3 It is a schematic structural diagram of a device for reducing noise of an electrocardiogram waveform provided by an embodiment of the present application;
[0061] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0062] The following will describe in detail the embodiments of the present application. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present application, and cannot be construed as a limitation of the present invention.
[0063] Those skilled in the art of the present technology can understand that unless specifically stated, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "including" used in the specification of the present application means the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more related listed items.
[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe the embodiments of this application in detail with reference to the accompanying drawings.
[0065] The following uses specific embodiments to elaborate in detail on the technical solutions of this application and how the technical solutions of this application solve the above technical problems. These several specific embodiments below can be combined with each other, and concepts or processes that are the same or similar may not be repeated in some embodiments. The following will describe the embodiments of this application with reference to the accompanying drawings.
[0066] Specifically, as Figure 1 shown, the method may include:
[0067] Step S101, obtain the original electrocardiogram (ECG) signal, perform R-wave peak detection processing on the original ECG signal, and determine multiple R-wave peaks corresponding to the original ECG signal.
[0068] Optionally, the specific manner of obtaining the original ECG signal can be set according to actual needs, and this application embodiment does not limit this. For example, an ECG monitor or a related bioelectric sensor can be used to obtain the original ECG signal. In order to ensure signal quality, signal acquisition needs to be performed under normal physiological conditions when collecting the ECG signal, and then the collected signal is saved in a digital format (such as a CSV file, a MAT file, etc.) for subsequent processing.
[0069] Furthermore, R-wave peak detection processing can be performed on the original ECG signal to determine multiple R-wave peaks corresponding to the original ECG signal. Among them, in order to improve the accuracy of peak detection, before performing R-wave detection, preprocessing can be performed on the original ECG signal. For example, filtering techniques can be applied to remove baseline drift and various noises (such as power frequency interference, electromyographic noise, etc.), and then the signal can be normalized or standardized according to needs to reduce the impact of amplitude differences on peak detection.
[0070] In an optional embodiment of this application, performing R-wave peak detection processing on the original ECG signal to determine multiple R-wave peaks corresponding to the original ECG signal includes:
[0071] Performing R-wave peak detection processing on the original ECG signal through the Pan-Tompkins algorithm to determine multiple R-wave peaks corresponding to the original ECG signal.
[0072] Optionally, when performing R-wave peak detection on the original ECG signal, the Pan-Tompkins algorithm can be used for detection, and this algorithm can effectively detect R waves from the ECG signal. It can be understood that when the actual situation does not meet the detection conditions of the Pan-Tompkins algorithm, other algorithms can also be used for R-wave peak detection, that is, the embodiments of the present application do not specifically limit the method of R-wave peak detection.
[0073] In an optional embodiment of the present application, the Pan-Tompkins algorithm is used to perform R-wave peak detection on the original ECG signal to determine multiple R-wave peaks corresponding to the original ECG signal, including:
[0074] Perform initial processing on the original ECG signal to obtain a processed ECG signal, and the initial processing includes at least one of filtering processing, squaring operation processing, and integration operation processing;
[0075] Obtain a first detection threshold and a second detection threshold, and the second detection threshold is half of the first detection threshold;
[0076] Based on the first detection threshold, perform R-wave peak detection on the processed ECG signal to obtain multiple initial R-wave peaks;
[0077] Based on the second detection threshold, screen the multiple initial R-wave peaks, and use the initial R-wave peaks with wave peaks greater than the second detection threshold as the multiple R-wave peaks corresponding to the original ECG signal.
[0078] Optionally, when using the Pan-Tompkins algorithm to perform R-wave peak detection on the original ECG signal, multiple steps such as filtering, differentiation, squaring, and integration are combined to improve the detection accuracy and sensitivity of R-wave peaks. Specifically, after obtaining the original ECG signal, a band-pass filter (usually between 0.5 Hz and 50 Hz) can be used to remove interference such as low-frequency and high-frequency noise to retain the main features of the ECG signal. Further, the filtered signal can be differentiated to enhance the R wave and suppress the T wave, and it can also help detect the rising and falling slopes of the signal, thereby highlighting the characteristics of the R wave.
[0079] Correspondingly, after differentiating the filtered signal, the differentiated signal can be squared to further enhance the R-wave peak, thereby avoiding the influence of negative values on peak detection, and then the signal is smoothed by moving window integration to obtain a processed ECG signal. Among them, the window is usually set to 200 ms (about 50 sampling points at a sampling rate of 250 Hz), and this will help generate a smooth signal for subsequent peak detection.
[0080] Optionally, after obtaining the processed electrocardiogram (ECG) signal, a first detection threshold and a second detection threshold can be obtained. Then, based on the first detection threshold, R-wave peak detection processing is performed on the processed ECG signal to obtain a plurality of initial R-wave peaks, where the obtained initial R-wave peaks are greater than the first detection threshold. Further, the measured initial R-wave peaks are traversed and the amplitudes of these peaks are checked. When the amplitude is greater than the second detection threshold, the R-wave peak is used as the R-wave peak corresponding to the original ECG signal. Among them, the mean value of the processed ECG signal can be used as the first detection threshold, or the first detection threshold can be set according to the standard deviation of the ECG signal, and the second detection threshold can be set to half of the first detection threshold.
[0081] In the embodiment of the present application, a mechanism using two detection thresholds for R-wave peak detection can not only improve the accuracy of R-wave detection, but also reduce false detection caused by signal noise, and is particularly suitable for processing real-time ECG signals in resource-constrained environments.
[0082] Step S102: Determine the average value of the R-wave peaks corresponding to the original ECG signal according to the plurality of R-wave peaks corresponding to the original ECG signal.
[0083] Optionally, after obtaining the plurality of R-wave peaks corresponding to the original ECG signal, an average value calculation can be performed based on the plurality of R-wave peaks to obtain the average value of the corresponding R-wave peaks (denoted as Rpeak).
[0084] In an alternative embodiment of the present application, the plurality of R-wave peaks are eight R-wave peaks consecutive to the first R-wave peak. Determining the average value of the R-wave peaks corresponding to the original ECG signal according to the plurality of R-wave peaks corresponding to the original ECG signal includes:
[0085] Determine the average value of the R-wave peaks corresponding to the original ECG signal according to the eight R-wave peaks consecutive to the first R-wave peak.
[0086] Optionally, the plurality of R-wave peaks in the present application refer to eight R-wave peaks consecutively detected when the first R-wave peak is detected during the R-wave peak detection process. The acquisition situations corresponding to these eight R-wave peaks are also different under different conditions of the original ECG signal.
[0087] Optionally, when the original ECG signal is a real-time acquired ECG signal, the eight R-wave peaks refer to the R-wave peaks of the previous 8 heartbeats from the current position. For example, if the R-wave peak corresponding to each heartbeat is denoted as R1, R2, ... Rn, then the eight R-wave peaks are Rn-7, Rn-6......Rn-1, Rn, and the average value of the R-wave peaks = (Rn-7 + Rn-6......Rn-1 + Rn) / 8. When the original ECG signal is a previously stored ECG signal, the eight R-wave peaks refer to the R-wave peaks of 8 consecutive heartbeats detected after detecting the first R-wave peak. For example, if the R-wave peak corresponding to each heartbeat is denoted as R1, R2, ... Rn, then the eight R-wave peaks are R1, R2, ... R8, and the average value of the R-wave peaks = (R1 + 2......R7 + R8) / 8.
[0088] Step S103, obtain the time interval information between multiple R-wave peaks, and determine the RR interval according to the time interval information. The RR interval includes the time information of each threshold interval.
[0089] Among them, the RR interval refers to the time interval between two consecutive R waves, usually expressed in milliseconds (ms), and the RR interval is very important in electrocardiogram (ECG) analysis and can reflect heart rate and cardiac function. Based on this, in this application, the time interval information between multiple R-wave peaks can be obtained, and then the RR interval can be further determined according to the obtained time interval information. The RR interval includes the time information of each threshold interval, and each threshold interval refers to a time interval where the thresholds are all the same value.
[0090] In an optional embodiment of the present application, the time interval information includes the sampling frequency during R-wave peak detection processing and the number of samples corresponding to two consecutive R-wave peaks. The RR interval is determined by the following formula:
[0091]
[0092] Among them, N is the number of samples corresponding to two consecutive R-wave peaks, and F is the sampling frequency during R-wave peak detection processing.
[0093] Optionally, the obtained time interval information includes the sampling frequency during R-wave peak detection processing and the number of samples corresponding to two consecutive R-wave peaks. The number of samples corresponding to two consecutive R-wave peaks refers to the number of sample points between one R-wave peak and the next R-wave peak in the digitized electrocardiogram (ECG) signal.
[0094] Furthermore, the RR interval can be obtained based on the RR interval calculation formula. Assume that the sampling frequency during R-wave peak detection processing is 128Hz and the number of samples corresponding to two consecutive R-wave peaks is 256 numbers. Then the RR interval = 1000 / 128 * 256 = 2000ms.
[0095] Step S104: Determine the dynamic thresholds corresponding to each threshold interval according to the average value of R-wave peaks and the RR interval, and perform noise reduction processing on the original electrocardiogram (ECG) signal based on the dynamic thresholds corresponding to each threshold interval to obtain the denoised ECG signal.
[0096] Optionally, after obtaining the average value of R-wave peaks and the RR interval, the dynamic thresholds corresponding to each threshold interval included in the RR interval can be determined based on the average value of R-wave peaks, and then the original ECG signal is subjected to noise reduction processing according to the dynamic thresholds corresponding to each threshold interval to obtain the denoised ECG signal.
[0097] In an alternative embodiment of the present application, each threshold interval includes a Blank interval before the R-wave peak, within 120 ms after the R-wave peak, the interval from RR_interval after the R-wave peak to 180 ms, within 200 ms to 500 ms after the R-wave peak, and after 500 ms after the R-wave peak.
[0098] In an alternative embodiment of the present application, no dynamic threshold is set for the Blank interval, the dynamic threshold corresponding to within 120 m after the R-wave peak is the average value of the R-wave peaks, the dynamic threshold corresponding to within RR_interval - 180 ms after the R-wave peak is 50% of the average value of the R-wave peaks, the dynamic threshold corresponding to within 200 ms to 500 ms after the R-wave peak is 25% of the average value of the R-wave peaks, and the dynamic threshold corresponding to after 500 ms after the R-wave peak is 12.5% of the average value of the R-wave peaks.
[0099] Optionally, in the present application, no dynamic threshold is set within the Blank interval (such as 50 ms) before the R-wave peak, that is, the ECG signal within this threshold interval is not filtered to preserve signal integrity. The dynamic threshold is set to 100% Rpeak (i.e., the average value of the R-wave peaks) within 120 ms after the R-wave peak, and at this time, the high-amplitude noise following the R-wave can be removed. The dynamic threshold is set to 50% Rpeak within the subsequent RR_interval - 180 ms time period, and at this time, the medium-amplitude noise can be removed. While the dynamic threshold corresponding to within 200 ms to 500 ms after the R-wave peak is 25% Rpeak, and the dynamic threshold corresponding to after 500 ms after the R-wave peak is 12.5% Rpeak, then finer filtering can be performed.
[0100] In the embodiment of the present application, performing noise reduction processing on the original ECG signal according to the dynamic thresholds corresponding to each threshold interval to obtain the denoised ECG signal includes:
[0101] Compare the original electrocardiogram (ECG) signal with the dynamic thresholds corresponding to each threshold interval, and perform noise reduction processing on the signals in the original ECG signal that are greater than the dynamic thresholds to obtain the denoised ECG signal.
[0102] Optionally, after determining the dynamic thresholds corresponding to each threshold interval within the RR interval, for each R wave in the original ECG signal, each R wave can be compared with the dynamic threshold. If the value of the R wave is higher than the dynamic threshold of the corresponding interval, that part of the ECG signal is regarded as noise and removed. If the value of the R wave is not higher than the dynamic threshold of the corresponding interval, that part of the ECG signal is retained.
[0103] For example, assume the original ECG signal is as Figure 2 shown. The original ECG signal includes P waves, QRS waves, T waves, and R waves. The R wave includes a Blank interval, 120 ms after the R wave peak, and the subsequent RR_interval - 180 ms time period. No dynamic threshold is set within the Blank interval. The dynamic threshold within 120 ms after the R wave peak is 100% Rpeak, and the dynamic threshold within the subsequent RR_interval - 180 ms time period is 50% Rpeak. Further, the dynamic thresholds corresponding to each threshold interval shown in Figure 2 can be compared with the original ECG signal. The signal parts higher than the threshold are regarded as noise and removed, and the signal parts lower than or equal to the threshold are retained to obtain the denoised ECG signal.
[0104] In an alternative embodiment of the present application, after obtaining the denoised ECG signal, it further includes:
[0105] Perform smoothing processing on the denoised ECG signal, and use the smoothed ECG signal as the final ECG signal.
[0106] Optionally, there may be some filtering traces in the denoised ECG signal. At this time, the denoised ECG signal can be smoothed to further reduce noise and improve the signal quality. The specific method used for smoothing processing can be set according to actual needs and is not limited in the embodiments of the present application. For example, mean filtering, median filtering, Gaussian filtering, and Savitzky-Golay filtering can be used. Among them, mean filtering calculates the average value of the surrounding points for each point of the signal; median filtering takes the median value of the surrounding points for each point of the signal, and this method can effectively remove impulse noise; Gaussian filtering uses a Gaussian function to weight the signal to gently smooth the signal; and Savitzky-Golay filtering smooths the signal through polynomial fitting to maintain the characteristics of the signal.
[0107] In this application, a noise reduction method with a dynamic threshold is used to process the electrocardiogram (ECG) signal. Compared with traditional filtering methods, it can more effectively remove the noise in the ECG signal while retaining the key features of the signal. In addition, during the noise reduction process, only the original ECG signal needs to be compared with the dynamic thresholds corresponding to each threshold interval to complete the noise reduction process. The algorithm implementation is simpler, with a smaller computational load, and it can be applied to low-power embedded systems.
[0108] In addition, since the noise reduction algorithm in this application is simpler to implement and has a smaller computational load, global processing can be avoided at this time, significantly reducing the system power consumption. Moreover, it is applicable to various heart rate ranges, including low heart rates (such as 30 bpm), medium heart rates (such as 80 bpm), and high heart rates (such as 200 bpm), etc., with a wider application range.
[0109] An embodiment of this application provides a noise reduction device for an ECG waveform, as Figure 3 shown. The access device may include: a signal acquisition module 301, a mean determination module 302, an interval determination module 303, and a noise reduction processing module 304, where
[0110] The signal acquisition module is configured to acquire the original ECG signal, perform R-wave peak detection processing on the original ECG signal, and determine a plurality of R-wave peaks corresponding to the original ECG signal;
[0111] The mean determination module is configured to determine the average value of the R-wave peaks corresponding to the original ECG signal according to the plurality of R-wave peaks corresponding to the original ECG signal;
[0112] The interval determination module is configured to obtain the time interval information between a plurality of R-wave peaks, and determine the RR interval according to the time interval information. The RR interval includes the time information of each threshold interval;
[0113] The noise reduction processing module is configured to determine the dynamic thresholds corresponding to each threshold interval according to the average value of the R-wave peaks and the RR interval, and perform noise reduction processing on the original ECG signal according to the dynamic thresholds corresponding to each threshold interval to obtain the noise-reduced ECG signal.
[0114] Optionally, when the signal acquisition module performs R-wave peak detection processing on the original ECG signal to determine a plurality of R-wave peaks corresponding to the original ECG signal, it is specifically configured to:
[0115] Perform R-wave peak detection processing on the original ECG signal through the Pan-Tompkins algorithm to determine a plurality of R-wave peaks corresponding to the original ECG signal.
[0116] Optionally, when the signal acquisition module performs R-wave peak detection processing on the original ECG signal through the Pan-Tompkins algorithm to determine a plurality of R-wave peaks corresponding to the original ECG signal, it is specifically configured to:
[0117] Perform initial processing on the original electrocardiogram (ECG) signal to obtain the processed ECG signal. The initial processing includes at least one of filtering processing, squaring operation processing, and integration operation processing;
[0118] Obtain a first detection threshold and a second detection threshold, where the second detection threshold is half of the first detection threshold;
[0119] Perform R-wave peak detection processing on the processed ECG signal based on the first detection threshold to obtain multiple initial R-wave peaks;
[0120] Screen the multiple initial R-wave peaks based on the second detection threshold, and use the initial R-wave peaks with wave crests greater than the second detection threshold as the multiple R-wave peaks corresponding to the original ECG signal.
[0121] Optionally, the multiple R-wave peaks are eight consecutive R-wave peaks starting from the first R-wave peak. When the mean determination module determines the average value of the R-wave peaks corresponding to the original ECG signal according to the multiple R-wave peaks corresponding to the original ECG signal, it is specifically used for:
[0122] Determine the average value of the R-wave peaks corresponding to the original ECG signal according to eight consecutive R-wave peaks starting from the first R-wave peak.
[0123] Optionally, the time interval information includes the sampling frequency during R-wave peak detection processing and the number of samples corresponding to two consecutive R-wave peaks. The inter-beat interval determination module determines the RR interval through the following formula:
[0124]
[0125] where N is the number of samples corresponding to two consecutive R-wave peaks, and F is the sampling frequency during R-wave peak detection processing.
[0126] Optionally, when the noise reduction processing module performs noise reduction processing on the original ECG signal according to the dynamic threshold corresponding to each threshold interval to obtain the noise-reduced ECG signal, it is specifically used for:
[0127] Compare the original ECG signal with the dynamic threshold corresponding to each threshold interval, and perform noise reduction processing on the signal in the original ECG signal that is greater than the dynamic threshold to obtain the noise-reduced ECG signal.
[0128] Optionally, each threshold interval information includes the Blank interval before the R-wave peak, within 120 ms after the R-wave peak, the interval from RR_interval after the R-wave peak to 180 ms, within 200 ms to 500 ms after the R-wave peak, and after 500 ms after the R-wave peak.
[0129] Optionally, no dynamic threshold is set for the Blank interval. The dynamic threshold corresponding to the 120 ms after the R-wave peak is the average value of the R-wave peak. The dynamic threshold corresponding to the period from the RR_interval after the R-wave peak to 180 ms is 50% of the average value of the R-wave peak. The dynamic threshold corresponding to the period from 200 ms to 500 ms after the R-wave peak is 25% of the average value of the R-wave peak. The dynamic threshold corresponding to the period after 500 ms after the R-wave peak is 12.5% of the average value of the R-wave peak.
[0130] Optionally, after obtaining the denoised electrocardiogram signal, the noise reduction processing module is further configured to:
[0131] Perform smoothing processing on the denoised electrocardiogram signal, and use the smoothed electrocardiogram signal as the final electrocardiogram signal.
[0132] The noise reduction device for an electrocardiogram waveform in this embodiment can execute the noise reduction method for an electrocardiogram waveform shown in the embodiments of the present application. The implementation principle is similar and will not be elaborated here.
[0133] The embodiments of the present application provide an electronic device. The electronic device in the embodiments of the present application includes: a processor; and a memory configured to store machine-readable instructions that, when executed by the processor, cause the processor to execute a noise reduction method for an electrocardiogram waveform.
[0134] Compared with the prior art, it can be realized that in the present application, the electrocardiogram signal is denoised by the dynamic threshold denoising method. Compared with the traditional filtering method, it can more effectively remove the noise in the electrocardiogram signal while retaining the key features of the signal. In addition, during the denoising process, only the original electrocardiogram signal needs to be compared with the dynamic threshold corresponding to each threshold interval to complete the denoising process. The algorithm implementation is simpler and the calculation amount is smaller, and it can be applied to low-power embedded systems.
[0135] The embodiments of the present application provide an electronic device, as Figure 4 shown, Figure 4 The electronic device shown includes a processor 2001 and a memory 2003. Among them, the processor 2001 and the memory 2003 are connected, such as connected through a bus 2002. Optionally, the electronic device 2000 may further include a transceiver 2004. It should be noted that in actual applications, the transceiver 2004 is not limited to one, and the structure of the electronic device 2000 does not constitute a limitation to the embodiments of the present application.
[0136] The processor 2001 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of this application. The processor 2001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0137] The bus 2002 may include a path for transmitting information between the above components. The bus 2002 may be a PCI bus or an EISA bus, etc. The bus 2002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0138] The memory 2003 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or it may also be an EEPROM, a CD-ROM, or other optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0139] The memory 2003 is used to store the application program code for executing the solution of this application, and is controlled by the processor 2001 for execution. The processor 2001 is used to execute the application program code stored in the memory 2003 to implement Figure 3 the operations of a noise reduction device for electrocardiogram waveforms provided by the illustrated embodiment.
[0140] It should be understood that although the steps in the flowchart of the accompanying drawings are shown sequentially according to the indication of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0141] The above are only some embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for reducing noise of an electrocardiogram waveform, characterized in that: include: Acquire an original electrocardiogram signal, and perform R wave peak value detection processing on the original electrocardiogram signal to determine multiple R wave peak values corresponding to the original electrocardiogram signal; Determine an average value of the R wave peak values corresponding to the original electrocardiogram signal according to the multiple R wave peak values corresponding to the original electrocardiogram signal; Acquire the time interval information between the multiple R wave peaks, and determine the RR interval according to the time interval information, wherein the RR interval includes the time information of each threshold interval; According to the average value of the R wave peak value and the RR interval, the dynamic threshold corresponding to each threshold interval is determined, and the original electrocardiogram signal is subjected to noise reduction processing according to the dynamic threshold corresponding to each threshold interval to obtain a noise-reduced electrocardiogram signal.
2. The method according to claim 1, characterized in that The performing R wave peak value detection processing on the original electrocardiogram signal to determine a plurality of R wave peak values corresponding to the original electrocardiogram signal includes: The original electrocardiogram signal is subjected to R wave peak value detection processing by using the Pan-Tompkins algorithm to determine a plurality of R wave peak values corresponding to the original electrocardiogram signal.
3. The method according to claim 2, characterized in that The performing R wave peak detection processing on the original electrocardiogram signal by using the Pan-Tompkins algorithm to determine a plurality of R wave peaks corresponding to the original electrocardiogram signal includes: Performing initial processing on the original ECG signal to obtain a processed ECG signal, wherein the initial processing includes at least one of filtering processing, square operation processing and integral operation processing; Obtaining a first detection threshold and a second detection threshold, wherein the second detection threshold is half of the first detection threshold; Performing R wave peak detection processing on the processed ECG signal based on the first detection threshold to obtain a plurality of initial R wave peaks; The multiple initial R wave peak values are screened based on the second detection threshold, and the initial R wave peak values with peak values greater than the second detection threshold are used as the multiple R wave peak values corresponding to the original electrocardiogram signal.
4. The method according to claim 1, characterized in that: The multiple R wave peak values are eight R wave peak values that are consecutive to the first R wave peak value, and determining the average value of the R wave peak value corresponding to the original electrocardiogram signal according to the multiple R wave peak values corresponding to the original electrocardiogram signal includes: The average value of the R wave peak value corresponding to the original electrocardiogram signal is determined according to eight R wave peak values that are consecutive to the first R wave peak value.
5. The method according to claim 1, characterized in that The time interval information includes the sampling frequency when performing R wave peak detection processing and the number of samples corresponding to two consecutive R wave peaks. The RR interval is determined by the following formula: Wherein, N is the number of samples corresponding to two consecutive R wave peaks, and F is the sampling frequency during the R wave peak detection process.
6. The method according to claim 1, characterized in that The performing noise reduction processing on the original ECG signal according to the dynamic thresholds corresponding to the threshold intervals to obtain the noise-reduced ECG signal includes: The original ECG signal is compared with the dynamic threshold corresponding to each threshold interval, and a signal in the original ECG signal that is greater than the dynamic threshold is subjected to noise reduction processing to obtain a noise-reduced ECG signal.
7. The method according to claim 1, characterized in that The threshold intervals include the Blank interval before the R wave peak, within 120 ms after the R wave peak, the RR_interval to 180 ms interval after the R wave peak, within 200 ms to 500 ms after the R wave peak, and after 500 ms after the R wave peak.
8. The method according to claim 7, characterized in that No dynamic threshold is set for the Blank interval. The dynamic threshold corresponding to 120m after the R wave peak is the average value of the R wave peak. The dynamic threshold corresponding to RR_interval to 180ms after the R wave peak is 50% of the average value of the R wave peak. The dynamic threshold corresponding to 200ms to 500ms after the R wave peak is 25% of the average value of the R wave peak. The dynamic threshold corresponding to after 500ms after the R wave peak is 12.5% of the average value of the R wave peak.
9. The method according to claim 1, characterized in that: After obtaining the noise-reduced ECG signal, the method further includes: The denoised ECG signal is smoothed, and the smoothed ECG signal is used as the final ECG signal.
10. A noise reduction device for electrocardiogram waveform, characterized in that: include: A signal acquisition module, used to acquire an original ECG signal, and perform R wave peak detection processing on the original ECG signal to determine a plurality of R wave peaks corresponding to the original ECG signal; A mean value determination module, used to determine the average value of the R wave peak values corresponding to the original electrocardiogram signal according to the multiple R wave peak values corresponding to the original electrocardiogram signal; An interval determination module, used to obtain the time interval information between the multiple R wave peaks, and determine the RR interval according to the time interval information, wherein the RR interval includes the time information of each threshold interval; The noise reduction processing module is used to determine the dynamic threshold corresponding to each threshold interval according to the average value of the R wave peak value and the RR interval, and to perform noise reduction processing on the original ECG signal according to the dynamic threshold corresponding to each threshold interval to obtain a noise-reduced ECG signal.