Electrocardiogram correction methods and devices, electronic equipment and software products
By identifying cardiac cycle feature points in electrocardiogram (ECG) data and using the difference in signal average values for baseline drift correction, the problem of effectively eliminating ECG baseline drift is solved, achieving accurate correction and real-time display of ECG data, and is applicable to various applications in the medical, health, and sports fields.
Patent Information
- Application Number
- CN202510585103.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2026-11-10
AI Technical Summary
Existing technologies are difficult to effectively eliminate baseline drift in electrocardiograms, especially in terms of baseline differences between cardiac cycles, and are difficult to meet real-time processing requirements in real-time display applications.
By identifying multiple cardiac cycle feature points in electrocardiogram (ECG) data, determining the average signal value within the time window of the feature point, and using a sequential moving comparison and dynamic threshold mechanism to correct baseline drift based on the difference in the average signal value of feature points in adjacent cardiac cycles, the ECG data can be accurately corrected by combining a sliding window and gradient method to identify feature points.
It significantly improves the accuracy and real-time performance of electrocardiogram interpretation, enabling efficient continuous processing on mobile devices with limited computing resources, and is suitable for various scenarios in the medical, health, and sports fields.
Smart Images

Figure CN123058745A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medicine, health, or sports, and in particular to electrocardiogram correction methods and apparatus, electronic devices, and program products. Background Technology
[0002] Electrocardiography (ECG) is an important tool for clinical diagnosis and monitoring of heart disease. However, baseline drift frequently occurs during ECG signal acquisition and display. This refers to low-frequency noise in the ECG signal caused by non-cardiac activity. This noise affects the ECG waveform display, leading to baseline instability and thus affecting the accuracy of interpretation. Common types of baseline drift include baseline drift caused by respiratory movements, muscle tremors (electromyographic interference), poor electrode contact, and power supply interference.
[0003] Currently, baseline drift on electrocardiograms (ECGs) is primarily eliminated by removing low-frequency components of the signal. Common methods include hardware processing, such as selecting high-quality electrodes to reduce contact noise, ensuring proper electrode placement on the skin to avoid poor contact between the electrodes and the skin, and ensuring proper grounding of the device to reduce power supply interference. In terms of signal processing, high-pass filters with a cutoff frequency set between 0.5 and 1 Hz are typically used to remove low-frequency baseline drift.
[0004] However, existing technologies still have certain limitations in dealing with ECG baseline drift and are difficult to effectively eliminate ECG baseline drift.
[0005] The background description is provided for the purpose of understanding the relevant technologies in this field and is not intended as an admission of prior art. Summary of the Invention
[0006] The embodiments of the present invention aim to provide an electrocardiogram correction solution that at least partially alleviates or solves the above-mentioned technical problems.
[0007] In a first aspect, embodiments of the present invention provide an electrocardiogram correction method, comprising: Identify corresponding feature points across multiple cardiac cycles in electrocardiogram (ECG) data; Determine the average signal value within the first time window corresponding to the feature points of the plurality of cardiac cycles; Based on the difference in the average signal value of the corresponding feature points in the first time window of adjacent cardiac cycles, the baseline drift between adjacent cardiac cycles is determined, and the electrocardiogram data between the adjacent cardiac cycles is corrected for baseline drift.
[0008] In some embodiments, the step of determining the signal average value and the baseline drift correction step are performed in a sequential moving comparison manner, including: Based on the corresponding feature points of the identified multiple cardiac cycles, select the corresponding feature points of adjacent groups of cardiac cycles, where each group has one or more cardiac cycles. Calculate the average signal value of each selected group of corresponding feature points within the first time window; The baseline drift between cardiac cycles of adjacent groups is determined based on the difference in the average signal values of corresponding feature points in adjacent groups. Based on the baseline drift and the temporal position relationship of each sampling point of the electrocardiogram data, the electrocardiogram data between adjacent cardiac cycles are corrected. The adjacent groups are sequentially moved to select adjacent groups, so that the later group in the previously selected adjacent group becomes the earlier group in the currently selected adjacent group. The above calculation, determination and correction steps are repeated until the baseline drift correction of the electrocardiogram data is completed.
[0009] In some embodiments, correcting the electrocardiogram data between adjacent cardiac cycles based on the baseline drift and the temporal relationship of the electrocardiogram data includes: Determine the proportional relationship between the time interval between each sampling point and the feature point relative to the total time interval between the corresponding feature points; Based on the baseline drift and the proportional relationship, determine the dynamic correction amount corresponding to each sampling point; The determined dynamic correction amount is used to correct each sampling point individually.
[0010] In some embodiments, the corresponding feature point includes the R peak value of the QRS wave.
[0011] In some embodiments, identifying corresponding feature points of multiple cardiac cycles in electrocardiogram data includes: A second time window is set for the electrocardiogram data; The second time window is moved sequentially along the time direction to determine the maximum value of the electrocardiogram data within the sequentially moved second time window; Based on the changing trend of the maximum value within the second time window of adjacent locations, feature candidate points are determined; and The corresponding feature points of the cardiac cycle are identified from the candidate feature points by threshold screening.
[0012] In some embodiments, determining the feature candidate points based on the changing trend of the maximum value within a second time window of adjacent locations includes: Determine the difference between the maximum values within adjacent second time windows; and The point where the difference changes from a positive value to a negative value is identified as the feature candidate point.
[0013] In some embodiments, selecting the corresponding feature point of the cardiac cycle from the candidate feature points by threshold filtering includes: Determine the maximum value among all feature candidate points; Feature candidate points greater than the maximum value minus a given threshold are selected as the corresponding feature points of the cardiac cycle.
[0014] In some embodiments, selecting the corresponding feature point of the cardiac cycle from the candidate feature points by threshold filtering includes: Set the initial dynamic threshold; The initial corresponding feature points are determined by comparing the determined candidate feature points with the initial dynamic threshold. As the candidate feature points are continuously determined, the dynamic threshold is continuously updated based on the determined corresponding feature points, and the updated dynamic threshold is used to continue to identify the corresponding feature points of subsequent cardiac cycles. Specifically, after identifying corresponding feature points of at least two adjacent cardiac cycles, the steps of determining the average signal value and the baseline drift correction step are performed in real time.
[0015] In some embodiments, the electrocardiogram data is in the form of multiple consecutive buffered data segments. Perform the step of identifying the corresponding feature points for each buffered data segment; Specifically, after identifying the corresponding feature points for the first buffered data segment, the steps of determining the average signal value and the baseline drift correction step are executed in real time.
[0016] In a second aspect, embodiments of the present invention provide an electrocardiogram correction device, which may include: The recognition unit is configured to recognize corresponding feature points of multiple cardiac cycles in electrocardiogram data; The determining unit is configured to determine the average signal value within a first time window of the corresponding feature points of the plurality of cardiac cycles; The correction unit is configured to determine the baseline drift between adjacent cardiac cycles based on the difference in the average signal value of the corresponding feature points within the first time window of adjacent cardiac cycles, and to perform baseline drift correction on the electrocardiogram data between the adjacent cardiac cycles.
[0017] In a third aspect, embodiments of the present invention provide an electronic device that may include: a processor and a memory storing a computer program, the processor being configured to implement the method as described in the first aspect when executing the computer program.
[0018] In a fourth aspect, embodiments of the present invention provide a program product including a computer program, wherein the computer program, when executed by a processor, implements the method described in the first aspect.
[0019] In a fifth aspect, embodiments of the present invention provide a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method described in the first aspect.
[0020] The electrocardiogram (ECG) correction method provided in this invention identifies multiple cardiac cycle feature points in ECG data, determines the average signal value of the corresponding feature points within a first time window of multiple cardiac cycles, and determines the baseline drift based on the difference in the average signal values of adjacent feature points, thereby achieving correction of ECG data between adjacent cardiac cycles. This ECG correction method uses cardiac cycle feature points as a reference, determines baseline drift by analyzing the signal characteristics of the feature points, and considers the periodicity of ECG signals, more accurately capturing and correcting baseline differences between different cardiac cycles, significantly improving the accuracy of ECG interpretation.
[0021] In a further embodiment of the present invention, the above-mentioned mean determination step and correction step are also performed by sequential moving comparison. By selecting adjacent groups of cardiac cycles and continuously updating the correction parameters, real-time correction of continuous electrocardiogram data is achieved.
[0022] In an additional embodiment of the present invention, feature point recognition adopts a combination of sliding window and gradient method. Candidate points are determined by analyzing the changing trend of the maximum signal value in adjacent windows, and effective feature points are identified by threshold screening. This greatly improves the accuracy and sensitivity of feature point recognition and provides a reliable reference point for baseline drift correction.
[0023] In another additional embodiment of the present invention, a dynamic threshold mechanism is introduced for feature point recognition. By setting an initial dynamic threshold and continuously updating the threshold according to the determined feature points, the system can adapt to the dynamic changes of the signal. This mechanism can perform correction in real time without waiting for all feature points to be identified and determined, further improving real-time performance.
[0024] In another additional embodiment of the present invention, the feature point recognition adopts a segmented buffering processing mechanism. By processing the electrocardiogram data into multiple consecutive buffered data segments independently, feature point recognition is performed independently for each data segment. This allows the correction process to begin immediately after the feature point in the first data segment is identified, while continuing to process subsequent data segments, thus achieving pipelined real-time processing.
[0025] Other optional features and technical effects of the embodiments of the present invention are partly described below and partly apparent from reading this document. Attached Figure Description
[0026] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The elements shown are not limited to the scale shown in the drawings, and the same or similar reference numerals in the drawings denote the same or similar elements, wherein: Figure 1 This is an exemplary flowchart of an electrocardiogram correction method according to an embodiment of the present invention; Figure 2 This is an exemplary flowchart of an electrocardiogram correction method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of an electrocardiogram waveform related to the electrocardiogram correction method according to an embodiment of the present invention; Figure 4 This is an exemplary flowchart of an electrocardiogram correction method according to an embodiment of the present invention; Figure 5 This is an exemplary flowchart of an electrocardiogram correction method according to an embodiment of the present invention; Figure 6 This is an exemplary flowchart of an electrocardiogram R-peak detection method according to an embodiment of the present invention; Figure 7 This is a schematic diagram of an electrocardiogram waveform related to the electrocardiogram correction method and the electrocardiogram R-peak detection method according to embodiments of the present invention; Figure 8 This is an exemplary device diagram of an electrocardiogram correction apparatus according to an embodiment of the present invention; Figure 9 This is an exemplary device diagram of an electrocardiogram R-peak detection device according to an embodiment of the present invention; Figure 10 An exemplary structural diagram of an electronic device capable of implementing the method according to an embodiment of the present invention is shown. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0028] The embodiments of the present invention relate to electrocardiogram correction, and other embodiments also relate to electrocardiogram R peak detection.
[0029] As mentioned earlier, baseline drift often occurs during the acquisition and display of electrocardiograms (ECGs), affecting the accurate interpretation of the ECG. Traditional methods for eliminating baseline drift mainly include hardware processing and signal processing techniques such as high-pass filters, but these methods have certain limitations in handling baseline differences between different cardiac cycles.
[0030] The inventors also know of algorithms for implementing ECG baseline drift correction, such as polynomial fitting and wavelet transform methods. However, these algorithms suffer from problems such as computational complexity and poor real-time performance.
[0031] Furthermore, current correction methods do not fully consider the periodicity of ECG signals and the baseline drift characteristics during each cycle, making it difficult to accurately capture and correct baseline changes between different cardiac cycles. In addition, achieving efficient continuous processing is a significant challenge in applications requiring real-time display of ECG waveforms, especially in mobile applications with limited computing resources (such as real-time ECG display in smartphone apps), where current methods often fall short of real-time processing requirements.
[0032] To address the aforementioned technical problems, embodiments of the present invention provide an innovative electrocardiogram (ECG) correction method. Based on the periodicity of the cardiac cycle and the relative consistency between cycles, embodiments of the present invention propose an ECG correction scheme that uses cardiac cycle characteristic points, particularly the R-peak value of the QRS complex, the main waveform constituting the cardiac cycle, as a basis. By analyzing the signal characteristics of corresponding characteristic points (such as the R-peak value) of each cardiac cycle, baseline drift is determined, and preferably, accurate and efficient baseline drift correction is achieved based on the temporal position relationship.
[0033] Further embodiments of the present invention provide a variety of optional and preferred features. Regarding feature point recognition, further embodiments of the present invention propose a recognition method based on a combination of sliding window and gradient methods, and optionally also propose a dynamic threshold mechanism and a segmented buffering processing mechanism. Regarding baseline drift correction, further embodiments of the present invention propose a sequential moving comparison execution method and a correction algorithm based on linear interpolation of time position. Those skilled in the art will understand that the present invention can be implemented with the foregoing basic embodiments to obtain improved baseline drift correction effects compared to known techniques, and can also be combined with one or more optional or preferred features or schemes to obtain further technical effects, which fall within the scope of the present invention.
[0034] The electrocardiogram (ECG) correction method provided in this invention can be applied to various scenarios involving medical treatment, health, or sports, including but not limited to: ECG signal processing in medical devices, remote medical monitoring systems, portable health management devices, cardiology teaching and research, and ECG screening in primary healthcare institutions. It also includes various application scenarios in the health or sports field, including but not limited to scenarios involving health apps or sports apps adapted to ECG detection devices. This invention is particularly suitable for scenarios where real-time display of ECG waveforms is required in health or sports monitoring apps on mobile devices such as smartphones and wearable devices. Specifically, as an explanation, all steps of the methods described in this invention, especially the ECG correction method, can be implemented by devices such as computers, and thus belong to information processing methods. More specifically, the ECG correction method can automatically process and analyze the collected ECG signals using a computer, including feature point identification, baseline drift determination and correction, etc., and all processing steps can be automatically completed by the computer system.
[0035] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0036] In this embodiment of the invention, an electrocardiogram (ECG) correction method is provided. Specifically, this ECG correction method is a baseline drift correction method. Specifically, as... Figure 1 As shown, the electrocardiogram correction method may include: Step 110: Identify corresponding feature points for multiple cardiac cycles in the electrocardiogram data; Step 120: Determine the average signal value within the first time window of the corresponding feature points of the plurality of cardiac cycles; Step 130: Determine the baseline drift between adjacent cardiac cycles based on the difference in the average signal value of the corresponding feature points within the first time window of adjacent cardiac cycles, and perform baseline drift correction on the electrocardiogram data between the adjacent cardiac cycles.
[0037] In this embodiment of the invention, the electrocardiogram (ECG) data can be continuous time-series data, denoted as f(n), where n = 1, 2, ..., N, and N is the total number of sampling points. In this embodiment of the invention, the ECG data can be acquired in various forms, such as, but not limited to, acquisition via single-lead or multi-lead ECG devices. In this embodiment of the invention, the ECG data can be in various forms and can be combined with the methods described in this embodiment to obtain new embodiments. For example, the ECG data can be continuously acquired, such as a real-time acquired time series, or it can be multiple consecutive buffered data segments ordered by time, or it can be complete time-series data. In this embodiment of the invention, the sampling frequency of the ECG data can be selected according to application requirements, for example, a sampling value of 100Hz to 1000Hz.
[0038] In some embodiments, the electrocardiogram data may be preprocessed, such as filtering out power line interference and electromyographic interference.
[0039] In this embodiment of the invention, the feature points refer to electrocardiographic features that can be clearly identified in the cardiac cycle, preferably peaks and / or troughs. Those skilled in the art will understand that the cardiac cycle is a complete mechanical activity process consisting of one contraction and relaxation of the heart, controlled by the heart's electrical activity pattern (i.e., rhythm), and presented on the electrocardiogram as a series of characteristic waveforms. Typically, the heart's rhythm originates from the sinoatrial node, with electrical impulses sequentially activating the atria and ventricles according to specific conduction pathways, forming a periodic cardiac cycle. In this embodiment of the invention, the corresponding feature points of the cardiac cycle can be any significant feature in the electrocardiogram, preferably involving characteristic locations of waveform structures on the electrocardiogram that can clearly identify specific stages of the heart's electrical activity, such as the peaks and / or troughs of the waveform structure. In specific embodiments, these corresponding feature points may include, but are not limited to, the R peak (representing the main electrical activity of ventricular depolarization), P peak (representing atrial depolarization), T peak (representing ventricular repolarization), Q troughs, S troughs in the QRS complex, or combinations thereof.
[0040] In some embodiments, the corresponding feature point of the cardiac cycle includes or is the R-peak value of an adjacent cardiac cycle, or it can be described as the R-peak value of an adjacent QRS wave, as further explained below. In other embodiments, multiple feature points can be used simultaneously. For example, the corresponding feature point may include a first (primary) corresponding feature point and one or more second (secondary) corresponding feature points. Preferably, the first corresponding feature point is the R-peak value of the QRS wave, and the one or more second corresponding feature points are one or more of the P-peak value, T-peak value, Q-trough value, or S-trough value of the QRS wave, for example, using both the R-peak value and the T-peak value simultaneously, as further explained below.
[0041] In embodiments of the present invention, feature point identification can employ any suitable method, such as, but not limited to, threshold comparison, slope analysis, wavelet transform, template matching, etc. In some embodiments of the present invention, a combination of sliding window and gradient methods (such as first-order difference methods) can be used to identify feature points (such as R-peak values). Furthermore, those skilled in the art will understand that, under the explicit teachings of the present invention, the R-peak detection method based on sliding window and gradient methods (such as first-order difference methods), as described below, can be implemented independently of the electrocardiogram correction method, and this method can be explicitly protected in this patent or subsequent patents.
[0042] In this embodiment of the invention, in step 120, the corresponding feature point within the first time window means that the feature point is located within the time window range. More preferably, the first time window is set with the corresponding feature point as the center, for example, with the peak value of R as the center. Preferably, the first time window forms a window of fixed size. For example, for a feature point located at time point t (such as the peak value of R), the first time window can cover the range [t-T1 / 2, t+T1 / 2], where T1 is the first time window. Figure 3 As shown, for corresponding characteristic points of two adjacent cardiac cycles (such as the R peak value r of adjacent QRS waves), i and r i+1 The first time window T can be set separately. 1,i and T 1,i+1 In this embodiment of the invention, the size of the first time window T1 can be adjusted as needed. For example, a larger T can improve the stability of the average value but may reduce sensitivity to local changes; a smaller T has the opposite effect. In some alternative embodiments, the first time window may not be centered on the feature point, but may be shifted forward or backward. That is, the first time window may be asymmetrical relative to the feature point, for example, the feature point may serve as the start or end point of the time window, such as [t, t+T1] or [t-T1, t]. In other embodiments, the size of the first time window may also be adaptive, dynamically adjusted according to heart rate or signal quality.
[0043] In this embodiment of the invention, in step 120, signal feature values can be calculated in various ways, such as signal averages, including arithmetic averages. For example, for a feature point located at time point t, if there are N sampling points within its corresponding first time window, the signal average F can be expressed as F = (1 / N)∑f(n), where f(n) is the signal value of the nth sampling point, and the summation range is all sampling points within the time window. In other embodiments, a weighted average can be used, for example, giving higher weights to sampling points closer to the feature point. In some embodiments, the signal within the window can be preprocessed before calculating the average, such as removing possible high-frequency noise.
[0044] In this embodiment of the invention, in step 130, the baseline drift between adjacent cardiac cycles can be determined based on the difference in the average signal value of the corresponding feature points within the first time window of adjacent cardiac cycles, and the electrocardiogram data between the adjacent cardiac cycles can be corrected for baseline drift.
[0045] The baseline drift correction step in this embodiment of the invention can be applied to corresponding feature points of a single type (e.g., using only the R peak value). In this case, the baseline drift can be determined, for example, based on the difference between the corresponding feature points of the single type, such as an arithmetic difference (e.g., Δ = F2 - F1, where F1 and F2 are the average signal values of two adjacent feature points within the first time window), as further described below. Furthermore, the difference described in this embodiment of the invention can also be a normalized difference or other forms of comparison results.
[0046] In other embodiments, the baseline drift correction step can also be combined with a scheme using multiple feature points (e.g., simultaneously using the R-peak as the first feature point and the T-peak as the second feature point). For example, the signal feature values of the first corresponding feature point and the second corresponding feature point are combined to determine the baseline drift amount. In some embodiments, multiple different strategies can be employed based on multiple feature points. For example, the initial baseline drift amount can be determined based on the signal feature value of the first corresponding feature point, and the initial baseline drift amount can be corrected based on the signal feature value of the second corresponding feature point to determine the baseline drift amount. Alternatively, the signal feature values of the first corresponding feature point and the second corresponding feature point can be weighted or unweighted to obtain a composite signal feature value to determine the baseline drift amount.
[0047] In some other embodiments, the baseline drift correction step can be applied not only to a single pair of adjacent cardiac cycles, but also to multiple consecutive cardiac cycles simultaneously. For example, signal characteristic values (such as R peaks) at corresponding feature points of multiple adjacent (overlapping or non-overlapping) cardiac cycles can be compared. More specifically, for example, the first two cardiac cycles (such as C...) can be compared... i and C i+1 As a group, the two adjacent cardiac cycles (e.g., C) are considered together. i+2 and C i+3 As another group, calculate the weighted or unweighted average of the signal characteristic values of the corresponding characteristic points (R peak values) within the first time window in each group, and then compare the differences between the groups.
[0048] In the electrocardiogram correction method of this embodiment, steps 120 (signal average value determination step) and 130 (baseline drift correction step) can have different data processing timing characteristics. In some embodiments, steps 120 (signal averaging step) and 130 (baseline drift correction step) described above can use a real-time updated sequential shift correction mode. In one example, in the sequential shift correction mode, by continuously updating adjacent cardiac cycle groups, baseline drift correction begins after acquiring the minimum necessary corresponding feature points (e.g., two adjacent feature points), while simultaneously receiving new data and identifying new feature points. The feature point that has completed baseline drift correction is used as the preceding feature point for the next baseline drift correction, achieving continuous real-time correction processing. This sequential shift correction mode ensures real-time processing, provides a relatively stable correction effect through inter-group comparison, and requires less computation and throughput. See the following reference... Figure 2 Further detailed description.
[0049] In other embodiments, steps 120 (signal averaging step) and 130 (baseline drift correction step) described above can use a near real-time segmented buffer correction mode. The segmented buffer correction mode receives ECG data as multiple consecutive buffered data segments. For each data segment, feature point identification and signal averaging determination and baseline drift correction can be performed independently. This mode can begin processing as soon as a segment of buffered data is received, without waiting for all data acquisition to complete, thus providing a degree of real-time performance.
[0050] In some embodiments, steps 120 (signal averaging step) and 130 (baseline drift correction step) can be executed in parallel, thereby simultaneously performing signal averaging and baseline drift correction processing for corresponding feature points of each adjacent cardiac cycle. This can also be referred to as the full processing mode. The full processing mode can first acquire complete electrocardiogram data, then identify feature points of all cardiac cycles, and finally perform baseline drift calculation and correction.
[0051] Continue to refer to Figure 2 The following describes a further embodiment of the invention, which uses a real-time updated sequential movement correction mode.
[0052] In this embodiment, the steps of determining the signal average value and the baseline drift correction step are performed in a sequential moving comparison manner, and more specifically include the following steps: Step 210: Based on the corresponding feature points of the identified multiple cardiac cycles, select the corresponding feature points of adjacent groups of cardiac cycles, where each group has one or more cardiac cycles.
[0053] In this embodiment of the invention, corresponding feature points of adjacent cardiac cycles can be selected for baseline drift correction. Step 210 involves selecting adjacent groups of cardiac cycles according to rules and determining the corresponding feature points in these cardiac cycles.
[0054] In this embodiment of the invention, adjacent cardiac cycles include selecting two adjacent cardiac cycles for processing.
[0055] In this embodiment of the invention, each group may contain one or more cardiac cycles, and the corresponding feature points within the group will be used to calculate the average signal value.
[0056] In some embodiments of the present invention, each group contains only one feature point of a cardiac cycle. In further embodiments, each group has a single corresponding feature point. For example, the corresponding feature points of adjacent cardiac cycles may include the R peak values of two adjacent QRS waves, such as R... i R is the corresponding characteristic point of the i-th cardiac cycle (the R peak value of the i-th QRS wave). i+1 This refers to the corresponding characteristic point of the (i+1)th cardiac cycle (the R peak value of the (i+1)th QRS wave). Some specific embodiments of the present invention will be described in detail using this as an example, but it is conceivable that these specific embodiments can also be combined with different grouping methods, such as the grouping methods described below.
[0057] In other embodiments of the invention, different grouping methods and different corresponding feature point forms may be covered. In some specific embodiments, each group may contain multiple cardiac cycles. For example, consecutive cardiac cycles C can be grouped into multiple groups. i C i+1 As the first group in the adjacent group, C i+2 C i+3 As the latter group. In a further embodiment, the cardiac cycles of adjacent groups may partially overlap. For example, an overlapping approach can be used, where cardiac cycles C i C i+1 As the first group in the adjacent group, C i+1 C i+2 As the latter group, C i+1 It belongs to two groups simultaneously. Furthermore, each group includes multiple cardiac cycles and / or overlapping adjacent groups, and can also be combined with single or multiple corresponding feature points. For example, the aforementioned adjacent cardiac cycles (C...) can be selected. i C i+1 ), (C i+2 C i+3 ) or (C i C i+1 ), (C i+1 C i+2 The peak value of R (R) i R i+1 ), (R) i+2 R i+3 ) or (R i R i+1 ), (R) i+1 R i+2) can be used as the corresponding feature point. For example, the above-mentioned adjacent cardiac cycles (C) can also be selected. i C i+1 ), (C i+2 C i+3 ) or (C i C i+1 ), (C i+1 C i+2 R peak value (R) i R i+1 ), (R) i+2 R i+3 ) or (R i R i+1 ), (R) i+1 R i+2 The first feature point is defined as [the first feature point], and other feature points of the adjacent cardiac cycles, such as the T peak, are defined as the second feature points. All of the above fall within the scope of this invention.
[0058] In some embodiments, grouping adjacent cardiac cycles with partial overlap has particular advantages. The overlap between groups makes the transition between adjacent treatment intervals smoother, avoiding potential calibration inconsistencies at interval boundaries. Simultaneously, overlapping grouping enhances the continuity of the calibration process and improves the stability of the overall calibration effect.
[0059] In the following steps, we will use the basic implementation method as an example, where each group contains one cardiac cycle, and the R peak value of two adjacent QRS waves is R i and R i+1 Taking the corresponding feature points of adjacent cardiac cycles as an example (e.g.) Figure 3 (As shown in the figure) to illustrate in detail the process of calculating the signal average value and determining and correcting baseline drift.
[0060] Step 220: Calculate the average signal value of each selected group of corresponding feature points within the first time window.
[0061] In this embodiment of the invention, step 220 involves calculating the average signal value within the first time window of each group of corresponding feature points selected in step 210. By obtaining the average signal value within the window surrounding the feature point, the baseline level at each corresponding feature point can be reflected.
[0062] In this embodiment of the invention, for corresponding feature points in adjacent groups, a first time window can be set and the signal feature value, more specifically the signal average value, calculated within the window. Preferably, the first time window is set with the corresponding feature point as the center, forming a window of fixed size. For example, as... Figure 3 As shown, the R-peak value of two adjacent QRS waves is R0. i and R i+1Set a time window for the center, here it is the first time window T. 1,i T 1,i+1 (When the first time window is set to a fixed window during the processing of the electrocardiogram data, T) 1,i =T 1,i+1 The following description will use a fixed window as an example, and the first time window will be denoted as T1. Therefore, the signal characteristic value, more specifically the signal average value, within the first time window is calculated.
[0063] Here, the peak value R of the QRS wave is calculated. i The formula for the average signal value within the first time window centered on the signal is: For example, for the first R peak, the formula is expressed as: Where f(n) is the signal value of the nth sampling point within the window, and the summation range covers all sampling points within that time window. Similarly, for the peak value R... i+1 You can set time windows of the same size to calculate the average signal F. i+1 ,Right now: In schemes where each group contains multiple cardiac cycles, the average signal value of the corresponding feature points for each cardiac cycle within the group can be calculated first, and then the group average can be obtained. For example, for a scheme containing cardiac cycles (C... i C i+1 For groups of ), their corresponding feature points (such as (R) can be calculated separately. i R i+1 The average value of the signal is calculated, and then the average value within the group is calculated as the overall signal characteristic value of the group.
[0064] In this embodiment of the invention, the time window size T1 can be selected as needed. For example, different windows can be set for the electrocardiogram data of different subjects, or different windows can be set for different batches of electrocardiogram data, which falls within the scope of this invention.
[0065] In addition to the above-described embodiments, the present invention can also provide various variant forms of signal feature value calculation.
[0066] In some embodiments, as described above, an asymmetric time window setting can be configured. For example, the first time window may not be centered on the feature point, but may be configured with a forward or backward offset, such as [t, t+T1] or [t-T1, t], where t is the time of the feature point.
[0067] In some embodiments, an adaptive window can be set. For example, T 1,i ≠T1,i+1 .
[0068] In some embodiments, a weighted average with different weights can be set, that is, different weights can be assigned to the sampling points within the window, for example, making the sampling points closer to the feature points have higher weights, so as to enhance the local features.
[0069] In some embodiments, supplementary or alternative statistics can be provided: statistics such as the median, trimmed mean, or mode can be used instead of the arithmetic mean.
[0070] In some embodiments, preprocessing filtering can be set: the signal within the window is preprocessed before calculating feature values, such as the average value, such as removing high-frequency noise or detecting and eliminating outliers.
[0071] In some embodiments, as described above, a multi-feature-point combined averaging can be configured. For example, multiple feature points (such as R-peaks and T-peaks) can be used to combine the signal averages of different feature points to form a more stable baseline estimate.
[0072] In some embodiments, several (e.g., 2 or 3) consecutive first time windows can be slidably set for each corresponding feature point.
[0073] All of the above embodiments fall within the scope of this invention and can be protected under this invention or subsequent laws.
[0074] By obtaining the signal characteristic values, such as the average signal value, within the time window of each group of corresponding feature points in this step 220, the baseline drift amount can be determined.
[0075] Step 230: Determine the baseline drift between cardiac cycles of adjacent groups based on the difference in the average signal values of corresponding feature points in adjacent groups.
[0076] In this embodiment of the invention, step 230 involves determining the baseline drift between adjacent groups of cardiac cycles. Specifically, the signal characteristic values, such as the average signal value, within the first time window of the corresponding feature points of each group calculated in step 220 can be used to quantify the degree of baseline drift between adjacent groups of cardiac cycles by determining the difference between the signal characteristic values, such as the average signal value, corresponding to the corresponding feature points of adjacent groups. For example, the degree of baseline drift between corresponding feature points of adjacent groups, such as the degree of baseline drift between the R peaks of adjacent QRS waves.
[0077] In a basic implementation, the baseline drift can be determined by calculating the difference between the signal characteristic values, such as the signal average value, corresponding to the corresponding characteristic points in adjacent groups.
[0078] For example, taking the average signal value determined by the R peak values of two adjacent QRS waves as an example, the average signal value F of the preceding group in an adjacent group... iand the average signal F of the latter group i+1 The baseline drift can be expressed as: Δ=F i+1 -F i This difference Δ represents the baseline drift between adjacent cardiac cycles, reflecting the degree of baseline change from the earlier group to the later group within an adjacent group, or more specifically, from the corresponding characteristic value of the earlier group to the corresponding characteristic value of the later group. A positive Δ indicates an upward baseline drift; a negative Δ indicates a downward baseline drift; and a Δ close to zero indicates a relatively stable baseline.
[0079] In some embodiments, for each group comprising multiple cardiac cycles, the baseline drift can be calculated based on the average signal value synthesized within the group. For example, if the previous group contains cardiac cycles (C... i C i+1 The latter group contains (C) i+2 C i+3 Then, the average value of the combined signal of the two groups can be calculated separately (e.g., R). i and R i+1 The mean, R i+2 R i+3 The mean of the values is calculated, and then the difference between them is used as the baseline drift. In this embodiment of the invention, step 230 can also be applied to overlapping group embodiments where adjacent groups share a portion of the cardiac cycle. Since adjacent groups share a portion of the cardiac cycle, the calculation of the baseline drift is smoother.
[0080] In some embodiments, the determination of the baseline drift in step 230 can incorporate any suitable features described herein and can employ differences other than simple differences, such as, but not limited to, normalized differences and / or weighted differences. In some embodiments, normalized differences can be used, where the difference is normalized by dividing it by a reference value (such as signal amplitude) to reduce the impact of signal amplitude variations. In some embodiments, weighted differences can be used, where, when using multiple corresponding feature points, different weights can be assigned to the differences between different feature points to form a weighted composite baseline drift.
[0081] The baseline drift between adjacent cardiac cycles is quantified in step 230 for subsequent baseline correction.
[0082] Step 240: Based on the baseline drift and the temporal position relationship of each sampling point of the electrocardiogram data, correct the electrocardiogram data between adjacent cardiac cycles.
[0083] In this embodiment of the invention, step 240 can be used to implement baseline drift correction of electrocardiogram data between adjacent groups, such as baseline drift correction of electrocardiogram data between corresponding feature points of adjacent groups.
[0084] like Figure 4 As shown, in a further embodiment, the step of correcting the ECG data between adjacent cardiac cycles based on the baseline drift and the temporal position relationship of each sampling point of the ECG data, i.e., step 240 may include: Step 410: Determine the ratio of the time interval between each sampling point and the feature point to the total time interval between the corresponding feature points.
[0085] In this embodiment of the invention, step 410 can be used to determine the relative time position of each sampling point between corresponding feature points, more specifically, the ratio of the time interval between the sampling point and the feature point to the total time interval between the corresponding feature points.
[0086] In this embodiment of the invention, the reference feature point used to determine the time interval with respect to the sampling point can be any suitable feature point.
[0087] In some preferred embodiments, when correction is performed based on a single type of corresponding feature point for each cardiac cycle, such as based on the R peak value of adjacent QRS waves, the corresponding feature point in the previous group, such as Ri, can be selected, but the reverse is also possible.
[0088] For example, for adjacent feature points R i and R i+1 The relative time position of any sampling point n between these points can be expressed as: ratio(n) = (n - t i ) / (t i+1 -t i ) Among them, t i It is R i Time point, t i+1 It is R i+1 Time point, n=t i ,⋯t i+1 .
[0089] The embodiments of the present invention include a variety of alternative methods for determining relative time positions, covering situations where each group has multiple cardiac cycles and / or each cardiac cycle has multiple corresponding feature points.
[0090] In some embodiments, when using a single type of feature point (such as the R peak of a QRS wave), the relative time position is calculated directly based on adjacent feature points (R peaks), and the time interval between each sampling point and the feature point can be determined based on one of the feature points.
[0091] In some embodiments, when multiple types of feature points are used simultaneously (e.g., simultaneously identifying R-peak, P-peak, T-peak, etc.), feature points of the same or different types can be selected. For example, the dominant feature point (e.g., R-peak) can be selected. i and R i+1 Alternatively, reference feature points at the endpoints of the cardiac cycle can be selected for calculation. For example, when simultaneously identifying the R peak and T peak, the R peak of the first group can be chosen. i and the peak T of the later group i+1 Furthermore, the time interval between each sampling point and the feature point can be determined based on one of the feature points, preferably the earlier feature point.
[0092] In some embodiments, the above-described embodiments can also be combined with embodiments in which each adjacent group includes a cardiac cycle. In some embodiments, the boundary feature value of the adjacent group can be selected as a reference feature point for calculating the time interval, and the earlier reference feature point is selected to determine the time interval between each sampling point and the feature point. In other embodiments, the main feature point of the boundary cardiac cycle can also be selected (e.g., when simultaneously identifying R peak, P peak, T peak, etc., the adjacent group such as (C i C i+1 ), (C i+2 C i+3 The earliest cardiac cycle, such as C i peak R i And the final heartbeat cycle, such as C i+3 peak R i+3 The reference feature points are used as the reference feature points for calculating the time interval, and the earlier reference feature points are selected to determine the time interval between each sampling point and the feature points.
[0093] Step 420: Perform point-by-point correction on each sampling point using the determined dynamic correction amount.
[0094] In this embodiment of the invention, step 420 calculates the dynamic correction amount for each sampling point based on the proportional relationship determined in step 410 and the baseline drift amount determined in step 230. This step distributes the baseline drift amount according to the relative time position of the sampling points, ensuring that the correction amount changes smoothly with the position of the sampling points.
[0095] For example, for sampling point n, the correction amount can be expressed as: correction(n) = Δ × ratio(n) Where Δ is the baseline drift determined in step 230, and ratio(n) is the proportional relationship of the sampling point determined in step 410.
[0096] Step 430: Perform point-by-point correction on each sampling point using the determined dynamic correction amount.
[0097] In this embodiment of the invention, step 430 applies the dynamic correction amount calculated in step 420 to the original electrocardiogram signal to eliminate baseline drift. This step corrects each sampling point located between adjacent feature points through point-by-point processing to generate an electrocardiogram waveform that reduces or eliminates baseline drift.
[0098] In a specific embodiment of the present invention, for any sampling point n, its corrected signal value can be expressed as: m(n) = f(n) - correction(n) Right now: m(n) = f(n) - Δ(nt i ) / (t i+1 -t i ) Where f(n) is the original signal value, m(n) is the corrected signal value, Δ is the baseline drift, and t i and t i+1 These are the temporal positions of exemplary adjacent feature points, where n = t. i ,..., t i+1 .
[0099] This point-by-point correction method smoothly eliminates baseline drift in the original signal while preserving the original morphological characteristics of the electrocardiogram waveform. The correction process takes into account the gradual change of baseline drift over time, avoiding abrupt changes and discontinuities, and ensuring the smoothness and accuracy of the correction results.
[0100] Those skilled in the art will understand that, when combined with various alternative embodiments of steps 410 and 420 described above, the correction process of step 430 is adjusted accordingly to accommodate different reference feature point selections and dynamic correction amount calculation methods.
[0101] Those skilled in the art will also understand that step 240 above is used to eliminate baseline drift between adjacent cardiac cycles, and its sub-steps 410 to 430 are defined separately based on function, but in actual implementation they can be performed separately or in combination as needed.
[0102] Step 250: Sequentially move the selection position of adjacent groups to select adjacent groups, so that the later group in the previously selected adjacent group becomes the front group in the currently selected adjacent group, and repeat the above calculation, determination and correction steps until the baseline drift correction of the electrocardiogram data is completed.
[0103] In this embodiment of the invention, a continuous processing mechanism for the sequential movement of electrocardiogram (ECG) data can be implemented based on step 250. Those skilled in the art will understand that this allows baseline drift correction to be performed while ECG data is being continuously acquired, without waiting for all data to be acquired.
[0104] In one specific embodiment, for example when each group in an adjacent group contains only one cardiac cycle and each cardiac cycle identifies only a single corresponding feature point (such as the R peak), step 250 can be implemented as follows: according to step 210, R... i+1 Assign to R i , will F i+1 Assigned to F i , will t i Assigned to t i At the same time, set the value R of the next feature point. i+2 Assign to R i+1 To determine the next adjacent groups to be processed and their parameters, the process returns to steps 220 (calculate the signal average), 230 (determine the baseline drift), and 240 (correct the ECG data) to continue processing the next adjacent groups.
[0105] In different embodiments of the present invention, sequential movement can be applied to various grouping forms.
[0106] As described above, in the basic embodiment, when each group contains only one cardiac cycle and each cardiac cycle identifies only a single corresponding feature point (such as the R peak), the sequential movement is manifested as changing the next feature point into a new previous feature point, while acquiring a new next feature point.
[0107] In embodiments where each group comprises multiple cardiac cycles, the above approach can also be used, but the sequential movement manifests as an update of the entire group (multiple cardiac cycles). For example, the preceding group of the currently processed adjacent group is cardiac cycle C. i C i+1 (e.g., corresponding feature point R) i R i+1 The first group and the second group represent the cardiac cycle C. i+2 C i+3 (e.g., corresponding feature point R) i+2 R i+3 In the case of [condition], the previous group after the movement becomes the cardiac cycle C. i+2 C i+3 (e.g., corresponding feature point R) i+2 R i+3 The latter group becomes the newly acquired cardiac cycle C. i+4 C i+5 (e.g., corresponding feature point R) i+4 R i+5In embodiments where adjacent cardiac cycles partially overlap, the same approach can be used. For example, the preceding group of the currently processed adjacent group is cardiac cycle C. i C i+1 (e.g., corresponding feature point R) i R i+1 The first group and the second group represent the cardiac cycle C. i+1 C i+2 (e.g., corresponding feature point R) i+1 R i+2 In the case of [condition], the previous group after the movement becomes the cardiac cycle C. i+1 C i+2 (e.g., corresponding feature point R) i+1 R i+2 The latter group becomes the newly acquired cardiac cycle C. i+2 C i+3 (e.g., corresponding feature point R) i+2 R i+3 ).
[0108] The sequential movement mechanism of this invention can also be implemented in conjunction with the various extended schemes mentioned above. For example, in embodiments with multiple feature point combinations, the R-peak value and T-peak value can be used simultaneously as reference feature points for comparison; in the calculation of signal feature values, weighted averaging and other methods can be used to enhance stability; when determining dynamic correction values, appropriate reference feature points can be set as needed.
[0109] pass Figure 2 The sequential movement mechanism shown in the embodiment enables continuous real-time processing of electrocardiogram data, making it particularly suitable for mobile applications and other scenarios.
[0110] It should be understood that Figure 2 The features illustrated in the sequential moving comparison method, including techniques such as window mean calculation based on cardiac cycle feature points, baseline drift determination, and linear correction based on time position relationships, can be applied in a non-contradictory manner to other processing modes described above, as needed. In the segmented buffer correction mode, the same signal feature analysis and correction principles can be applied to each independent data segment, only the processing unit changes from continuously moving cardiac cycles to relatively independent data segments. Similarly, in all processing modes, the same feature point window mean comparison method can be used, but all cardiac cycles will be processed at once after all data is acquired, rather than being processed step by step.
[0111] In this embodiment of the invention, the electrocardiogram data after baseline drift correction can be plotted and displayed in real time, providing users with a stable and clear waveform view, and meeting the needs of real-time monitoring and display.
[0112] The preceding text has described in detail the implementation steps of the ECG baseline drift correction method based on sequential shift comparison. This method is based on identifying corresponding feature points in the cardiac cycle, and determines and corrects baseline drift by calculating the average signal value within the time window of the feature point. The following section will combine... Figure 5 and Figure 7 To further explain step 110, namely, identifying the corresponding feature points of multiple cardiac cycles in the electrocardiogram data.
[0113] In such Figure 5 In the illustrated embodiment, identifying corresponding feature points of multiple cardiac cycles in the electrocardiogram data, i.e., step 110 may include: Step 510: Set a second time window for the electrocardiogram data.
[0114] In this embodiment of the invention, step 510 involves setting an appropriate time window for the electrocardiogram data so that feature points can be identified subsequently.
[0115] like Figure 7 As shown, the second time window is a sliding window used for feature point recognition, for example... Figure 7 The T shown 2,j-1 T 2,j T 2,j+1 The window size for the second time window can be selected as needed, for example, based on the sampling rate and signal characteristics of the electrocardiogram.
[0116] Preferably, the second time window is a fixed window size, i.e., T 2,j-1 =T 2,j =T 2,j+1 Here, it can be represented by T2. The time interval of the second time window sliding to the j-th position can be represented as ((j-1)T2,jT2), where T2 is the size of the sliding time window, j=1,...,N. j .
[0117] Step 520: Move the second time window sequentially along the time direction and determine the maximum value of the electrocardiogram data within the sequentially moved second time window.
[0118] In this embodiment of the invention, step 520 provides a basis for determining feature candidate points by sliding a second time window and determining the maximum value of the signal at each window position.
[0119] Specifically, such as Figure 7As shown, for time points n = (j-1)T+1,⋯,jT, the maximum value of f(n) within each time window is calculated and denoted as Wj. Then, the time window is rolled to the next (jT,jT+T), and the maximum value of f(n) within each time window is calculated and denoted as Wj+1. This process is repeated to calculate the maximum value sequence {W1, W2,..., Wj,...} at each window position.
[0120] Step 530: Determine feature candidate points based on the changing trend of the maximum value within the second time window of adjacent locations.
[0121] In this embodiment of the invention, step 530 identifies candidate feature points in the electrocardiogram by analyzing the changing trend of the window maximum value sequence.
[0122] In this embodiment of the invention, step 530 can be based on peak detection using gradient methods (such as the first-order difference method) to obtain the (local) peak points of the signal curve.
[0123] In a further embodiment, determining the feature candidate points based on the changing trend of the maximum value within a second time window of adjacent locations, i.e., step 530 may include: Step 531A (not shown): Determine the difference between the maximum values within adjacent second time windows; Step 532A (not shown): Identify the transition point where the difference changes from a positive value to a negative value as the feature candidate point.
[0124] Specifically, the difference between the maximum values of two time windows is calculated, also known as the gradient or first-order difference of the time series: Δ=W j+1 -W j Then, if Δ is positive, it means W j+1 >W j W j+1 Assigning a value to F, if Δ is negative, it indicates W. j+1 <W j The point where the difference Δ changes from positive to negative is the peak point, and the value at the peak point F will be assigned. i , i=i+1, F=0, continue to find the next peak point.
[0125] By using this method, continue with step 520 and the above processing steps to find the next F. i until all F are found i For example, determining if i > N i (or a given value); if not, continue to step 530 to find the peak value F. i If so, it means that all peak values F of the entire waveform have been found. iProceed to step 540.
[0126] Step 540: Identify the corresponding feature points of the cardiac cycle among the feature candidate points by threshold filtering.
[0127] In this embodiment of the invention, step 540 filters out the true cardiac cycle corresponding feature points (such as the R peak of the QRS wave) from a large number of feature candidate points by setting an appropriate threshold.
[0128] In some embodiments, the threshold mentioned above is a preset threshold. In a further embodiment, the step 540, which involves selecting the corresponding feature point of the cardiac cycle from the candidate feature points through threshold filtering, may include: Step 541A (not shown): Determine the maximum value among all feature candidate points; Step 542A (not shown): Select a feature candidate point that is greater than the maximum value minus a given threshold as the corresponding feature point of the cardiac cycle.
[0129] In one specific embodiment, in all F i Find the maximum value F M Set a threshold Δ F , all F i >F M -Δ F , of F i Assign values to the array {R1,R2,...,R i ,...} represents all the QRS peak values.
[0130] The screening method based on preset thresholds in steps 541A and 542A can effectively distinguish the true QRS wave peak and other interference peaks, ensuring that the subsequent baseline drift correction step has a reliable reference point. The entire feature point identification process is simple and efficient in calculation.
[0131] It should be understood that the above-described feature point recognition method is preferably combined with all the correction modes described above. However, the above-described feature point recognition method can also be combined with other correction modes, which falls within the scope of this invention. For example, by setting a reasonable number of candidate points or an execution time of 530, several feature points (such as the R peak value) can be obtained, and then the following process can be executed: Figure 2 The sequential move processing mode shown or the segmented buffer processing mode described above. Alternatively, during the comparison process in steps 540A and 540B above, after a given number (e.g., two) is selected, other correction modes described above, such as the sequential move processing mode, are executed.
[0132] In another embodiment, a dynamic threshold recognition mechanism can be applied to identify the corresponding feature points (such as R peaks). In a further embodiment, selecting the corresponding feature points of the cardiac cycle from the candidate feature points through threshold filtering, i.e., step 540 may include: Step 541B (not shown): Set the initial dynamic threshold; Step 542B (not shown): Determine the initial corresponding feature point based on the comparison between the determined feature candidate point and the initial dynamic threshold; Step 543B (not shown): As the candidate feature points are continuously determined, the dynamic threshold is continuously updated based on the determined corresponding feature points, and the updated dynamic threshold is used to continue to identify the corresponding feature points of subsequent cardiac cycles.
[0133] Specifically, after identifying corresponding feature points of at least two adjacent cardiac cycles, the steps of determining the average signal value (i.e., step 120) and the baseline drift correction step (i.e., step 130) are executed in real time.
[0134] In this embodiment of the invention, the dynamic threshold recognition mechanism provides a flexible feature point recognition method, suitable for combination with the aforementioned sequential shift comparison processing mode (steps 210-250) to achieve more efficient real-time processing. In this combination, the feature point recognition process can continue, while baseline drift correction can also be performed in real time. This real-time processing capability is suitable for real-time monitoring and display of electrocardiograms in mobile apps. Furthermore, the dynamic threshold recognition mechanism can also be combined with other correction processing modes.
[0135] In some specific embodiments, the initial dynamic threshold can be set based on the initial statistical characteristics (prior data) of the electrocardiogram data, such as the prior R-peak value, and the first feature candidate point within a certain fluctuation range above and below the dynamic threshold is identified as the initial corresponding feature point. Furthermore, the dynamic threshold can be updated subsequently based on newly identified corresponding feature points, such as by replacement or averaging.
[0136] In another embodiment, a segmented buffer identification mechanism can be applied to identify the corresponding feature points (such as the R peak). In another embodiment, the electrocardiogram data is in the form of multiple consecutive buffered data segments, and the step of identifying the corresponding feature points (i.e., step 110) is performed for each buffered data segment.
[0137] Specifically, after identifying the corresponding feature points for the first buffered data segment, the steps of determining the average signal value and the baseline drift correction step are executed in real time.
[0138] In this embodiment of the invention, the segmented buffer recognition mechanism provides a relatively efficient method for feature point recognition. Here, each buffer segment acts as a relatively independent processing unit, and recognition processing can begin without waiting for all data to be acquired.
[0139] In this embodiment of the invention, the segmented buffer identification mechanism is suitable for combination with the aforementioned segmented buffer correction mode. Furthermore, the segmented buffer identification mechanism can also be combined with other correction processing modes.
[0140] This invention also provides an independently implementable method for detecting the R peak of an electrocardiogram. This method combines a sliding window and a gradient method, determines candidate peak points by analyzing the changing trend of the maximum signal value within adjacent windows, and then identifies the R peak of the QRS wave by threshold screening.
[0141] The technical solution of this electrocardiogram R peak detection method will be described in detail below with reference to the accompanying drawings.
[0142] Reference Figure 6 and Figure 7 In such Figure 6 In another embodiment shown, an electrocardiogram R-peak detection method is also provided, which may include: Step 610: Set a sliding time window for the electrocardiogram data; Step 620: Move the sliding time window sequentially along the time direction, and determine the maximum value of the electrocardiogram data within the sequentially moved sliding time window; Step 630: Determine the peak candidate point based on the changing trend of the maximum value within the sliding time window of adjacent positions; Step 640: Select the R peak of the QRS wave of the electrocardiogram from the candidate peak points by threshold screening.
[0143] In this embodiment of the invention, the R peak detection method is characterized by simple and efficient calculation and strong anti-noise interference capability, and can accurately identify the R peak in the electrocardiogram under various conditions.
[0144] This R-peak detection method can be used as a component of the baseline drift correction method mentioned above, or it can be applied independently to scenarios such as heart rate monitoring and heart rhythm analysis, including but not limited to numerous clinical and health monitoring applications such as heart rate monitoring, arrhythmia detection, and heart rate variability analysis.
[0145] Should Figure 6 The feature description for identifying the R peak in the illustrated embodiment can be found by referring to... Figure 5 Related descriptions of the embodiments. For example, such as Figure 6 The sliding time window used in the R-peak detection method shown can be referred to the aforementioned method. Figure 5The second time window in the feature point recognition method of the illustrated embodiment (reference) Figure 7 In practice, a sliding window mechanism similar to the second time window set in step 510 can be used for electrocardiogram data processing. Further details will not be elaborated here.
[0146] In a further embodiment, determining the peak candidate point based on the changing trend of the maximum value within a sliding time window of adjacent positions, i.e., step 630 may include: Step 631A (not shown): Calculate the difference between the maximum values within adjacent sliding time windows.
[0147] Step 632A (not shown): Identify the transition point where the difference changes from a positive value to a negative value as a peak candidate point.
[0148] In a further embodiment, the step of selecting the R peak of the QRS wave of the electrocardiogram from the peak candidate points through threshold screening, i.e., step 640, may include: Step 641A (not shown): Determine the maximum value among all peak candidate points; Step 642A (not shown): Select all peak candidate points that are greater than the maximum value minus the given threshold as the R peak value.
[0149] The R peak value is the determined target peak value.
[0150] In another embodiment, the step of selecting the R-peak value of the QRS wave of the electrocardiogram from the candidate peaks by threshold screening, i.e., step 640, may include: Step 641B (not shown): Set the initial dynamic threshold; Step 642B (not shown): Determine the initial R peak value, i.e., the initial target peak value, based on the initial dynamic threshold; Step 643B (not shown): As peak candidate points are continuously determined, the dynamic threshold is continuously updated based on the determined R peak values, and the updated dynamic threshold is used to continue identifying the R peak values of subsequent electrocardiograms.
[0151] In another embodiment, the electrocardiogram data is in the form of multiple consecutive buffered data segments, and the steps of the electrocardiogram R-peak detection method are performed for each buffered data segment.
[0152] The electrocardiogram R peak detection method of this invention has the characteristics of simple and efficient calculation and strong anti-noise interference ability.
[0153] Under the guidance of this invention, features or steps (sub-steps) of the method embodiments of this invention can be combined with other method embodiments in a non-contradictory manner to obtain new embodiments.
[0154] like Figure 8 As shown, this embodiment of the invention also provides an electrocardiogram correction device 800, which may include: The feature recognition unit 810 is configured to recognize corresponding feature points of multiple cardiac cycles in electrocardiogram data; The signal determination unit 820 is configured to determine the average signal value within a first time window of the corresponding feature points of the plurality of cardiac cycles; The baseline drift correction unit 830 is configured to determine the baseline drift between adjacent cardiac cycles based on the difference in the average signal value of the corresponding feature points within the first time window of adjacent cardiac cycles, and to perform baseline drift correction on the electrocardiogram data between the adjacent cardiac cycles.
[0155] like Figure 9 As shown, another embodiment of the present invention also provides an electrocardiogram R-peak detection device 900, comprising: The sliding time window setting unit 910 is configured to set a sliding time window for electrocardiogram data; The maximum value determination unit 920 is configured to move the sliding time window sequentially along the time direction and determine the maximum value of the electrocardiogram data within the sequentially moved sliding time window respectively; The candidate point determination unit 930 is configured to determine peak candidate points based on the changing trend of the maximum value within a sliding time window of adjacent positions; Peak determination unit 940 is configured to select the R peak of the QRS wave of the electrocardiogram from the candidate peak points by threshold filtering.
[0156] Under the guidance of this invention, features or steps (sub-steps) of the method embodiments of this invention can be combined with device embodiments in a non-contradictory manner to obtain new embodiments, and features or components (sub-components) of device embodiments can also be combined with method embodiments in a non-contradictory manner to obtain new embodiments, which falls within the scope of this invention.
[0157] In some embodiments of the present invention, an electronic device is provided, including a processor and a memory storing a computer program, the processor being configured to implement the method of any embodiment of the present invention when running the computer program.
[0158] Figure 10 A schematic diagram is shown of a method or electronic device 1000 that can be used to implement embodiments of the present invention. In some embodiments, the number of electronic devices may be more or less than the number shown. In some embodiments, it can be implemented using a single or multiple electronic devices. It can also be implemented using cloud or distributed electronic devices in some embodiments.
[0159] like Figure 10 As shown, the electronic device 1000 includes a processor 1001 and a memory 1002. The processor executes programs stored in the memory, which, when executed by a computer, can implement the methods, steps, or functions described in the above embodiments. The processor 1001 may include various types of processors, such as a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), a digital signal processor (DSP), etc. The processor 1001 and the memory 1002 are interconnected via a bus 903. Input / output (I / O) interfaces may also be connected to the bus 903. The systems, devices, modules, or units described in the above embodiments can be implemented by a computer or its associated components. The computer may be, for example, a mobile terminal, a smartphone, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a personal digital assistant, a media player, a navigation device, a game console, a tablet computer, a wearable device, a smart TV, an Internet of Things system, a smart home, an industrial computer, a server, or a combination thereof.
[0160] Although not shown, in this embodiment of the invention, a program product is provided, including a computer program that, when executed by a processor, implements the method of any embodiment of the invention.
[0161] Although not shown, in an embodiment of the invention, a storage medium is provided storing a computer program configured to be run to implement the method of any embodiment of the invention.
[0162] Storage media in embodiments of the present invention include articles that are permanent and non-permanent, removable and non-removable, capable of storing information by any method or technology. Examples of storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0163] The methods, programs, systems, apparatuses, etc., in embodiments of the present invention can be executed or implemented in one or more networked computers, or practiced in a distributed computing environment. In the embodiments of this specification, in these distributed computing environments, tasks can be performed by remote processing devices connected via a communication network.
[0164] Those skilled in the art will understand that the embodiments described in this specification can be provided as methods, systems, or computer program products. Therefore, those skilled in the art will realize that the functional modules / units or controllers and related method steps described in the above embodiments can be implemented in software, hardware, or a combination of both.
[0165] Unless explicitly stated otherwise, the actions or steps of the methods and procedures described in the embodiments of the present invention do not necessarily have to be performed in a specific order and can still achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0166] This document describes several embodiments of the present invention; however, for the sake of brevity, the descriptions of the embodiments are not exhaustive, and identical or similar features or parts between the embodiments may be omitted. In this document, "one embodiment," "some embodiments," "example," "specific example," or "some examples" refers to embodiments applicable to at least one, but not all, of the present invention. The above terms do not necessarily refer to the same embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described herein, as well as the features of the different embodiments or examples.
[0167] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are merely examples of the best mode for implementing the systems and methods. Those skilled in the art will understand that various changes can be made to the embodiments of the systems and methods described herein without departing from the spirit and scope of the invention as defined in the appended claims when implementing the systems and / or methods.
Claims
1. A method for correcting electrocardiograms, characterized in that, include: Identify corresponding feature points across multiple cardiac cycles in electrocardiogram (ECG) data; Determine the average signal value within the first time window corresponding to the feature points of the plurality of cardiac cycles; Based on the difference in the average signal value of the corresponding feature points in the first time window of adjacent cardiac cycles, the baseline drift between adjacent cardiac cycles is determined, and the electrocardiogram data between the adjacent cardiac cycles is corrected for baseline drift.
2. The electrocardiogram correction method according to claim 1, characterized in that, The steps of determining the signal average value and the baseline drift correction step are performed in a sequential shift comparison manner, including: Based on the corresponding feature points of the identified multiple cardiac cycles, select the corresponding feature points of adjacent groups of cardiac cycles, where each group has one or more cardiac cycles. Calculate the average signal value of each selected group of corresponding feature points within the first time window; The baseline drift between cardiac cycles of adjacent groups is determined based on the difference in the average signal values of corresponding feature points in adjacent groups. Based on the baseline drift and the temporal position relationship of each sampling point of the electrocardiogram data, the electrocardiogram data between adjacent cardiac cycles are corrected. The adjacent groups are sequentially moved to select adjacent groups, so that the later group in the previously selected adjacent group becomes the earlier group in the currently selected adjacent group. The above calculation, determination and correction steps are repeated until the baseline drift correction of the electrocardiogram data is completed.
3. The electrocardiogram correction method according to claim 2, characterized in that, The step of correcting ECG data between adjacent cardiac cycles based on the baseline drift and the temporal relationship of the ECG data includes: Determine the proportional relationship between the time interval between each sampling point and the feature point relative to the total time interval between the corresponding feature points; Based on the baseline drift and the proportional relationship, determine the dynamic correction amount corresponding to each sampling point; The determined dynamic correction amount is used to correct each sampling point individually.
4. The electrocardiogram correction method according to any one of claims 1 to 3, characterized in that, The corresponding feature point includes the R peak value of the QRS wave.
5. The electrocardiogram correction method according to any one of claims 1 to 3, characterized in that, The identification of corresponding feature points for multiple cardiac cycles in the electrocardiogram data includes: A second time window is set for the electrocardiogram data; The second time window is moved sequentially along the time direction to determine the maximum value of the electrocardiogram data within the sequentially moved second time window; Based on the changing trend of the maximum value within the second time window of adjacent locations, feature candidate points are determined; and The corresponding feature points of the cardiac cycle are identified from the candidate feature points by threshold screening.
6. The electrocardiogram correction method according to claim 5, characterized in that, The step of determining feature candidate points based on the changing trend of the maximum value within a second time window of adjacent positions includes: Determine the difference between the maximum values within adjacent second time windows; and The point where the difference changes from a positive value to a negative value is identified as the feature candidate point.
7. The electrocardiogram correction method according to claim 5, characterized in that, The step of selecting the corresponding feature point of the cardiac cycle from the candidate feature points through threshold filtering includes: Determine the maximum value among all feature candidate points; Feature candidate points greater than the maximum value minus a given threshold are selected as the corresponding feature points of the cardiac cycle.
8. The electrocardiogram correction method according to claim 5, characterized in that, The step of selecting the corresponding feature point of the cardiac cycle from the candidate feature points through threshold filtering includes: Set the initial dynamic threshold; The initial corresponding feature points are determined by comparing the determined candidate feature points with the initial dynamic threshold. As the candidate feature points are continuously determined, the dynamic threshold is continuously updated based on the determined corresponding feature points, and the updated dynamic threshold is used to continue to identify the corresponding feature points of subsequent cardiac cycles. Specifically, after identifying corresponding feature points of at least two adjacent cardiac cycles, the steps of determining the average signal value and the baseline drift correction step are performed in real time.
9. The electrocardiogram correction method according to claim 5, characterized in that, The electrocardiogram data is in the form of multiple consecutive buffered data segments. Perform the step of identifying the corresponding feature points for each buffered data segment; Specifically, after identifying the corresponding feature points for the first buffered data segment, the steps of determining the average signal value and the baseline drift correction step are executed in real time.
10. An electrocardiogram correction device, characterized in that, include: The recognition unit is configured to recognize corresponding feature points of multiple cardiac cycles in electrocardiogram data; The determining unit is configured to determine the average signal value within a first time window of the corresponding feature points of the plurality of cardiac cycles; The correction unit is configured to determine the baseline drift between adjacent cardiac cycles based on the difference in the average signal value of the corresponding feature points within the first time window of adjacent cardiac cycles, and to perform baseline drift correction on the electrocardiogram data between the adjacent cardiac cycles.
11. An electronic device, characterized in that, include: A processor and a memory storing a computer program, the processor being configured to implement the method of any one of claims 1-9 when executing the computer program.
12. A program product, characterized in that, Includes a computer program, wherein the computer program, when executed by a processor, implements the method as described in any one of claims 1-9.
