Electrocardiogram signal processing method and device

By performing de-average, preliminary denoising, and electromyography denoising treatment on the ECG signal, and combined with breakpoint identification, the problem that the existing technology cannot completely filter out electromyography noise is solved, high-quality ECG signal processing is achieved, and diagnostic accuracy is improved.

CN119606393AActive Publication Date: 2025-03-14BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411676870.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

The prior art cannot completely filter out the electromyography noise in the ECG signal, resulting in distortion of the electrocardiogram waveform and affecting the diagnostic results.

Method used

By obtaining the original ECG signal, de-average processing, preliminary de-noising processing, electromyography de-noising processing, and breakpoint identification and marking of the target denoising ECG signal are obtained to obtain the processed ECG signal.

Benefits of technology

Effectively remove electromyography noise in ECG signals, improve signal quality, reduce diagnostic errors, and improve the accuracy of electrocardiogram interpretation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119606393A_ABST
    Figure CN119606393A_ABST
Patent Text Reader

Abstract

The invention discloses an electrocardiogram (ECG) signal processing method and device. The method comprises the following steps: acquiring an original ECG signal; performing de-averaging processing on the original ECG signal to obtain a de-averaged ECG signal; performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal; based on a preset detection algorithm, performing myoelectricity denoising processing on the denoised ECG signal to obtain a target denoised ECG signal; performing breakpoint identification on the target de-noised ECG signal to obtain a breakpoint position corresponding to the target de-noised ECG signal; and marking a target area in the target de-noised ECG signal according to the breakpoint position to obtain a processed ECG signal. Therefore, by fusing the preset detection algorithm in the method for removing the myoelectricity noise, the myoelectricity noise in the ECG signal can be completely filtered out, and in combination with breakpoint recognition, the breakpoint position can be recognized from the denoised ECG signal and marked, so that the subsequent signal processing efficiency is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of signal processing technology, and in particular to a method and device for processing electrocardiogram signals. Background Art

[0002] ECG signal refers to electrocardiogram signal, which can be used to monitor arrhythmia, myocardial ischemia, myocardial infarction, cardiomyopathy and other heart diseases. In order to conveniently monitor the patient's ECG signal, a single-lead connection method is usually used. However, a single-lead ECG signal will have certain noise, including baseline drift noise, power frequency noise and electromyography noise, and it needs to go through a series of signal processing methods before it can be used.

[0003] Therefore, in the existing denoising technology, the baseline drift noise in the ECG signal is first filtered out by a high-pass filter, and then the power frequency noise in the ECG signal is filtered out by a band-stop filter, and finally the electromyographic noise is filtered out by a band-pass filter. That is, the band-pass filter blocks the frequency signal outside the ECG signal band to filter the electromyographic noise and obtain the ECG signal after signal processing.

[0004] Since the bandpass filter blocks frequencies outside the ECG signal band, but the myoelectric noise also exists within the ECG signal band, the bandpass filter alone cannot completely filter out the myoelectric noise, which may cause distortion of the ECG waveform, interfere with the normal interpretation of the ECG, and lead to incorrect diagnostic results. Summary of the invention

[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a method and device for processing an electrocardiogram signal to solve the problem that the prior art cannot completely filter out the myoelectric noise in the ECG signal.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] The first aspect of the present application provides a method for processing an electrocardiogram signal, comprising:

[0008] Get the original ECG signal;

[0009] Performing a de-averaging process on the original ECG signal to obtain a de-averaged ECG signal;

[0010] Performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal;

[0011] Based on a preset detection algorithm, the denoised ECG signal is subjected to electromyography denoising processing to obtain a target denoised ECG signal;

[0012] Performing breakpoint identification on the target denoised ECG signal to obtain the breakpoint position corresponding to the target denoised ECG signal;

[0013] According to the breakpoint position, a target area in the target denoised ECG signal is marked to obtain a processed ECG signal; wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal.

[0014] Optionally, in the above-mentioned electrocardiogram signal processing method, performing electromyography denoising processing on the denoised ECG signal based on a preset detection algorithm to obtain a target denoised ECG signal includes:

[0015] Determine all R peak positions in the denoised ECG signal by an R peak detection algorithm;

[0016] For all the R peak positions, respectively, determine the Q point position on the left side of the R peak position and the S point position on the right side through the QRS band detection algorithm; wherein the Q point position refers to the first minimum point on the left side of the R peak position; the S point position refers to the first minimum point on the right side of the R peak position;

[0017] Decomposing the denoised ECG signal according to the Q point position and the S point position;

[0018] According to a preset order, searching for a first middle area adjacent to the Q point position and the S point position from the disassembled denoised ECG signal, and setting the first middle area as a QRS band area;

[0019] According to the preset order, searching for a second middle area adjacent to the S point position and the Q point position from the disassembled denoised ECG signal, and setting the second middle area as the SQ interval;

[0020] The SQ interval is subjected to mean filtering, and all the QRS band regions are connected with all the processed SQ intervals to obtain a target denoised ECG signal.

[0021] Optionally, in the above-mentioned electrocardiogram signal processing method, determining all R peak positions in the denoised ECG signal by an R peak detection algorithm includes:

[0022] Creating a window, and moving the denoised ECG signal using the window;

[0023] When it is detected that the center of the window is at the starting position of the denoised ECG signal and the denoised ECG signal is in the right area of ​​the window, the left area of ​​the denoised ECG signal is filled with a first filling value, and the denoised ECG signal is continuously moved using the window; wherein the first filling value refers to the intensity average value of the denoised ECG signal in the window; the left area of ​​the denoised ECG signal refers to the area of ​​the current window where the left area of ​​the denoised ECG signal does not exist;

[0024] When it is detected that the center of the current window is at the end position of the denoised ECG signal, the right area of ​​the denoised ECG signal is filled with a second filling value; wherein the second filling value refers to the intensity average value of the denoised ECG signal in the current window; the right area of ​​the denoised ECG signal refers to the area of ​​the current window where the right area of ​​the denoised ECG signal does not exist;

[0025] Using a first preset window, sliding the filled denoised ECG signal to obtain each target signal; wherein each target signal is formed by the maximum difference of each target position in the first preset window during the sliding window process; the target position refers to the position in the first preset window where the maximum signal value of the denoised ECG signal is at the center of the first preset window;

[0026] The left area of ​​each target signal is filled with a first target filling value, and the right area of ​​each target signal is filled with a second target filling value; wherein the first target filling value refers to the average value of the strength of each target signal in the first preset window when the center of the first preset window is at the starting position of each target signal and each target signal is in the right area of ​​the window; the left area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the right area of ​​the first preset window, and is not in the left area of ​​the first preset window; the second target filling value refers to the average value of the strength of each target signal in the current first preset window when the center of the first preset window is at the end position of each target signal; the right area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the left area of ​​the first preset window, and is not in the right area of ​​the first preset window;

[0027] Using a second preset window, sliding windows are performed on each of the filled target signals to obtain each R peak position; wherein each of the R peak positions refers to a position in which all maximum differences within the second preset window are located at the center position of the second preset window when the second preset window slides from the starting position of the target signal to the end position of the target signal.

[0028] Optionally, in the above-mentioned electrocardiogram signal processing method, determining the Q point position on the left side of the R peak position and the S point position on the right side of the R peak position by using a QRS band detection algorithm for all the R peak positions, including:

[0029] For all the R peak positions, respectively, create a filter box at the R peak position;

[0030] Select all minimum value points corresponding to the R peak position from the screening box;

[0031] In the screening box, taking the R peak position as the center, using double pointers to search for the first minimum point on the left side of the R peak position and the first minimum point on the right side of all the minimum points;

[0032] The first minimum point on the left side of the R peak position is determined as the Q point position, and the first minimum point on the right side of the R peak position is determined as the S point position.

[0033] Optionally, in the above-mentioned electrocardiogram signal processing method, it also includes:

[0034] Detecting whether there are multiple target minimum value points in a preset frequency region among all the minimum value points corresponding to the R peak position;

[0035] If there are multiple target minimum points in the preset frequency region among all the minimum points corresponding to the R peak position, the target Q point position and the target S point position are extracted from each of the target minimum points, and the target Q point position and the target S point position are set as the minimum length boundary.

[0036] Optionally, in the above-mentioned electrocardiogram signal processing method, the step of performing breakpoint identification on the target denoised ECG signal to obtain the breakpoint position corresponding to the target denoised ECG signal includes:

[0037] Using a third preset window, sliding the target denoised ECG signal to obtain each target maximum difference and each average value corresponding to the target denoised ECG signal;

[0038] Based on each of the target maximum difference values ​​and each of the average values, all R peak positions in the target denoised ECG signal are calculated to obtain a target R peak point set;

[0039] Calculating the difference between every two adjacent R peak positions in the R peak point set to obtain each R peak difference;

[0040] Determine whether the number of R peaks in the target R peak point set is greater than a preset threshold;

[0041] If the number of R peaks in the target R peak point set is greater than the preset threshold, detecting whether there is a target R peak difference within a preset range among the R peak differences;

[0042] If there is a target R peak difference value within a preset range among the R peak differences, two adjacent R peak positions corresponding to the target R peak difference values ​​are determined as breakpoint positions;

[0043] If the number of R peaks in the target R peak point set is less than a preset threshold, obtaining a left area of ​​the first R peak position and a right area of ​​the last R peak position in the target R peak point set;

[0044] Determine whether the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than a preset length;

[0045] If the R peak length corresponding to the left region and / or the R peak length corresponding to the right region is greater than a preset length, the left region and / or the right region is determined to be a breakpoint position.

[0046] Optionally, in the above-mentioned electrocardiogram signal processing method, the performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal includes:

[0047] Performing baseline drift noise removal processing on the de-averaged ECG signal to obtain a processed ECG signal;

[0048] The processed ECG signal is subjected to power frequency noise removal processing to obtain a denoised ECG signal.

[0049] A second aspect of the present application provides an electrocardiogram signal processing device, comprising:

[0050] A signal acquisition unit, used for acquiring original ECG signals;

[0051] A mean processing unit, used for performing a mean removal process on the original ECG signal to obtain a mean removal ECG signal;

[0052] A preliminary processing unit, used for performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal;

[0053] An electromyography processing unit, configured to perform electromyography denoising processing on the denoised ECG signal based on a preset detection algorithm to obtain a target denoised ECG signal;

[0054] A breakpoint identification unit, used to identify breakpoints of the target denoised ECG signal to obtain breakpoint positions corresponding to the target denoised ECG signal;

[0055] A marking processing unit is used to mark the target area in the target denoised ECG signal according to the breakpoint position to obtain a processed ECG signal; wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal.

[0056] Optionally, in the above-mentioned electrocardiogram signal processing device, the electromyography processing unit includes:

[0057] a position determination unit, configured to determine all R peak positions in the denoised ECG signal by using an R peak detection algorithm;

[0058] A first determination unit is used to determine, for all the R peak positions, a Q point position on the left side of the R peak position and an S point position on the right side thereof by using a QRS band detection algorithm; wherein the Q point position refers to a first minimum point on the left side of the R peak position; and the S point position refers to a first minimum point on the right side of the R peak position;

[0059] A disassembling unit, configured to disassemble the denoised ECG signal according to the Q point position and the S point position;

[0060] A first searching unit is used to search, in a preset order, from the disassembled denoised ECG signal for a first middle region adjacent to the Q point position and the S point position, and set the first middle region as a QRS band region;

[0061] A second searching unit is used to search, in accordance with the preset order, from the de-noised ECG signal after disassembly, a second middle region adjacent to the S point position and the Q point position, and set the second middle region as the SQ interval;

[0062] The connection unit is used to perform mean filtering on the SQ interval and connect all the QRS band regions with all the processed SQ intervals to obtain a target denoised ECG signal.

[0063] Optionally, in the above-mentioned electrocardiogram signal processing device, the position determination unit includes:

[0064] A first creation unit, configured to create a window and use the window to move the denoised ECG signal;

[0065] A first filling unit is used to fill the left area of ​​the denoised ECG signal with a first filling value when it is detected that the center of the window is at the starting position of the denoised ECG signal and the denoised ECG signal is in the right area of ​​the window, and continue to move the denoised ECG signal using the window; wherein the first filling value refers to the intensity average value of the denoised ECG signal in the window; the left area of ​​the denoised ECG signal refers to the area of ​​the current window where the left area of ​​the denoised ECG signal does not exist;

[0066] A second filling unit is used to fill the right area of ​​the denoised ECG signal with a second filling value when it is detected that the center of the current window is at the end position of the denoised ECG signal; wherein the second filling value refers to the intensity average value of the denoised ECG signal in the current window; the right area of ​​the denoised ECG signal refers to the area of ​​the current window where the right area of ​​the denoised ECG signal does not exist;

[0067] A first sliding window unit is used to slide the filled denoised ECG signal using a first preset window to obtain each target signal; wherein each target signal is formed by the maximum difference of each target position in the first preset window during the sliding window process; the target position refers to the position in the first preset window where the maximum signal value of the denoised ECG signal is at the center of the first preset window;

[0068] A third filling unit, used to fill the left area of ​​each target signal with a first target filling value, and to fill the right area of ​​each target signal with a second target filling value; wherein the first target filling value refers to the average value of the strength of each target signal in the first preset window when the center of the first preset window is at the starting position of each target signal and each target signal is in the right area of ​​the window; the left area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the right area of ​​the first preset window, and is not in the left area of ​​the first preset window; the second target filling value refers to the average value of the strength of each target signal in the current first preset window when the center of the first preset window is at the end position of each target signal; the right area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the left area of ​​the first preset window, and is not in the right area of ​​the first preset window;

[0069] A second sliding window unit is used to use a second preset window to slide the filled target signals to obtain each R peak position; wherein each R peak position refers to a position in which all maximum differences in the second preset window are located at the center of the second preset window when the second preset window slides from the starting position of the target signal to the end position of the target signal.

[0070] Optionally, in the above-mentioned electrocardiogram signal processing device, the first determining unit includes:

[0071] A second creating unit is used to create a filter frame at the R peak position for all the R peak positions respectively;

[0072] A selection unit, used for selecting all minimum value points corresponding to the R peak position from the screening box;

[0073] A third search unit is used to search, in the screening frame, the first minimum point on the left side and the first minimum point on the right side of the R peak position from all the minimum points using a double pointer with the R peak position as the center;

[0074] The second determining unit is used to determine the first minimum point on the left side of the R peak position as the Q point position, and determine the first minimum point on the right side of the R peak position as the S point position.

[0075] Optionally, the above-mentioned electrocardiogram signal processing device further includes:

[0076] A first detection unit, used to detect whether there are multiple target minimum value points in a preset frequency region among all the minimum value points corresponding to the R peak position;

[0077] A setting unit is used to extract a target Q point position and a target S point position from each of the target minimum points if there are multiple target minimum points in a preset frequency region among all the minimum points corresponding to the R peak position, and set the target Q point position and the target S point position as the minimum length boundary.

[0078] Optionally, in the above-mentioned electrocardiogram signal processing device, the breakpoint identification unit includes:

[0079] A third sliding window unit is used to slide the target denoised ECG signal using a third preset window to obtain each target maximum difference and each average value corresponding to the target denoised ECG signal;

[0080] A first calculation unit, configured to calculate all R peak positions in the target denoised ECG signal based on each of the target maximum difference values ​​and each of the average values, to obtain a target R peak point set;

[0081] a second calculation unit, configured to calculate the difference between every two adjacent R peak positions in the R peak point set to obtain each R peak difference;

[0082] A first judging unit, configured to judge whether the number of R peaks in the target R peak point set is greater than a preset threshold;

[0083] A second detection unit is used to detect whether there is a target R peak difference within a preset range among the R peak differences if the number of R peaks in the target R peak point set is greater than the preset threshold;

[0084] a third determining unit, configured to determine two adjacent R peak positions corresponding to the target R peak difference values ​​as breakpoint positions if there is a target R peak difference value within a preset range among the R peak difference values;

[0085] A region acquisition unit, configured to acquire a left region of a first R peak position and a right region of a last R peak position in the target R peak point set if the number of R peaks in the target R peak point set is less than a preset threshold;

[0086] A second judgment unit is used to judge whether the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than a preset length;

[0087] The fourth determination unit is used to determine that the left area and / or the right area is a breakpoint position if the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than a preset length.

[0088] Optionally, in the above-mentioned electrocardiogram signal processing device, the preliminary processing unit includes:

[0089] A first processing unit, configured to perform baseline drift noise removal processing on the de-averaged ECG signal to obtain a processed ECG signal;

[0090] The second processing unit is used to remove power frequency noise from the processed ECG signal to obtain a denoised ECG signal.

[0091] The present application provides a method for processing an electrocardiogram signal, which obtains an original ECG signal, then performs a denoising process on the original ECG signal to obtain a denoised ECG signal, then performs a preliminary denoising process on the denoised ECG signal to obtain a denoised ECG signal, and then performs electromyographic denoising on the denoised ECG signal based on a preset detection algorithm to obtain a target denoised ECG signal, then performs breakpoint identification on the target denoised ECG signal to obtain the breakpoint position corresponding to the target denoised ECG signal, and finally performs a marking process on the target denoised ECG signal according to the breakpoint position to obtain a processed ECG signal, wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal. Thus, by integrating a preset detection algorithm into the method for removing electromyographic noise, the electromyographic noise in the ECG signal can be completely filtered out, and combined with breakpoint identification, the breakpoint position can be identified and marked from the denoised ECG signal to effectively improve the subsequent signal processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0093] Figure 1 A schematic diagram of a process of processing an electrocardiogram signal provided in an embodiment of the present application;

[0094] Figure 2 A schematic diagram of a flow chart of a method for denoising an electrocardiogram signal provided in an embodiment of the present application;

[0095] Figure 3 A flowchart of a method for acquiring a target denoised ECG signal provided in an embodiment of the present application;

[0096] Figure 4 A schematic diagram of a process for obtaining an R peak position provided in an embodiment of the present application;

[0097] Figure 5 A schematic flow chart of a method for obtaining the left and right areas of an R peak position provided in an embodiment of the present application;

[0098] Figure 6 A schematic diagram of a signal waveform structure provided in an embodiment of the present application;

[0099] Figure 7 A schematic flow chart of a method for processing a minimum value point provided in another embodiment of the present application;

[0100] Figure 8 A schematic diagram of a flow chart of a method for obtaining a breakpoint position provided in an embodiment of the present application;

[0101] Fig. 9 A schematic structural diagram of an image denoising method and device provided in another embodiment of the present application. DETAILED DESCRIPTION

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

[0103] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0104] The present application embodiment provides a method for processing an electrocardiogram signal, such as Figure 1 As shown, the specific steps include:

[0105] S101 : Acquire original ECG signal.

[0106] It is understandable that the original ECG signal can be collected by relevant medical equipment, where the ECG signal is a graphical representation of the heart's electrical activity, which is used to reflect the functional state of the heart by measuring the electrical signals generated by the heart during the heartbeat. However, the original ECG signal just collected will carry a lot of noise, which may affect the doctor's diagnosis later. Therefore, in order to avoid this situation, it is necessary to obtain the original ECG signal in advance and then denoise the original ECG signal later.

[0107] S102 , performing a de-averaging process on the original ECG signal to obtain a de-averaged ECG signal.

[0108] Specifically, the de-averaging algorithm can be used to de-average the original ECG signal to reduce the DC component in the signal and highlight the changes and fluctuations of the signal. The formula expression of the de-averaging algorithm is:

[0109]

[0110] Among them, S a is the original ECG signal after removing the mean value, that is, the mean ECG signal, S is the original ECG signal, S i is the value of the i-th discrete point in the original ECG signal, fs is the sampling frequency of the ECG signal, and d is the duration of the original ECG signal.

[0111] S103 , performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal.

[0112] It should be noted that since the original ECG signal contains a lot of noise, in order to reduce the noise and interference in the signal and improve the quality and readability of the signal, after the original ECG signal is de-meaned, it is also necessary to perform preliminary denoising on the de-meaned ECG signal to obtain a denoised ECG signal.

[0113] Optionally, in another embodiment of the present application, a specific implementation of step S103 is as follows: Figure 2 As shown, the following steps are included:

[0114] S201 , performing baseline drift noise removal processing on the de-averaged ECG signal to obtain a processed ECG signal.

[0115] It is understandable that a discrete wavelet transform operation may be performed on the de-averaged ECG signal first, with Daubechies4 being used as the wavelet basis. Of course, other wavelet basis algorithms may also be used, and the embodiments of the present application are not limited to the use of Daubechies4.

[0116] Therefore, the decomposition level of Daubechies4 is 7, and after decomposition, 7 layers of detail coefficients C are obtained. i (i=1, 2, ..., 7), the calculation process is:

[0117] Among them, S a is the de-averaged ECG signal, i represents the decomposition level, n is the index of the output detail coefficient, h[k] is the coefficient of the wavelet function, and here we take M is the length of the wavelet function, M=8.

[0118] Then, the first layer detail coefficient C1 obtained by decomposition is set to 0, and finally, the new 7-layer detail coefficient C iThe ECG signals are reconstructed by adding them together to obtain an ECG signal with baseline drift noise removed, that is, a processed ECG signal.

[0119] S202: remove power frequency noise from the processed ECG signal to obtain a denoised ECG signal.

[0120] It is understandable that after executing step S201 and obtaining the processed ECG signal, the processed ECG signal needs to be processed to remove power frequency noise, because power frequency interference may affect the analysis and diagnosis of the ECG signal. Therefore, a Butterworth bandpass filter can be used to block the frequency range outside the frequency of the processed ECG signal. The filter order is 4th order, and the cutoff frequency can usually be 2Hz or 35Hz. The expression of the quadratic curve function of the filter amplitude is:

[0121]

[0122] Among them, ω C为 Cutoff frequency, |H(ω)| 2 is the filter, and ω is the input signal frequency.

[0123] Specifically, after the ECG signal is processed through step S202, a denoised ECG signal with power frequency noise removed is obtained.

[0124] Optionally, the embodiment of the present application is not limited to using a Butterworth bandpass filter to remove power frequency noise from ECG signals, and other filters may be used for processing, and the specific settings may be made according to requirements.

[0125] S104 , based on a preset detection algorithm, perform electromyography denoising processing on the denoised ECG signal to obtain a target denoised ECG signal.

[0126] It should be noted that in the embodiment of the present application, a preset detection algorithm is integrated in the electromyography denoising process of the denoised ECG signal, so that in the processing of ECG signals with high noise intensity and low signal intensity, the information of the P peak and the T peak can be retained on the basis of completely removing the electromyography noise. Specifically, first, the preset detection algorithm can be used to identify the part of the ECG signal affected by the electromyography interference. For the part identified as being affected by the electromyography interference, a special electromyography interference filter can be used for processing. After the electromyography denoising process, the processed ECG signal and the non-interfered part of the original signal are reconstructed to obtain the target denoised ECG signal.

[0127] Optionally, in another embodiment of the present application, a specific implementation of step S104 is as follows: Figure 3 As shown, the following steps are included:

[0128] S301 . Determine all R peak positions in the denoised ECG signal using an R peak detection algorithm.

[0129] It should be noted that in order to subsequently extract the QRS complex from the denoised ECG signal to perform electromyography denoising on the denoised ECG signal, it is necessary to first determine the QRS complex from the denoised ECG signal based on the R peak position in the denoised ECG signal. Therefore, in this embodiment, an R peak detection algorithm is used to determine all R peak positions in the denoised ECG signal.

[0130] Optionally, in another embodiment of the present application, a specific implementation of step S104 is as follows: Figure 4 As shown, the following steps are included:

[0131] S401 , creating a window, and using the window to move the denoised ECG signal.

[0132] It is understandable that, in the process of performing myoelectric denoising on the denoised ECG signal, the signal can be segmented using a window function. Alternatively, the numpy library in Python can be used to create a window, and the denoised ECG signal can be moved using this window.

[0133] For example, the denoised ECG signal is a random signal with a length of 1000, and then the window size is defined as 100 and the moving step is 50. Then the denoised ECG signal is moved so that specific processing can be performed within each window.

[0134] S402. When it is detected that the center of the window is at the starting position of the denoised ECG signal and the denoised ECG signal is in the right area of ​​the window, the left area of ​​the denoised ECG signal is filled with the first filling value, and the denoised ECG signal is continued to be moved using the window.

[0135] It is understandable that when it is detected that the center line of the window is located at the starting position of the denoised ECG signal and the denoised ECG signal occupies half of the window size, it is necessary to use the first filling value to fill the left border of the denoised ECG signal, that is, fill the position of the other half of the window that is not occupied by the denoised ECG signal. Among them, the filling area size of the left border of the denoised ECG signal is 100×fs / 1000. The first filling value refers to the intensity average of the denoised ECG signal in the window. The left area of ​​the denoised ECG signal refers to the area in the current window where the left area of ​​the denoised ECG signal does not exist.

[0136] S403: When it is detected that the center of the current window is at the end position of the denoised ECG signal, fill the right area of ​​the denoised ECG signal with a second filling value.

[0137] It can be understood that after filling the left area of ​​the denoised ECG signal, the denoised ECG signal continues to be moved using the current window. When it is detected that the center line of the window is located at the end position of the denoised ECG signal and the denoised ECG signal occupies half of the window size, it is necessary to use the second filling value to fill the right border of the denoised ECG signal, that is, fill the other half of the window that does not occupy the position of the denoised ECG signal. Among them, the filling area size of the right border of the denoised ECG signal is 100×fs / 1000. The second filling value refers to the average intensity of the denoised ECG signal in the current window. The right area of ​​the denoised ECG signal refers to the area in the current window where the right area of ​​the denoised ECG signal does not exist.

[0138] S404 , using the first preset window, sliding the padded denoised ECG signal to obtain various target signals.

[0139] It is understandable that after the denoised ECG signal is filled, it is necessary to use the first preset window to slide the denoised ECG signal. Specifically, the starting point of the sliding window is when the center position i of the first preset window coincides with the starting position t=0 of the denoised ECG signal, that is, i=0. The end point of the sliding window is when the center position i of the first preset window coincides with the end position t=fs×d of the denoised ECG signal, that is, i=fs×d. Among them, d is the duration of the denoised ECG signal. The first preset window slides from the starting point to the end point, and the sliding step is 1. When the maximum value point M in the first preset window is located at the center position of the first preset window, that is, i=x M , x M is the position of point M. At this time, the program will return the maximum difference in the window of the current first preset window position, that is, diff = max(window) - min(window). Among them, window represents the set formed by the positions of all points in the first preset window. If the maximum value point M in the first preset window is not at the center of the first preset window, then diff = 0. After the sliding window ends, the program will return a signal formed by the diff of each position with the same length as the denoised ECG signal.

[0140] Optionally, the size of the first preset window is 200×fs / 1000, and of course it can also be other window sizes, which can be specifically set according to requirements.

[0141] Among them, each target signal refers to a diff signal. According to the above description, each target signal is formed by the maximum difference of each target position in the first preset window during the sliding window process. The target position refers to the position in the first preset window where the maximum signal value of the denoised ECG signal is at the center of the first preset window.

[0142] S405 : Fill the left area of ​​each target signal with the first target filling value, and fill the right area of ​​each target signal with the second target filling value.

[0143] It should be noted that the specific implementation of step S405 is the same as that of step S402 and step S403, so it is necessary to first use the first preset window to perform a first sliding window on each target signal. When it is detected that the center of the first preset window is at the starting position of each target signal and each target signal is in the right area of ​​the first preset window, the left area of ​​each target signal is filled with the first target filling value. After filling, continue to use the first preset window to move the filled target signal. When it is detected that the center of the first preset window is at the end position of each target signal, the right area of ​​each target signal is filled with the second target filling value.

[0144] The first target filling value refers to the average value of the intensity of each target signal in the first preset window when the center of the first preset window is at the starting position of each target signal and each target signal is in the right area of ​​the window. The left area of ​​the target signal refers to the area with the center of the first preset window as the dividing line, the target signal is in the right area of ​​the first preset window, and is not in the left area of ​​the first preset window.

[0145] The second target filling value refers to the average value of the intensity of each target signal in the current first preset window when the center of the first preset window is at the end position of each target signal. The right area of ​​the target signal refers to the area where the target signal is in the left area of ​​the first preset window and is not in the right area of ​​the first preset window with the center of the first preset window as the dividing line.

[0146] It should also be noted that the size of the left area and the right area filled with the target signal is 500×fs / 1000. Of course, it can also be other window sizes, which can be set specifically according to needs.

[0147] S406 , using the second preset window, sliding the window of each filled target signal to obtain each R peak position.

[0148] It should be emphasized that after filling each target signal, a second sliding window needs to be performed on each filled target signal. At this time, a second preset window needs to be created for sliding window. Specifically, the starting point of the sliding window is when the center position i of the second preset window coincides with the starting position t=0 of each target signal, that is, i=0. The end point of the sliding window is when the center position i of the second preset window coincides with the end position t=fs×d of each target signal, that is, i=fs×d. Among them, d is the duration of the target signal. The second preset window slides from the starting point to the end point, and the sliding step is 1. When the maximum diff value in the second preset window is located at the center position of the second preset window, that is, the position of the target signal corresponding to the maximum diff value at this time is the R peak position. According to the sliding window method. When the sliding window ends, the program returns the R peak positions corresponding to all target signals, thereby forming a point position set R.

[0149] Optionally, the size of the second preset window is 1000×fs / 1000, and of course it can also be other window sizes, which can be specifically set according to requirements.

[0150] It should be noted that, according to the above description, each R peak position refers to the position where all maximum differences in the second preset window are located at the center of the second preset window when the second preset window slides from the starting position of the target signal to the end position of the target signal.

[0151] S302 , for all R peak positions, determine the Q point position on the left side of the R peak position and the S point position on the right side through a QRS band detection algorithm.

[0152] The Q point position refers to the first minimum point on the left side of the R peak position, and the S point position refers to the first minimum point on the right side of the R peak position.

[0153] It should be noted that in order to subsequently determine the QRS band area of ​​the denoised ECG signal from the R peak position, it is necessary to traverse each R peak position in advance through the QRS band detection algorithm, and determine the Q point position and the S point position from the R peak position. Only then can the QRS band area be determined based on the Q point position and the S point position.

[0154] Optionally, in another embodiment of the present application, a specific implementation of step S302 is as follows: Figure 5 As shown, the following steps are included:

[0155] S501 . Create a filter box at each R peak position.

[0156] It can be understood that the denoised ECG signal and all R peak positions are input into the QRS band detection algorithm, and a filter box is set at each R peak position with the maximum length as the window length according to the R peak position. The maximum length qrs max =200×fs / 1000. It should be noted that the purpose of creating the filter box is to further determine the starting position and the ending position of the QRS wave band corresponding to the R peak position, that is, the Q point position, the R peak position and the S point position.

[0157] S502, selecting all minimum value points corresponding to the R peak position from the filter box.

[0158] Specifically, all the minimum points are searched in the filter box, which usually correspond to the troughs in the denoised ECG signal. By selecting all the minimum points corresponding to the R peak position in the filter box, the waveform characteristics of the QRS band can be more comprehensively understood.

[0159] S503. In the filter box, with the R peak position as the center, use double pointers to search for the first minimum point on the left side of the R peak position and the first minimum point on the right side from all minimum points.

[0160] It can be understood that firstly, two pointers need to be set at the R peak position, one pointing to the left side of the R peak position and the other pointing to the right side, and move to both sides respectively to find the minimum point (trough) closest to the R peak position.

[0161] Alternatively, starting from the R peak position, the pointer can be moved to the left, and each point can be checked step by step to see if it is a minimum point, until the first minimum point (trough) on the left closest to the R peak position is found. Similarly, starting from the R peak position, the pointer can be moved to the right, and each point can be checked step by step to see if it is a minimum point, until the first minimum point (trough) on the right closest to the R peak position is found.

[0162] This method can accurately find the closest minimum points on the left and right sides of the R peak position. These minimum points usually correspond to the trough of the QRS waveform, which helps to describe the morphological characteristics of the QRS band in more detail. This refined analysis method helps to improve the accuracy of ECG signal interpretation and provide more reliable information for clinical diagnosis.

[0163] S504, determining the first minimum point on the left side of the R peak position as the Q point position, and determining the first minimum point on the right side of the R peak position as the S point position.

[0164] Specifically, the first trough on the left side of the R peak position is determined as the Q point position, and the first trough on the right side of the R peak position is determined as the S point position, wherein the Q point position and the S point position can be referred to Figure 6 Schematic diagram of the structure of the signal waveform shown.

[0165] Optionally, in order to ensure the accuracy and stability of signal analysis, if the extreme value point appears within the minimum length of the QRS region, it may cause some problems for signal processing and feature extraction. Therefore, in another embodiment of the present application, a method for processing the minimum value point is also provided, such as Figure 7 As shown, the specific steps include:

[0166] S701 , detecting whether there are multiple target minimum value points in a preset frequency region among all minimum value points corresponding to the R peak position.

[0167] It should be noted that in the QRS region, there may be various types of signal noise and interference, such as baseline drift, muscle movement interference, etc. If the length of the QRS region is too short, it is easily affected by these interferences, making the detection and positioning of the minimum point difficult, reducing the accuracy and stability of signal processing. Therefore, in order to avoid this situation, a minimum length is set in the QRS region, and it is detected whether there are multiple target minimum points in the preset frequency region among all the minimum points corresponding to the R peak position. If there are multiple target minimum points in the preset frequency region among all the minimum points corresponding to the R peak position, it means that the detection and positioning of the minimum points outside the preset frequency region becomes difficult, which may affect the accuracy and stability of signal processing. Therefore, the target minimum point is processed, that is, step S702 is executed.

[0168] Optionally, the minimum length is qrs min =30×fs / 1000. Of course, other lengths can be set according to specific needs.

[0169] S702, extracting a target Q point position and a target S point position from each target minimum value point, and setting the target Q point position and the target S point position as the minimum length boundary.

[0170] Specifically, when there are multiple target minimum points in the preset frequency area among all the minimum points corresponding to the R peak position, it is necessary to set the Q point position and the S point position in each target minimum point as the minimum length boundary, that is, to set the Q point position and the S point position as the starting point and the end point of the minimum length area to ensure that the entire QRS waveform can be completely analyzed.

[0171] S303 , disassemble the denoised ECG signal according to the Q point position and the S point position.

[0172] It should be noted that step S303 is performed in order to perform a separate denoising process on each part, so as to more accurately remove the noise components in the signal, improve the quality and accuracy of the signal, and provide a more reliable data basis for subsequent analysis.

[0173] S304 , searching, in a preset order, for a first middle region adjacent to the Q point position and the S point position in the disassembled denoised ECG signal, and setting the first middle region as a QRS band region.

[0174] It can be understood that the preset order can be from left to right or from right to left. From the disassembled denoised ECG signal, starting from the Q point position, find the middle area adjacent to the Q point position and the S point position, and set the middle area as the QRS band area.

[0175] S305 , searching for a second middle region adjacent to the S point position and the Q point position in the de-noised ECG signal in a preset order, and setting the second middle region as the SQ interval.

[0176] Specifically, according to the search order of step S304, the middle area adjacent to the S point position and the Q point position is searched from the de-noised ECG signal with the S point position as the starting point, and the middle area is set as the SQ interval.

[0177] S306 , performing mean filtering processing on the SQ interval, and connecting all QRS band regions with all processed SQ intervals to obtain a target denoised ECG signal.

[0178] It should be noted that in order to remove noise, smooth signals and enhance continuity, a more reliable and effective data basis is provided for subsequent signal processing and analysis. Therefore, it is necessary to perform mean filtering on the SQ interval. The specific processing process can be referred to the following calculation:

[0179]

[0180] Among them, i represents the index in the output denoised ECG signal, j represents the index in the input denoised ECG signal, N represents the window size, N=20, of course, other window sizes are also possible, and the specific ones can be set according to requirements.

[0181] It is understandable that after all SQ intervals are processed, it is necessary to reconnect all the processed SQ intervals with all the QRS band regions to obtain an ECG signal with myoelectric noise removed, that is, a target denoised ECG signal, so that it has a lower noise level and smoother characteristics overall.

[0182] S105 , performing breakpoint identification on the target denoised ECG signal to obtain breakpoint positions corresponding to the target denoised ECG signal.

[0183] It should be noted that the purpose of executing step S105 to obtain the breakpoint position corresponding to the target denoised ECG signal is to segment the target denoised ECG signal into different segments or beats by identifying the breakpoint position, and identifying and locating the breakpoint helps to reduce errors and confusion in the processing of the target denoised ECG signal, and improve the accuracy and reliability of subsequent analysis. Only by clearly locating the breakpoint can the subsequent processing and interpretation of the signal be accurate. Therefore, in the embodiment of the present application, the breakpoint of the target denoised ECG signal is identified based on the sliding window, so as to obtain the breakpoint position corresponding to the target denoised ECG signal.

[0184] Optionally, in another embodiment of the present application, a specific implementation of step S105 is as follows: Figure 8 As shown, the following steps are included:

[0185] S801. Use a third preset window to slide the target denoised ECG signal to obtain each target maximum difference and each average value corresponding to the target denoised ECG signal.

[0186] It should be emphasized that first, a third preset window needs to be created, and then the target denoised ECG signal is moved using the third preset window. When it is detected that the center of the third preset window is at the starting position of the target denoised ECG signal and the target denoised ECG signal is in the right area of ​​the third preset window, the left area of ​​each target signal is filled, wherein the left area of ​​each target signal is filled with the average value of the target denoised ECG signal in the first third preset window. After filling, the filled target signal is continued to be moved using the third preset window. When it is detected that the center of the third preset window is at the end position of each target signal, the right area of ​​each target signal is filled, wherein the right area of ​​each target signal is filled with the average value of the target denoised ECG signal in the last third preset window. Optionally, the filling areas on the left and right sides are 30×fs / 1000, the size of the third preset window is 60×fs / 1000, and the filling area and window size can also be other thresholds, which can be set according to needs.

[0187] Secondly, after filling the areas on both sides of the target denoised ECG signal, the third preset window is used to slide the target denoised ECG signal. Specifically, the starting point of the sliding window is when the center position i of the third preset window coincides with the starting position t=0 of the target denoised ECG signal, that is, i=0. The end point of the sliding window is when the center position i of the third preset window coincides with the end position t=fs×d of the target denoised ECG signal, that is, i=fs×d. Among them, d is the duration of the target denoised ECG signal. The third preset window slides from the starting point to the end point, and the sliding step is 1. When the maximum diff value in the third preset window is located at the center position of the third preset window, the program will return the maximum difference in the window and the average value in the window at the current third preset window position, according to the sliding window method. When the sliding window ends, the program returns all the maximum differences in the window and the average values ​​in the window, so as to obtain the target maximum differences and average values ​​corresponding to the target denoised ECG signal.

[0188] S802 . Based on each target maximum difference and each average value, calculate all R peak positions in the target denoised ECG signal to obtain a target R peak point set.

[0189] It should be noted that after obtaining each target maximum difference and each average value, that is, all the maximum differences within the window and the average values ​​within the window, it is necessary to set the thresholds of the maximum differences within the window and the average values ​​within the window, so as to calculate all the R peak positions in the target denoised ECG signal by means of the threshold and obtain the target R peak point set.

[0190] Specifically, the threshold is calculated as follows:

[0191] thre min =max(0.00001,mean(diff max ))

[0192]

[0193] Among them, thre min Indicates the minimum threshold of the maximum difference in the window. When the maximum difference in the window is less than thre min Or greater than 0.00002, the mask is set to 1. At this time, it is necessary to remove all R peak positions with mask 1 in the target denoised ECG signal, so as to obtain a new R peak point set, that is, the target R peak point set. It should also be noted that the target R peak point set is an ordered set arranged from small to large according to the index, that is, the R peak positions with mask 1 are arranged in the order in which they appear in the target denoised ECG signal.

[0194] S803, calculating the difference between every two adjacent R peak positions in the R peak point set to obtain each R peak difference.

[0195] Specifically, first traverse the R peak point set, and calculate the difference between each two adjacent R peak positions in turn. The difference is calculated by subtracting the position of the previous R peak point from the position of the next R peak point. Finally, the calculated difference between each two adjacent R peak positions is saved, thereby forming a set of R peak differences, which is recorded as the interval R inter .

[0196] S804: Determine whether the number of R peaks in the target R peak point set is greater than a preset threshold.

[0197] It should be noted that, since the electrocardiogram signal may be affected by various interferences and noises, not all detected R peaks are valid heartbeat signals. Therefore, it is necessary to pre-determine whether the number of R peaks in the target R peak point set is greater than the preset threshold. If the number of R peaks in the target R peak point set is greater than the preset threshold, it means that there is noise and interference in the target R peak point set, and threshold judgment is required, so step S805 needs to be executed at this time. If the number of R peaks in the target R peak point set is less than the preset threshold, it means that there is no noise and interference in the target R peak point set, so step S807 needs to be executed at this time.

[0198] Optionally, the preset threshold is 2, and of course it can also be other thresholds, which are specifically set according to needs.

[0199] S805 , detecting whether there is a target R peak difference value within a preset range among the R peak differences.

[0200] It should be noted that when the number of R peaks in the target R peak point set is greater than the preset threshold, it indicates that there are invalid R peaks in the target R peak point set. Therefore, in order to determine the invalid R peaks, a threshold discrimination method can be used. The embodiment of the present application adopts the maximum and minimum threshold method, that is, the maximum and minimum thresholds are used to discriminate the calculated R peak difference. The difference exceeding the maximum threshold or below the minimum threshold may indicate an abnormal or invalid R peak point, which needs to be processed accordingly. Then, according to the threshold discrimination result, the valid R peak points that meet the conditions can be screened out, while excluding abnormal or interfering noise.

[0201] Specifically, the maximum and minimum threshold determination formula is:

[0202] inter max =6035×fs

[0203] inter min =60180×fs

[0204] The preset range in step S805 is inter min <Interval R inter<inter max If there is a target R peak difference value within the preset range among the R peak differences, it means that the target R peak difference value is an invalid R peak point, and step S806 needs to be executed at this time.

[0205] Optionally, if the target R peak difference does not exist in the preset range among the R peak differences, it means that there are no invalid R peak points in the target R peak point set, and no processing is required, and the target denoised ECG signal can be directly output.

[0206] S806: Determine two adjacent R peak positions corresponding to the target R peak difference as breakpoint positions.

[0207] It can be understood that when there is a target R peak difference greater than the preset range among the R peak differences, it means that the R peak corresponding to the target R peak difference is invalid, and the area corresponding to the target R peak difference is also invalid. Therefore, the target R peak difference is the breakpoint interval, indicating that the signal quality is poor and needs to be set to zero to improve the display effect.

[0208] S807 , obtaining the left area of ​​the first R peak position and the right area of ​​the last R peak position in the target R peak point set.

[0209] It should be noted that when the number of R peaks in the target R peak point set is less than the preset threshold, and the number of R peaks in the target R peak point set is greater than 0, it is also necessary to separately determine the maximum threshold of the intervals on both sides of the head and tail, where the head and tail refer to the left area of ​​the R peak position corresponding to the first index number in the target R peak point set, and the right area of ​​the R peak position corresponding to the last index number. In the ECG signal processing, the intervals on both sides of the head and tail are usually affected by some special circumstances, such as the abnormal waveforms caused by interference, noise or other factors at the beginning and end of signal acquisition. Therefore, it is necessary to separately determine the maximum threshold of the intervals on both sides of the head and tail, so it is necessary to pre-acquire the left area of ​​the first R peak position and the right area of ​​the last R peak position in the target R peak point set.

[0210] S808: Determine whether the R peak length corresponding to the left region and / or the R peak length corresponding to the right region is greater than a preset length.

[0211] Specifically, since the maximum threshold determination of the intervals at both ends is helpful to eliminate abnormal situations, ensure data quality, improve the robustness of the algorithm, and more accurately process and analyze ECG signals, it is necessary to check whether the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than a preset length. The preset length is the value of the interval in step S805. maxIf the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than the preset length, it means that the left area and / or the right area are areas of poor quality, so step S809 is executed at this time.

[0212] Optionally, if the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is not greater than the preset length, it means that the left area and / or the right area have no quality problems, so no processing is required, and the target denoised ECG signal can be output.

[0213] S809: Determine the left area and / or the right area as the breakpoint position.

[0214] Specifically, when the R peak length corresponding to the left region and / or the R peak length corresponding to the right region is greater than a preset length, the left region and / or the right region is determined as a breakpoint position for subsequent analysis and processing.

[0215] S106 , marking the target area in the target denoised ECG signal according to the breakpoint position to obtain a processed ECG signal.

[0216] Specifically, according to the determined breakpoint position, a target area in the target denoised ECG signal is zeroed, wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal, that is, an invalid R peak position.

[0217] It should be noted that the processed ECG signal includes the R peak position at the non-breakpoint position and the ECG signal after the breakpoint abnormal area is zeroed.

[0218] The present application provides a method for processing an electrocardiogram signal, which obtains an original ECG signal, then performs a denoising process on the original ECG signal to obtain a denoised ECG signal, then performs a preliminary denoising process on the denoised ECG signal to obtain a denoised ECG signal, and then performs electromyographic denoising on the denoised ECG signal based on a preset detection algorithm to obtain a target denoised ECG signal, then performs breakpoint identification on the target denoised ECG signal to obtain the breakpoint position corresponding to the target denoised ECG signal, and finally performs a marking process on the target denoised ECG signal according to the breakpoint position to obtain a processed ECG signal, wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal. Thus, by integrating a preset detection algorithm into the method for removing electromyographic noise, the electromyographic noise in the ECG signal can be completely filtered out, and combined with breakpoint identification, the breakpoint position can be identified and marked from the denoised ECG signal to effectively improve the subsequent signal processing efficiency.

[0219] Another embodiment of the present application provides a device for processing electrocardiogram signals, such as Fig. 9 As shown, it includes the following units:

[0220] The signal acquisition unit 901 is used to acquire the original ECG signal.

[0221] The mean processing unit 902 is used to perform a mean removal process on the original ECG signal to obtain a mean removal ECG signal.

[0222] The preliminary processing unit 903 is used to perform preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal.

[0223] The electromyography processing unit 904 is used to perform electromyography denoising processing on the denoised ECG signal based on a preset detection algorithm to obtain a target denoised ECG signal.

[0224] The breakpoint identification unit 905 is used to identify the breakpoints of the target denoised ECG signal to obtain the breakpoint positions corresponding to the target denoised ECG signal.

[0225] The marking processing unit 906 is used to mark the target area in the target denoised ECG signal according to the breakpoint position to obtain a processed ECG signal, wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal.

[0226] It should be noted that the specific working process of the above-mentioned units in the embodiment of the present application can refer to steps S101 to S106 in the above-mentioned method embodiment, and will not be repeated here.

[0227] Optionally, in an electrocardiogram signal processing device provided in another embodiment of the present application, the electromyography processing unit 904 includes:

[0228] The position determination unit is used to determine all R peak positions in the denoised ECG signal through an R peak detection algorithm.

[0229] The first determination unit is used to determine the Q point position on the left side of the R peak position and the S point position on the right side of the R peak position by using the QRS band detection algorithm for all R peak positions, wherein the Q point position refers to the first minimum point on the left side of the R peak position, and the S point position refers to the first minimum point on the right side of the R peak position.

[0230] The disassembling unit is used to disassemble the denoised ECG signal according to the Q point position and the S point position.

[0231] The first search unit is used to search for a first middle area adjacent to the Q point position and the S point position from the disassembled denoised ECG signal in a preset order, and set the first middle area as a QRS band area.

[0232] The second searching unit is used to search for a second middle area adjacent to the S point position and the Q point position from the disassembled denoised ECG signal in a preset order, and set the second middle area as the SQ interval.

[0233] The connection unit is used to perform mean filtering on the SQ interval and connect all QRS band areas with all processed SQ intervals to obtain a target denoised ECG signal.

[0234] Optionally, in an electrocardiogram signal processing device provided in another embodiment of the present application, the position determination unit includes:

[0235] The first creating unit is used to create a window and use the window to move the denoised ECG signal.

[0236] The first filling unit is used to fill the left area of ​​the denoised ECG signal with a first filling value when it is detected that the center of the window is at the starting position of the denoised ECG signal and the denoised ECG signal is in the right area of ​​the window, and continue to move the denoised ECG signal using the window. The first filling value refers to the intensity average of the denoised ECG signal in the window. The left area of ​​the denoised ECG signal refers to the left area of ​​the denoised ECG signal in the current window area where there is no denoised ECG signal.

[0237] The second filling unit is used to fill the right area of ​​the denoised ECG signal with a second filling value when it is detected that the center of the current window is at the end position of the denoised ECG signal. The second filling value refers to the intensity average of the denoised ECG signal in the current window. The right area of ​​the denoised ECG signal refers to the right area of ​​the denoised ECG signal in the area of ​​the current window where there is no denoised ECG signal.

[0238] The first sliding window unit is used to slide the filled denoised ECG signal using the first preset window to obtain each target signal. Each target signal is formed by the maximum difference of each target position in the first preset window during the sliding window process. The target position refers to the position in the first preset window where the maximum signal value of the denoised ECG signal is at the center of the first preset window.

[0239] The third filling unit is used to fill the left area of ​​each target signal with the first target filling value, and fill the right area of ​​each target signal with the second target filling value. Wherein, the first target filling value refers to the average value of the intensity of each target signal in the first preset window when the center of the first preset window is at the starting position of each target signal and each target signal is in the right area of ​​the window. The left area of ​​the target signal refers to the area with the center of the first preset window as the dividing line, the target signal is in the right area of ​​the first preset window, and is not in the left area of ​​the first preset window. The second target filling value refers to the average value of the intensity of each target signal in the current first preset window when the center of the first preset window is at the end position of each target signal. The right area of ​​the target signal refers to the area with the center of the first preset window as the dividing line, the target signal is in the left area of ​​the first preset window, and is not in the right area of ​​the first preset window.

[0240] The second sliding window unit is used to slide the windows of each filled target signal using the second preset window to obtain each R peak position. Wherein, each R peak position refers to the position where all maximum differences in the second preset window are located at the center of the second preset window when the second preset window slides from the starting position of the target signal to the end position of the target signal.

[0241] Optionally, in an electrocardiogram signal processing device provided in another embodiment of the present application, the first determining unit includes:

[0242] The second creation unit is used to create a filter box at the R peak position for all R peak positions respectively.

[0243] The selection unit is used to select all minimum points corresponding to the R peak position from the filter box.

[0244] The third search unit is used to search the first minimum point on the left side and the first minimum point on the right side of the R peak position from all minimum points in the filter frame with the R peak position as the center using double pointers.

[0245] The second determining unit is used to determine the first minimum point on the left side of the R peak position as the Q point position, and determine the first minimum point on the right side of the R peak position as the S point position.

[0246] Optionally, in another embodiment of the present application, a device for processing an electrocardiogram signal further includes:

[0247] The first detection unit is used to detect whether there are multiple target minimum value points in a preset frequency region among all the minimum value points corresponding to the R peak position.

[0248] A setting unit is used to extract a target Q point position and a target S point position from each target minimum point if there are multiple target minimum points in a preset frequency region among all the minimum points corresponding to the R peak position, and set the target Q point position and the target S point position as the minimum length boundary.

[0249] Optionally, in an electrocardiogram signal processing device provided in another embodiment of the present application, the breakpoint identification unit 905 includes:

[0250] The third sliding window unit is used to use a third preset window to slide the target denoised ECG signal to obtain each target maximum difference and each average value corresponding to the target denoised ECG signal.

[0251] The first calculation unit is used to calculate all R peak positions in the target denoised ECG signal based on each target maximum difference and each average value to obtain a target R peak point set.

[0252] The second calculation unit is used to calculate the difference between every two adjacent R peak positions in the R peak point set to obtain each R peak difference.

[0253] The first judgment unit is used to judge whether the number of R peaks in the target R peak point set is greater than a preset threshold.

[0254] The second detection unit is used to detect whether there is a target R peak difference within a preset range among the R peak differences if the number of R peaks in the target R peak point set is greater than a preset threshold.

[0255] The third determining unit is configured to determine two adjacent R peak positions corresponding to the target R peak difference as breakpoint positions if there is a target R peak difference within a preset range among the R peak differences.

[0256] The region acquisition unit is used to acquire the left region of the first R peak position and the right region of the last R peak position in the target R peak point set if the number of R peaks in the target R peak point set is less than a preset threshold.

[0257] The second judgment unit is used to judge whether the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than a preset length.

[0258] The fourth determination unit is used to determine that the left area and / or the right area is a breakpoint position if the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than a preset length.

[0259] Optionally, in an electrocardiogram signal processing device provided in another embodiment of the present application, the preliminary processing unit 903 includes:

[0260] The first processing unit is used to remove baseline drift noise from the de-averaged ECG signal to obtain a processed ECG signal.

[0261] The second processing unit is used to remove power frequency noise from the processed ECG signal to obtain a denoised ECG signal.

[0262] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, and will not be repeated here.

[0263] In summary, another embodiment of the present application provides an electrocardiogram signal processing device that integrates a QRS peak detection algorithm. In the process of processing ECG signals with high noise intensity and low signal intensity, it can completely remove the electromyographic noise and retain the information of P peak and T peak.

[0264] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0265] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing an electrocardiogram signal, characterized in that: include: Get the original ECG signal; Performing a de-averaging process on the original ECG signal to obtain a de-averaged ECG signal; Performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal; Based on a preset detection algorithm, the denoised ECG signal is subjected to electromyography denoising processing to obtain a target denoised ECG signal; Performing breakpoint identification on the target denoised ECG signal to obtain the breakpoint position corresponding to the target denoised ECG signal; According to the breakpoint position, a target area in the target denoised ECG signal is marked to obtain a processed ECG signal; wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal.

2. The method according to claim 1, characterized in that The method of performing electromyography denoising processing on the denoised ECG signal based on a preset detection algorithm to obtain a target denoised ECG signal includes: Determine all R peak positions in the denoised ECG signal by an R peak detection algorithm; For all the R peak positions, respectively, determine the Q point position on the left side of the R peak position and the S point position on the right side through the QRS band detection algorithm; wherein the Q point position refers to the first minimum point on the left side of the R peak position; the S point position refers to the first minimum point on the right side of the R peak position; Decomposing the denoised ECG signal according to the Q point position and the S point position; According to a preset order, searching for a first middle area adjacent to the Q point position and the S point position from the disassembled denoised ECG signal, and setting the first middle area as a QRS band area; According to the preset order, searching for a second middle area adjacent to the S point position and the Q point position from the disassembled denoised ECG signal, and setting the second middle area as the SQ interval; The SQ interval is subjected to mean filtering, and all the QRS band regions are connected with all the processed SQ intervals to obtain a target denoised ECG signal.

3. The method according to claim 2, characterized in that The step of determining all R peak positions in the denoised ECG signal by using an R peak detection algorithm includes: Creating a window, and moving the denoised ECG signal using the window; When it is detected that the center of the window is at the starting position of the denoised ECG signal and the denoised ECG signal is in the right area of ​​the window, the left area of ​​the denoised ECG signal is filled with a first filling value, and the denoised ECG signal is continuously moved using the window; wherein the first filling value refers to the intensity average value of the denoised ECG signal in the window; the left area of ​​the denoised ECG signal refers to the area of ​​the current window where the left area of ​​the denoised ECG signal does not exist; When it is detected that the center of the current window is at the end position of the denoised ECG signal, the right area of ​​the denoised ECG signal is filled with a second filling value; wherein the second filling value refers to the intensity average value of the denoised ECG signal in the current window; the right area of ​​the denoised ECG signal refers to the area of ​​the current window where the right area of ​​the denoised ECG signal does not exist; Using a first preset window, sliding the filled denoised ECG signal to obtain each target signal; wherein each target signal is formed by the maximum difference of each target position in the first preset window during the sliding window process; the target position refers to the position in the first preset window where the maximum signal value of the denoised ECG signal is at the center of the first preset window; The left area of ​​each target signal is filled with a first target filling value, and the right area of ​​each target signal is filled with a second target filling value; wherein the first target filling value refers to the average value of the strength of each target signal in the first preset window when the center of the first preset window is at the starting position of each target signal and each target signal is in the right area of ​​the window; the left area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the right area of ​​the first preset window, and is not in the left area of ​​the first preset window; the second target filling value refers to the average value of the strength of each target signal in the current first preset window when the center of the first preset window is at the end position of each target signal; the right area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the left area of ​​the first preset window, and is not in the right area of ​​the first preset window; Using a second preset window, sliding windows are performed on each of the filled target signals to obtain each R peak position; wherein each of the R peak positions refers to a position in which all maximum differences within the second preset window are located at the center position of the second preset window when the second preset window slides from the starting position of the target signal to the end position of the target signal.

4. The method according to claim 2, characterized in that: The method of determining the Q point position on the left side of the R peak position and the S point position on the right side of the R peak position by using a QRS band detection algorithm for all the R peak positions respectively includes: For all the R peak positions, respectively, create a filter box at the R peak position; Select all minimum value points corresponding to the R peak position from the screening box; In the screening box, taking the R peak position as the center, using double pointers to search for the first minimum point on the left side of the R peak position and the first minimum point on the right side of all the minimum points; The first minimum point on the left side of the R peak position is determined as the Q point position, and the first minimum point on the right side of the R peak position is determined as the S point position.

5. The method according to claim 4, characterized in that Also includes: Detecting whether there are multiple target minimum value points in a preset frequency region among all the minimum value points corresponding to the R peak position; If there are multiple target minimum points in the preset frequency region among all the minimum points corresponding to the R peak position, the target Q point position and the target S point position are extracted from each of the target minimum points, and the target Q point position and the target S point position are set as the minimum length boundary.

6. The method according to claim 1, characterized in that The step of identifying breakpoints of the target denoised ECG signal to obtain breakpoint positions corresponding to the target denoised ECG signal includes: Using a third preset window, sliding the target denoised ECG signal to obtain each target maximum difference and each average value corresponding to the target denoised ECG signal; Based on each of the target maximum difference values ​​and each of the average values, all R peak positions in the target denoised ECG signal are calculated to obtain a target R peak point set; Calculating the difference between every two adjacent R peak positions in the R peak point set to obtain each R peak difference; Determine whether the number of R peaks in the target R peak point set is greater than a preset threshold; If the number of R peaks in the target R peak point set is greater than the preset threshold, detecting whether there is a target R peak difference within a preset range among the R peak differences; If there is a target R peak difference value within a preset range among the R peak differences, two adjacent R peak positions corresponding to the target R peak difference values ​​are determined as breakpoint positions; If the number of R peaks in the target R peak point set is less than a preset threshold, obtaining a left area of ​​the first R peak position and a right area of ​​the last R peak position in the target R peak point set; Determine whether the R peak length corresponding to the left area and / or the R peak length corresponding to the right area is greater than a preset length; If the R peak length corresponding to the left region and / or the R peak length corresponding to the right region is greater than a preset length, the left region and / or the right region is determined to be a breakpoint position.

7. The method according to claim 1, characterized in that The performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal includes: Performing baseline drift noise removal processing on the de-averaged ECG signal to obtain a processed ECG signal; The processed ECG signal is subjected to power frequency noise removal processing to obtain a denoised ECG signal.

8. A device for processing electrocardiogram signals, characterized in that: include: A signal acquisition unit, used for acquiring original ECG signals; A mean processing unit, used for performing a mean removal process on the original ECG signal to obtain a mean removal ECG signal; A preliminary processing unit, used for performing preliminary denoising processing on the de-averaged ECG signal to obtain a denoised ECG signal; An electromyography processing unit, configured to perform electromyography denoising processing on the denoised ECG signal based on a preset detection algorithm to obtain a target denoised ECG signal; A breakpoint identification unit, used to identify breakpoints of the target denoised ECG signal to obtain breakpoint positions corresponding to the target denoised ECG signal; A marking processing unit is used to mark the target area in the target denoised ECG signal according to the breakpoint position to obtain a processed ECG signal; wherein the target area refers to an area where the ECG signal is unstable or has no ECG signal.

9. The device according to claim 8, characterized in that The electromyography processing unit comprises: A position determination unit, configured to determine all R peak positions in the denoised ECG signal by using an R peak detection algorithm; A first determination unit is used to determine, for all the R peak positions, a Q point position on the left side of the R peak position and an S point position on the right side thereof by using a QRS band detection algorithm; wherein the Q point position refers to a first minimum point on the left side of the R peak position; and the S point position refers to a first minimum point on the right side of the R peak position; A disassembling unit, configured to disassemble the denoised ECG signal according to the Q point position and the S point position; A first searching unit is used to search, in a preset order, from the disassembled denoised ECG signal for a first middle region adjacent to the Q point position and the S point position, and set the first middle region as a QRS band region; A second searching unit is used to search, in accordance with the preset order, from the de-noised ECG signal after disassembly, a second middle region adjacent to the S point position and the Q point position, and set the second middle region as the SQ interval; The connection unit is used to perform mean filtering on the SQ interval and connect all the QRS band regions with all the processed SQ intervals to obtain a target denoised ECG signal.

10. The device according to claim 9, characterized in that The position determination unit comprises: A first creation unit, configured to create a window and use the window to move the denoised ECG signal; A first filling unit is used to fill the left area of ​​the denoised ECG signal with a first filling value when it is detected that the center of the window is at the starting position of the denoised ECG signal and the denoised ECG signal is in the right area of ​​the window, and continue to move the denoised ECG signal using the window; wherein the first filling value refers to the intensity average value of the denoised ECG signal in the window; the left area of ​​the denoised ECG signal refers to the area of ​​the current window where the left area of ​​the denoised ECG signal does not exist; A second filling unit is used to fill the right area of ​​the denoised ECG signal with a second filling value when it is detected that the center of the current window is at the end position of the denoised ECG signal; wherein the second filling value refers to the intensity average value of the denoised ECG signal in the current window; the right area of ​​the denoised ECG signal refers to the area of ​​the current window where the right area of ​​the denoised ECG signal does not exist; A first sliding window unit is used to slide the filled denoised ECG signal using a first preset window to obtain each target signal; wherein each target signal is formed by the maximum difference of each target position in the first preset window during the sliding window process; the target position refers to the position in the first preset window where the maximum signal value of the denoised ECG signal is at the center of the first preset window; A third filling unit, used to fill the left area of ​​each target signal with a first target filling value, and to fill the right area of ​​each target signal with a second target filling value; wherein the first target filling value refers to the average value of the strength of each target signal in the first preset window when the center of the first preset window is at the starting position of each target signal and each target signal is in the right area of ​​the window; the left area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the right area of ​​the first preset window, and is not in the left area of ​​the first preset window; the second target filling value refers to the average value of the strength of each target signal in the current first preset window when the center of the first preset window is at the end position of each target signal; the right area of ​​the target signal refers to an area with the center of the first preset window as the dividing line, the target signal is in the left area of ​​the first preset window, and is not in the right area of ​​the first preset window; A second sliding window unit is used to use a second preset window to slide the filled target signals to obtain each R peak position; wherein each R peak position refers to a position in which all maximum differences in the second preset window are located at the center of the second preset window when the second preset window slides from the starting position of the target signal to the end position of the target signal.

Citation Information

Patent Citations

  • Noise segment recognition method, ECG signal processing method and device

    CN108158578A

  • Processing and analysis method based on weak bioelectric signals of human body

    CN109893115A

  • Electromyography noise filtering method for electrocardiosignals

    CN113040784A

  • ECG data wave crest detection method and device and computer equipment

    CN115886834A

  • ECG signal denoising method, system and equipment

    CN118141388A