Real-time ECG signal R wave detection method and system based on MOBD transformation enhancement feature and storage medium

Through low-pass filtering and MOBD transformation combined with sliding window filtering preselected peaks, the screening amplitude and RR spacing standard values are updated in real time, solving the problems of large amount of calculation and weak anti-interference ability in R-wave detection of ECG signals, real-time, accurate and robust R-wave detection is achieved.

CN120241094APending Publication Date: 2025-07-04HOHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510373202.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing ECG signal R-wave detection methods have large calculation volume and weak anti-interference ability in real-time detection, making it difficult to meet the actual clinical application needs.

Method used

Low-pass filtering and MOBD transformation are used to highlight the amplitude and slope characteristics of the R-wave signal, combined with the sliding window to filter preselected peaks, and the standard values of the filtered amplitude and RR spacing are updated in real time. Noise interference is suppressed through symbol consistency constraints, dynamically adapt to ECG signal fluctuations, and improve detection accuracy and robustness.

Benefits of technology

It realizes small calculation volume and accurate detection of R waves in real time, has high robustness, adapts to ECG signal fluctuations, reduces missed and missed detection, and improves detection accuracy and anti-interference ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120241094A_ABST
    Figure CN120241094A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time ECG signal R wave detection method based on MOBD transformation enhancement features, and the method comprises the following steps: S1, carrying out the low-pass filtering of an original electrocardiosignal, and carrying out the MOBD transformation of the filtered electrocardiosignal, so as to obtain a preprocessed electrocardiosignal; s2, traversing the preprocessed electrocardiosignal by adopting a sliding window to screen out preselected peaks meeting requirements; s3, a preliminary screening amplitude is set, a set number of R waves are screened out, and an execution screening amplitude is calculated; s4, screening R waves in the preselected peaks, updating and executing a screening amplitude value and a standard value of an RR interval in real time, judging whether screening is carried out again between the newly screened R wave and the previous R wave according to the RR interval, and if not, continuing to carry out backward screening until all preselected peaks are screened; the method is small in calculation amount, can accurately detect R waves in real time, and is high in robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the detection of R waves in ECG signals, and in particular to a real-time ECG signal R wave detection method, system and storage medium based on enhanced features of MOBD transformation. Background Art

[0002] Cardiovascular diseases have become one of the main diseases increasingly threatening human life. Electrocardiogram (ECG) is one of the main tools for diagnosing cardiac physiological and pathological activities. Therefore, the research on ECG signals has always received wide attention. The main step in detecting and analyzing an ECG signal is to detect the R wave, so as to further locate the positions of QRS complexes and other bands, and obtain information sufficient to evaluate heart rate variability, heart rate turbulence and diagnose many heart diseases (such as arrhythmia, cardiomyopathy, myocardial dysfunction, etc.). Therefore, the accurate detection of the R wave is of utmost importance.

[0003] With the development of technology, the real-time monitoring of electrocardiogram signals has entered daily life from the clinical setting. Traditionally, the Holter devices used for clinical electrocardiogram acquisition will be replaced by personal portable devices, which brings benefits to ordinary people, heart disease patients or high-risk groups. Continuous monitoring of cardiac parameters can capture the precursors of cardiac events and prevent the occurrence of cardiac events. Therefore, the real-time detection of the R wave has become even more important.

[0004] Currently, there are many technologies and methods in the field of electrocardiogram signal R wave detection, mainly including differential threshold method, wavelet transform method, and neural network method, etc. The detection algorithm based on the differential threshold method has the advantage of simple algorithm and is suitable for the real-time detection of R waves, but its anti-interference ability is relatively weak; the detection method based on wavelet transform has high accuracy, but its algorithm has a large amount of calculation and is not suitable for real-time processing and analysis; the neural network method is an algorithm that has developed rapidly at present. Its advantages are that it can better process complex ECG signals, and with the increase of data, its performance usually further improves. The disadvantages are large calculation amount, long model training time, requiring a large number of training samples, and may need to adjust or retrain the model when facing different tasks, making it difficult to meet the actual clinical applications. Summary of the Invention

[0005] Object of the Invention: The object of the present invention is to provide a real-time ECG signal R wave detection method, system and storage medium based on enhanced features of MOBD transformation, which has a small amount of calculation, can accurately detect R waves in real time and has high robustness.

[0006] Technical Solution: The real-time ECG signal R wave detection method based on enhanced features of MOBD transformation according to the present invention includes the following steps:

[0007] S1. Perform low-pass filtering on the original electrocardiogram signal, and perform MOBD transformation on the filtered electrocardiogram signal to obtain a preprocessed electrocardiogram signal;

[0008] S2. Use a sliding window to traverse and preprocess the electrocardiogram signal to screen out preselected peaks that meet the requirements;

[0009] S3. Set a preliminary screening amplitude, and regard the preselected peaks with amplitudes greater than the preliminary screening amplitude as R waves. Calculate the execution screening amplitude according to the set number of R waves screened out;

[0010] S4. Screen the preselected peaks with amplitudes greater than the execution screening amplitude as R waves. During the screening process, the execution screening amplitude and the standard value of the RR interval are updated in real time according to the detected R waves. And according to whether the RR interval between the latest screened R wave and the previous R wave is greater than the standard value of the RR interval multiplied by a set multiple. If so, use the missed detection screening amplitude to perform a secondary screening between these two R waves, otherwise continue to screen backward until all preselected peaks are screened; the missed detection screening amplitude is less than the execution screening amplitude.

[0011] The low-pass filtering and MOBD transformation in step S1 highlight the amplitude characteristics and slope characteristics of the R wave signal. Because the R wave characteristics are tall and steep waveforms, through the cumulative multiplication of difference values, the tall and steep characteristics of the R wave are further amplified, and signals such as noise are further suppressed, making the R wave signal more obvious and improving the detection accuracy; combined with step S2 using a sliding window to screen preselected peaks for subsequent R wave screening, ensuring that only scattered and important peaks are concerned, greatly reducing the calculation amount and shortening the running time of the algorithm; in step S4, the real-time update of the execution screening amplitude and the standard value of the RR interval can dynamically adapt to the changes in the amplitude and RR interval of the R wave to more accurately screen out the R wave. Because the electrocardiogram signal may fluctuate due to various factors during the detection process. If fixed execution screening amplitude and standard values of the RR interval are used, some real R waves may not be detected, improving the accuracy and robustness of this method; then according to whether the RR interval between the latest screened R wave and the previous R wave is greater than the standard value of the RR interval multiplied by a set multiple, to determine whether to perform a secondary screening between the two, so as to avoid missing the detection of R waves when the distance between two R waves is too large, further improving the detection accuracy. Similarly, the ability to detect missed R waves even in the case of abnormal data fluctuations also improves the robustness of this method. In summary, this method has a small calculation amount, can detect R waves in real time, and has high accuracy and robustness.

[0012] As an option, after the filtered electrocardiogram signal in step S1 is subjected to MOBD transformation, a symbol consistency constraint is added. The specific calculation formula is

[0013]

[0014] where y[n] is the preprocessed electrocardiogram signal, N M is the order of the MOBD transformation, and the calculation formula of x[n-k] is x[n-k] = u[n-k] - u[n-k-1]

[0015] Among them, u[n-k] is the sampling value of the filtered electrocardiogram signal at the n-k position.

[0016] Adding the sign consistency constraint to the electrocardiogram signal after MOBD transformation is because if the signs of adjacent difference values are consistent, it indicates that the signal remains unidirectional within a continuous time period, such as continuously rising or falling, which matches the regularity of the coherent changes in ECG features such as the rising or falling edge of the R wave. By retaining the cumulative multiplication result when the signs are consistent, the extraction of such meaningful features can be strengthened. Near the peak of the R wave, there will be a situation where the waveform rises and then falls. Adding the sign consistency constraint will filter out the interference caused by the positive and negative changes in the slopes at both ends of the peak. Moreover, if the signs of adjacent first-order difference values are inconsistent, it indicates that the signal fluctuates repeatedly in a short period of time, which is more likely to be noise or irrelevant interference. Therefore, by adding the sign consistency constraint, more meaningful features can be extracted, noise and other interference signals can be avoided, and the accuracy of the final detection can be improved.

[0017] Preferably, in step S4, the execution screening amplitude is updated in real time according to the following formula

[0018] T t = min{R pk (R n -N t ),R pk (R n -N t +1),...,R pk (R n )}×α t

[0019] Among them, T t is the execution screening amplitude, R pk (R n ) is the amplitude of the R wave of the latest R n th selected, α t is the update coefficient of the screening amplitude, α t and N t are set constants, and the value range of α t is (0,1).

[0020] Calculating the execution screening amplitude according to the above formula means calculating based on the smallest amplitude among the latest detected N t +1 R waves, and the execution screening amplitude is smaller than the smallest amplitude, so as to ensure that the normal R wave peaks can all exceed the execution screening amplitude and be selected, and the execution screening amplitude is continuously updated with the newly selected R waves, which can better adapt to the fluctuations of the electrocardiogram signal.

[0021] Preferably, in step S4, the standard value of the RR interval is updated in real time according to the following formula

[0022]

[0023] where I rr is the standard value of the RR interval, and I r (R n ) is the interval between the Rth n R wave and the previous R wave; α I is a set constant with a value range of (1, 1.3); N rr is a set constant;

[0024] I rm is the reference average value of the RR interval and is calculated according to the following formula

[0025]

[0026] where N rm is a set constant.

[0027] By updating the standard value of the RR interval through the above method, when the RR interval between the newly detected R wave and the previous R wave is too large, the RR intervals between these two R waves and their respective adjacent previous R waves can be excluded from the calculation formula of the standard value, avoiding the overall RR interval standard being affected by these two abnormal values and preventing the error from continuously accumulating during the subsequent screening process, which may lead to an increase in the number of missed detected R waves.

[0028] Preferably, in step S4, the following steps are used to perform a secondary screening using the missed detection screening amplitude between the Rth n R wave in the latest screening and the Rth n -1 R wave:

[0029] S4.1. Calculate the first missed detection screening amplitude according to the following formula

[0030] T t ' = γ1 × T t

[0031] where T t ' is the first missed detection screening amplitude, T t is the execution screening amplitude; γ1 is a set constant with a value range of (0, 1);

[0032] Compare the amplitude of the preselected peak between the Rth n R wave and the Rth n -1 R wave with T t '. If there is a preselected peak with an amplitude greater than T t ' and it is not at the Rth n- If within the refractory period of one R wave, then take this preselected peak as a missed R wave, and update the standard values for performing screening amplitude and RR interval according to the missed R wave, and continue screening backward from the R n th R wave; otherwise, proceed to step S4.2;

[0033] S4.2. Calculate the second missed detection screening amplitude according to the following formula

[0034] T t ” = γ2 × T t

[0035] where T t ” is the second missed detection screening amplitude, γ2 is a set constant and satisfies γ2 < γ1, and the value range is (0, 1);

[0036] Compare the amplitude of the preselected peak between the R n th R wave and the R n -1th R wave with T t ”. If there exists a preselected peak with an amplitude greater than T t ” and not within the refractory period of the R n -1th R wave, then take this preselected peak as a missed R wave, and update the standard values for performing screening amplitude and RR interval according to the missed R wave, and continue screening backward from the R n th R wave; otherwise, proceed to step S4.2;

[0037] S4.3. Determine whether I r (R n ) is greater than β2I rr , where β2 is a set constant with a value range of [1.3, 1.7]. If otherwise, terminate the re-screening between the R n th R wave and the R n -1th R wave, and continue screening for R waves backward from the R n th R wave; if yes, then perform the following process:

[0038] Calculate the third missed detection screening amplitude according to the following formula

[0039] T t ”' = μ × Noise(R n )

[0040] where T t ”' is the second missed detection screening amplitude, and μ is a set constant;

[0041] Noise(R n ) is calculated according to the following formula

[0042]

[0043] where, Ridx(Rn ) is the position of the R wave of the Rth n , Fs is the sampling frequency, and y(i) is the preprocessed ECG signal at the ith position;

[0044] Compare the amplitude of the preselected peak between the Rth n R wave and the (R - 1)th n R wave with T t "'. If there is a preselected peak with an amplitude greater than T t "', and it is not within the refractory period of the (R - 1)th n R wave, then take this preselected peak as a missed R wave, and update the standard values for screening amplitude and RR interval according to the missed R wave. Continue to screen backward from the position of the Rth n R wave; otherwise, continue to screen for R waves backward from the position of the Rth n R wave.

[0045] According to steps S4.1 and S4.2, most of the missed R waves can be screened out. If no missed R waves are detected after these two steps, but the RR interval between the Rth n R wave and the (R - 1)th n R wave is relatively large, then it is still very likely that there is a missed R wave between them. Further screening through step S4.3 can greatly reduce the occurrence of missed R waves and improve the detection accuracy of this method.

[0046] The real-time ECG signal R wave detection system based on MOBD transform enhanced features according to the present invention, the system includes:

[0047] Preprocessing module: used to perform low-pass filtering on the original ECG signal, and perform MOBD transform on the filtered ECG signal to obtain the preprocessed ECG signal;

[0048] Preselected peak screening module: used to traverse the preprocessed ECG signal with a sliding window to screen out the preselected peaks that meet the requirements;

[0049] Execution screening amplitude determination module: used to set the preliminary screening amplitude, take the preselected peaks with amplitudes greater than the preliminary screening amplitude as R waves, and calculate the execution screening amplitude according to the set number of screened R waves;

[0050] R wave screening module: used to screen the preselected peaks with amplitudes greater than the execution screening amplitude as R waves. During the screening process, the standard values of the execution screening amplitude and RR interval are updated in real time according to the detected R waves, and according to whether the RR interval between the latest screened R wave and the previous R wave is greater than the standard value of the RR interval multiplied by the set multiple. If so, use the missed screening amplitude to screen again between these two R waves, otherwise continue to screen backward until all preselected peaks are screened; the missed screening amplitude is less than the execution screening amplitude.

[0051] A computer-readable storage medium storing one or more programs, the one or more programs including instructions which, when executed by a computing device, cause the computing device to execute any of the above methods.

[0052] Advantages: By low-pass filtering and MOBD transformation, the amplitude and slope characteristics of the R-wave signal are highlighted, improving the detection accuracy. Then, by first screening out preselected peaks as alternatives for the R-wave, the computational amount is greatly reduced, enabling real-time detection of this method; real-time updating of the standard values for screening amplitude and RR interval, and judging whether to screen again between the newly screened R-wave and the previous R-wave, as well as adding a symbol consistency constraint to the signal after MOBD transformation, all improve the accuracy and robustness of this method. Description of the Drawings

[0053] Figure 1 is the flowchart of this method;

[0054] Figure 2 is the comparison chart of the electrocardiogram signal before and after 4th-order MOBD transformation;

[0055] Figure 3 is the processing result of this method for signals with irregular R-wave intervals;

[0056] Figure 4 is the processing result of this method for the case where the R-wave has a small amplitude;

[0057] Figure 5 is the recognition result of this method for R-waves when there is strong electromyogram interference. Detailed Embodiments

[0058] As shown in the figure, the real-time ECG signal R-wave detection method based on MOBD transformation enhanced features according to the present invention includes the following steps:

[0059] S1. Perform low-pass filtering on the original electrocardiogram signal, and perform MOBD transformation on the filtered electrocardiogram signal to obtain a preprocessed electrocardiogram signal.

[0060] Prepare the original ECG signal data, which can be obtained from a medical monitoring device. Use a low-pass filter to process the original signal, and set the cut-off frequency of the filter to 10 Hz. For example, if a digital filter is used, the Butterworth low-pass filter design method can be adopted to determine the filter coefficients according to the cut-off frequency and perform the filtering operation on the original signal.

[0061] Then, perform the MOBD(4) transform on the filtered signal, that is, the 4th-order MOBD transform, to obtain the preprocessed signal y(n). The full name of the MOBD transform is The multiplication of backward difference, which is from the literature: S. Suppappola and Ying Sun, "Nonlinear transforms of ECG signals for digital QRS detection: a quantitative analysis," in IEEE Transactions on Biomedical Engineering, vol. 41, no. 4, pp. 397-400, April 1994, doi: 10.1109 / 10.284971.

[0062] In addition to performing the 4th-order MOBD transform, other orders of MOBD transforms such as 2, 3, or 5 can also be used, but the 4th-order transform has the best effect in the present invention.

[0063] The specific process of the MOBD(4) transform is as follows:

[0064] Let u[n] be the sampling value of the ECG signal at the nth position, and x[n] be the first-order backward difference value at the nth position. x[n] is calculated by the following formula:

[0065] x[n] = u[n] - u[n - 1]

[0066] The calculation formula for the Nth-order MOBD transform is:

[0067]

[0068] where y M [n] is the ECG signal after the MOBD transform, and N M is the order of the MOBD transform.

[0069] In addition, adding the sign consistency constraint, if the signs of adjacent first-order difference values are inconsistent, then the value of the preprocessed ECG signal y[n] is set to 0, as shown in the following formula:

[0070] y[n] = 0, if sgn(x[n - k]) ≠ sgn(x[n - (k + 1)]) k = 0, 1…, N - 2

[0071] where sgn[x] is the sign function.

[0072] Through the above process, the nonlinear transform of the ECG signal is completed, and the sign consistency constraint is applied by default. It is represented by the shorthand symbol MOBD(N M ), where N MThat is, the number of x[n] for the cumulative product.

[0073] In this way, the preprocessed electrocardiogram signal calculation formula after low-pass filtering, 4th-order MOBD transformation, and compliance with consistency constraints can be expressed as

[0074]

[0075] S2. Use a sliding window to traverse the preprocessed electrocardiogram signal to screen out the preselected peaks that meet the requirements;

[0076] Traverse the preprocessed electrocardiogram signal y(n) with a sliding window, select the potential peak with the largest amplitude in each sliding window as the candidate peak. The candidate peak selected from the first sliding window is used as the first preselected peak. When the interval between the candidate peak in the second sliding window and the first preselected peak is greater than 80 sampling points, and the candidate peak in the second sliding window is not within the refractory period (200 ms) of the first preselected peak, then the candidate peak in the second sliding window is used as the preselected peak; otherwise, the candidate peak in the second sliding window is eliminated. Determine whether the candidate peaks in the subsequent sliding windows simultaneously meet the conditions that the interval from the first preselected peak is greater than 80 sampling points and is not within the refractory period of the first preselected peak until a candidate peak that meets the conditions is found as the second preselected peak. The subsequent preselected peak screening is to use the second preselected peak as the first preselected peak and repeat the above process until the screening of all preprocessed electrocardiogram signals is completed.

[0077] Among them, the limit requirement that the interval between two preselected peaks should be greater than 80 sampling points can also be adjusted according to the actual situation, such as greater than 70 or 90 sampling points, etc.

[0078] The preselected peaks screened through the above process eliminate the noise peaks with too small amplitudes and intervals, ensuring that only the scattered and important peaks are concerned, greatly reducing the calculation amount and shortening the running time of the algorithm.

[0079] S3. Set the preliminary screening amplitude, and use the preselected peaks with amplitudes greater than the preliminary screening amplitude as R waves, and calculate the execution screening amplitude based on the set number of R waves screened out.

[0080] Take 0.2 times the maximum amplitude of the preprocessed electrocardiogram signal within the first 2 seconds as the preliminary screening amplitude A t , when the amplitude of the preselected peak is greater than A t , use it as the R wave; denote the serial number of the nth detected R wave as R n , and denote the position of the R n th R wave as R idx (R n ), and denote the amplitude of the R n th R wave as R pk (R n ).

[0081] After detecting a sufficient number of R waves, calculate the execution screening amplitude based on the detected R waves. The number of R waves to be detected can be selected according to the actual situation, such as 5, 6, or 7, etc. The calculation formula for the execution screening amplitude is as follows:

[0082] T t =min{R pk (R n0 -N0),R pk (R n0 -N0+1),...,R pk (R n0 )}×α t0

[0083] Among them, T t is the execution screening amplitude, R pk (R n0 ) is the amplitude of the latest screened R wave when calculating the execution screening amplitude, and the serial number of this R wave is R n0 ; α t0 is the assignment coefficient of the screening amplitude and is a given constant. Its value range is (0, 1). Its specific value can be set according to experience or can be selected through multiple experiments. For experimental selection, any value is initially selected, and then the subsequent process is carried out to see the actual detection results and then increase or decrease this value repeatedly to select a suitable value. The set constants mentioned below can all be selected according to the same method and will not be elaborated; in this embodiment, α t0 adopts 0.3; N0 is a set constant, that is, 0.3 times the minimum amplitude among N0 + 1 detected R waves is used as the execution screening amplitude.

[0084] S4. Screen the preselected peaks with amplitudes greater than the execution screening amplitude as R waves. During the screening process, update the execution screening amplitude and the standard value of the RR interval in real time according to the detected R waves, and determine whether the RR interval between the latest screened R wave and the previous R wave is greater than the standard value of the RR interval multiplied by a set multiple. If so, perform secondary screening using the missed detection screening amplitude between these two R waves, otherwise continue to screen backward until all preselected peaks are screened; the missed detection screening amplitude is less than the execution screening amplitude.

[0085] Specifically, update the execution screening amplitude in real time according to the following formula

[0086] T t =min{R pk (R n -N t ),R pk (R n -N t +1),...,R pk (R n )}×α t

[0087] Among them, R pk (R n ) is the amplitude of the R wave of the latest selected Rth, α n is the update coefficient of the screening amplitude, α t and N t are set constants, α t ranges from (0, 1), α t and N t can both be selected with appropriate values according to experience or multiple experiments. In this embodiment, α t takes 0.6 and N t takes 6; in this way, the screening amplitude will be continuously updated with 0.6 times the minimum amplitude among the latest detected 7 R waves. t Take 6; in this way, the screening amplitude will be continuously updated with 0.6 times the minimum amplitude among the latest detected 7 R waves.

[0088] Specifically, the standard value of the RR interval is updated in real time according to the following formula

[0089]

[0090] Among them, I rr is the standard value of the RR interval, I r (R n ) is the interval between the Rth R wave and the previous R wave; α n is a set constant with a value range of (1, 1.3); N I is a set constant; in this embodiment, α rr and N I take 1.1 and 48 respectively; the significance of updating the standard value of the RR interval through the above formula is as follows: rr When the interval between the latest detected Rth R wave and the previous R wave is too large, there may be a situation where the heartbeat interval is irregular near the latest detected R wave. At this time, the RR interval is corrected to the reference average value recalculated after removing the latest two RR intervals. This can avoid the standard value of the RR interval being too large and resulting in missed detection in the case of irregular heartbeat, because subsequently, it is necessary to determine whether to perform re-screening based on the standard value of the RR interval to avoid missed detection. I

[0091] When the interval between the latest detected Rth R wave and the previous R wave is too large, there may be a situation where the heartbeat interval is irregular near the latest detected R wave. At this time, the RR interval is corrected to the reference average value recalculated after removing the latest two RR intervals. This can avoid the standard value of the RR interval being too large and resulting in missed detection in the case of irregular heartbeat, because subsequently, it is necessary to determine whether to perform re-screening based on the standard value of the RR interval to avoid missed detection. I n is the reference average value of the RR interval and is calculated according to the following formula rm

[0092]

[0093]

[0093] Among them, N rm is a set constant, which takes 49 in this embodiment, that is, I rm is the average value of the intervals between the latest detected 49 R waves and the previous R wave, and is also updated in real time.

[0094] I r (R n ) has the following calculation formula

[0095] I r (R n ) = R idx (R n ) - R idx (R n - 1)

[0096] When the latest selected R-th n R wave satisfies I r (R n ) > β1I rr , then there may be a missed judgment. Re-screening is performed between the R-th n R wave and the (R n - 1)-th R wave using the missed detection screening amplitude. β1 is a set constant, and its value range is (1, 1.3). In this embodiment, the value is 1.1.

[0097] Specifically, according to the following steps, re-screening is performed between the latest selected R-th n R wave and the (R n - 1)-th R wave using the missed detection screening amplitude:

[0098] S4.1. Calculate the first missed detection screening amplitude according to the following formula

[0099] T t ' = γ1 × T t

[0100] where T t ' is the first missed detection screening amplitude, and T t is the execution screening amplitude; γ1 is a set constant, and its value range is (0, 1). In this embodiment, the value is 0.3;

[0101] Compare the amplitude of the preselected peak between the R-th n R wave and the (R n - 1)-th R wave with T t '. If there is a preselected peak with an amplitude greater than T t ' and it is not within the refractory period of the (R n - 1)-th R wave. The refractory period is the position range corresponding to the time 200 ms before and after the time corresponding to the (R n - 1)-th R wave, then take this preselected peak as the missed detection R wave, and update the execution screening amplitude and the standard value of the RR interval according to the missed detection R wave, and continue to screen backward from the R-th n R wave; otherwise, go to step S4.2;

[0102] Updating the execution screening amplitude according to the missed detection R wave means taking the original R-thn -6 R waves are removed from the calculation formula of the execution screening amplitude, and then the missed R waves are added to the calculation formula of the execution screening amplitude to update the execution screening amplitude. That is, the missed R wave is equivalent to the original R n The first R wave and the n -1 R wave is inserted, and the number of the missed R wave becomes R n -1, and the original R n -1 R wave number becomes R n -2, and the previous R wave numbers are analogous; the standard value of the RR interval is also the same, taking the missed R wave as the R n -1 R wave, the original R wave number is adjusted in sequence and then calculated and updated; the next two steps of updating and executing the standard value of the screening amplitude and RR interval are similar and will not be repeated here.

[0103] S4.2. Calculate the second missed detection screening amplitude according to the following formula

[0104] T t ”=γ2×T t

[0105] Among them, T t " is the second missed detection screening amplitude, γ2 is a set constant and satisfies γ2<γ1, and the value range is (0,1). In this embodiment, the value is 0.08;

[0106] The R n The first R wave and the n -1 The amplitude of the preselected peak between the R waves and T t "Comparison, if there is a preselected peak with an amplitude greater than T t " and not in the R n -1 R wave refractory period, the preselected peak is regarded as a missed R wave, and the standard values ​​of the screening amplitude and RR interval are updated according to the missed R wave. n Continue screening backward at the R wave; otherwise, go to step S4.2;

[0107] S4.3. Judgment I r (R n ) is greater than β2I rr , where β2 is a set constant, and its value range is [1.3,1.7]. In this embodiment, the value is 1.3. r (R n )>1.3I rr I think R n The first R wave and the n -1 R wave is indeed too large. Even if the first two steps do not filter out missed R waves, further screening is still required between the two to prevent R waves from being filtered out. However, if Ir (R n ) ≤ 1.3I rr If the distance between the two is not too large, most missed detections can be avoided through the screening in the first two steps, and no further screening is required.

[0108] That is, if I r (R n ) is not greater than β2I rr then terminate the re-screening between the R wave of the R n th R wave and the R n -1th R wave, and continue to screen for R waves backward from the R n th R wave; if I r (R n ) is greater than β2I rr then perform the following process:

[0109] Calculate the third missed detection screening amplitude according to the following formula

[0110] T t ”' = μ × Noise(R n )

[0111] where T t ”' is the third missed detection screening amplitude, μ is a set constant, and the value in this embodiment is 250.

[0112] Noise(R n ) is calculated according to the following formula

[0113]

[0114] where Ridx(R n ) is the position of the R wave of the R n th R wave, Fs is the sampling frequency, and y(i) is the preprocessed ECG signal at the i-th position;

[0115] Compare the amplitude of the preselected peak between the R n th R wave and the R n -1th R wave with T t ”'. If there is a preselected peak with an amplitude greater than T t ”' and not within the refractory period of the R n -1th R wave, then regard this preselected peak as a missed detection R wave, update the execution screening amplitude and the standard value of the RR interval according to the missed detection R wave, and continue to screen backward from the R n th R wave; otherwise, continue to screen for R waves backward from the R n th R wave.

[0116] The real-time ECG signal R wave detection system based on MOBD transform enhanced features described in the present invention includes:

[0117] Preprocessing module: used to perform low-pass filtering on the original electrocardiogram (ECG) signal, and perform MOBD transformation on the filtered ECG signal to obtain a preprocessed ECG signal;

[0118] Preselected peak screening module: used to traverse the preprocessed ECG signal with a sliding window to screen out preselected peaks that meet the requirements;

[0119] Execution screening amplitude determination module: used to set a preliminary screening amplitude, take the preselected peaks with amplitudes greater than the preliminary screening amplitude as R waves, and calculate the execution screening amplitude based on the set number of R waves screened out;

[0120] R wave screening module: used to screen the preselected peaks with amplitudes greater than the execution screening amplitude as R waves. During the screening process, the detected R waves are used to update the standard values of the execution screening amplitude and the RR interval in real time, and based on whether the RR interval between the latest screened R wave and the previous R wave is greater than the standard value of the RR interval multiplied by a set multiple. If so, use the missed detection screening amplitude to perform secondary screening between these two R waves, otherwise continue to screen backward until all preselected peaks are screened; the missed detection screening amplitude is less than the execution screening amplitude.

[0121] The computer-readable storage medium storing one or more programs of the present invention includes one or more programs including instructions, and when the instructions are executed by a computing device, the computing device is caused to execute any of the above methods.

[0122] To better illustrate the effect of the present invention, it is verified through specific experiments.

[0123] Among them, the experimental results use sensitivity Se and positive predictive rate P+ as metrics to evaluate the performance of the algorithm, and the calculation formulas are as follows:

[0124]

[0125]

[0126] Among them, TP (true positive) represents the number of correctly detected true R waves; FP (false positive) represents the number of non-R waves judged as R waves; FN (false negative) represents the number of missed true R waves. The higher Se is, the fewer R waves are missed; the higher P+ is, the fewer R waves are misdetected.

[0127] Using the method of the present invention to perform R wave recognition on all data in the MITDB database and several data in the NSTDB database respectively, the results are shown in Table 1 and Table 2 respectively

[0128] Table 1 R wave recognition results of all data in the MITDB database using the method of the present invention

[0129]

[0130]

[0131] As shown in Table 1, the average Se and P+ calculated from the R-wave recognition results of all data in the MITDB database according to the method of the present invention are 99.70% and 99.80% respectively. Compared with the Se of 99.12% and P+ of 97.8% obtained by using the original MOBD method (the method in the literature S. Suppappola and Ying Sun, "Nonlinear transforms of ECG signals for digital QRS detection: a quantitative analysis," in IEEE Transactions on Biomedical Engineering, vol. 41, no. 4, pp. 397-400, April 1994, doi: 10.1109 / 10.284971), both are improved. Therefore, the number of missed and misdetected R-waves using the method of the present invention is less, and the detection accuracy is higher. And compared with the results of the most classic and authoritative P&T algorithm in the field of R-wave detection, which are Se: 99.16% and P+: 99.27% (the results of the P&T method are from the literature J. Pan and W.J. Tompkins, "A Real-Time QRS Detection Algorithm," IEEE Transactions on Biomedical Engineering, vol. BME-32, no. 3, pp. 230–236, Mar. 1985, doi: 10.1109 / tbme.1985.325532.), the Se and P+ of the algorithm in this paper are also better than those of the P&T algorithm under the same database.

[0132] Table 2 R-wave recognition results of several data in the NSTDB database using the method of the present invention

[0133]

[0134] As shown in Table 2, under three common noises in real-time detection, the Se of the method of the present invention can all reach more than 99.83%, and the P+ reaches more than 97.1%, indicating that the method of the present invention has strong anti-interference ability, high robustness in real-time detection, and guaranteed accuracy.

[0135] As Figures 3 - 5 shown, using the method of the present invention to respectively process part of the data No. 232 in the mitdb database (Figure 3 ) part of the data of record 223 in the mitdb database Figure 4 ) and part of the data of record 223 in the mitdb database Figure 5 ) are processed. The red inverted triangles in the figure indicate the R waves that cannot be recognized by the traditional MOBD method. Compared with the traditional detection method, the method of the present invention has a higher accuracy under different interference conditions, and basically no missed R waves will occur.

Claims

1. A real-time R-wave detection method for ECG signals based on enhanced features of MOBD transformation, characterized in that It includes the following steps: S1. Perform low-pass filtering on the original electrocardiogram (ECG) signal, and perform MOBD transformation on the filtered ECG signal to obtain a preprocessed ECG signal; S2. Use a sliding window to traverse the preprocessed ECG signal to screen out preselected peaks that meet the requirements; S3. Set a preliminary screening amplitude, regard the preselected peaks with amplitudes greater than the preliminary screening amplitude as R waves, and calculate the execution screening amplitude based on the set number of detected R waves; S4. Screen the preselected peaks with amplitudes greater than the execution screening amplitude as R waves. During the screening process, the execution screening amplitude and the standard value of the RR interval are updated in real time according to the detected R waves. If the RR interval between the latest detected R wave and the previous R wave is greater than the standard value of the RR interval multiplied by a set multiple, then use the missed detection screening amplitude to perform a secondary screening between these two R waves, otherwise continue to screen backward until all preselected peaks are screened; the missed detection screening amplitude is less than the execution screening amplitude.

2. The detection method according to claim 1, wherein: In step S1, after performing MOBD transformation on the filtered ECG signal, add a symbol consistency constraint, and the calculation formula is where y[n] is the preprocessed electrocardiogram signal, and N M is the order of the MOBD transform. The calculation formula of x[n-k] is x[n-k] = u[n-k] - u[n-k-1] where u[n-k] is the sampling value of the filtered ECG signal at the n-k position.

3. The detection method according to claim 1, wherein: The steps in S2 include the following sub-steps: S2.

1. Use a sliding window to traverse the preprocessed ECG signal, and select the peak with the largest amplitude in each sliding window as a candidate peak. The candidate peak in the first sliding window is used as the first preselected peak; S2.

2. Traverse the candidate peaks after the first preselected peak, and regard the first candidate peak that satisfies the condition that the distance from the first preselected peak is greater than a set distance and is not within the refractory period of the first preselected peak as the second preselected peak; S2.

3. Replace the first preselected peak with the second preselected peak, and return to step S2.2 until all candidate peaks are screened.

4. The detection method according to claim 1, characterized in that: In step S3, calculate the execution screening amplitude according to the following formula Among them, T t is the execution screening amplitude, is the amplitude of the th R wave selected, α t0 is the assignment coefficient of the screening amplitude, N0 and α t0 are set constants, and the value range of α t0 is (0, 1).

5. The detection method according to claim 1, characterized in that: In step S4, update the execution screening amplitude in real time according to the following formula T t = min{R pk (R n - N t ), R pk (R n - N t + 1),..., R pk (R n )} × α t Among them, T t To perform the screening amplitude, R pk (R n ) is the latest screened R n The amplitude of the R wave, α t is the update coefficient of the screening amplitude, α t and N t is the setting constant, α t The value range is (0,1).

6. The detection method according to claim 1, wherein: In step S4, update the standard value of the RR interval in real time according to the following formula Wherein, I rr is the standard value of the RR interval, and I r (R n ) is the interval between the R n -th R wave and the previous R wave; α I is a set constant with a value range of (1, 1.3); N rr is a set constant; I rm is the reference average value of the RR interval and is calculated according to the following formula where N rm is a set constant.

7. The detection method according to claim 6, characterized in that: In step S4, when the latest selected R n -th R wave satisfies I r (R n ) > β1I rr , re-screening is performed between the R n -th R wave and the R n -1-th R wave using the missed detection screening amplitude. β1 is a set constant with a value range of (1, 1.3).

8. The detection method according to claim 7, wherein: The step S4 performs re-screening using the missed detection screening amplitude between the latest screened R n th R wave and the n (R - 1)th R wave according to the following steps: S4.

1. Calculate the first missed detection screening amplitude according to the following formula T t T' = γ1 × T t Among them, T t ' is the first missed detection screening amplitude, and T t is the execution screening amplitude; γ1 is a set constant with a value range of (0, 1); Compare the amplitude of the preselected peak between the R-th n R wave and the (R - 1)-th n R wave with T t '. If there is a preselected peak with an amplitude greater than T t ' and it is not within the refractory period of the (R - 1)-th n R wave, then regard this preselected peak as a missed R wave, and update the standard values for screening the amplitude and RR interval according to the missed R wave, and continue screening backward from the R-th n R wave; otherwise, proceed to step S4.2; S4.

2. Calculate the second missed detection screening amplitude according to the following formula T t ” = γ2 × T t Among them, T t ” is the second missed selection screening amplitude, γ2 is a set constant and satisfies γ2 < γ1, and its value range is (0, 1); Compare the amplitude of the preselected peak between the Rth n R wave and the (R - 1)th n R wave with T t ". If the amplitude of the preselected peak is greater than T t " and it is not within the refractory period of the (R - 1)th n R wave, then regard this preselected peak as a missed R wave, and update the standard values for screening amplitude and RR interval according to the missed R wave, and continue to screen backward from the Rth n R wave; otherwise, proceed to step S4.2; S4.

3. Judgment I r (R n ) is greater than β2I rr , where β2 is a set constant, the value range is [1.3,1.7], if otherwise, terminate the R n The first R wave and the second R n -1 R wave, and then screen again by the R n Continue to screen the R wave backward from the R wave; if it is, do the following: Calculate the third missed detection screening amplitude according to the following formula T t ”' = μ × Noise(R n ) where T t ”' is the third deselected screening amplitude, and μ is a set constant; Noise(R n ) is calculated according to the following formula where Ridx(R n ) is the position of the R-wave of the R n , Fs is the sampling frequency, and y(i) is the preprocessed electrocardiogram signal at the i-th position; Compare the amplitude of the preselected peak between the R-th n R wave and the (R - 1)-th n R wave with T t "'. If there exists a preselected peak with an amplitude greater than T t "' and not within the refractory period of the (R - 1)-th n R wave, then regard this preselected peak as a missed-detected R wave, and update the standard values for screening amplitude and RR interval according to the missed-detected R wave, and continue to screen backward from the R-th n R wave; otherwise, continue to screen for R waves backward from the R-th n R wave.

9. A real-time ECG signal R-wave detection system based on enhanced features of MOBD transformation, characterized in that The described system includes: A preprocessing module: used to perform low-pass filtering on the original ECG signal and perform MOBD transformation on the filtered ECG signal to obtain a preprocessed ECG signal; A preselected peak screening module: used to use a sliding window to traverse the preprocessed ECG signal to screen out preselected peaks that meet the requirements; An execution screening amplitude determination module: used to set a preliminary screening amplitude, regard the preselected peaks with amplitudes greater than the preliminary screening amplitude as R waves, and calculate the execution screening amplitude based on the set number of detected R waves; R-wave screening module: It is used to screen preselected peaks with amplitudes greater than the execution screening amplitude as R-waves. During the screening process, the detected R-waves update the standard values of the execution screening amplitude and the RR interval in real time, and based on whether the RR interval between the latest screened R-wave and the previous R-wave is greater than the standard value of the RR interval multiplied by a set multiple. If so, re-screening is performed between these two R-waves using the missed detection screening amplitude. Otherwise, continue to screen backward until all preselected peaks are screened; the missed detection screening amplitude is less than the execution screening amplitude.

10. A computer-readable storage medium storing one or more programs, characterized in that: Comprising one or more programs including instructions that, when executed by a computing device, cause the computing device to perform any of the methods according to claims 1 to 8.