Positioning method and system for J point in electrocardiosignal and storage medium
By filtering the electrocardiogram signal and calculating the angle sequence through secondary filtering, combined with curvature calculation and polygon fitting, the dynamic programming algorithm selects the J point, which solves the problem of inaccurate J point positioning in the existing technology and achieves higher accuracy and noise adaptability.
Patent Information
- Application Number
- CN202511276495.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-12-12
AI Technical Summary
Existing technologies lack accuracy in locating the J point in electrocardiogram signals, especially under complex signal and noise interference conditions.
After filtering the original electrocardiogram signal and detecting the positions of the R and T peaks, a second filtering is performed to calculate the angle sequence. The threshold is dynamically adjusted to extract the position of the S peak. Based on curvature calculation and polygon fitting, the J point is selected using a dynamic programming algorithm.
It improves the accuracy of J-point localization, enhances the adaptability to complex ECG signals and noise interference, and provides reliable automatic analysis and diagnostic support.
Smart Images

Figure CN121101587A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic analysis and diagnosis of electrocardiogram (ECG) signals, and more particularly to a method, system, and storage medium for locating the J point in an ECG signal. Background Technology
[0002] In the field of automated analysis and diagnosis of electrocardiogram (ECG) signals, the J-point, as the end point of the QRS complex, is crucial for the accurate diagnosis of cardiac diseases such as myocardial ischemia and arrhythmias, and is a key step in achieving precise interpretation of ECG signals. Currently, there are several technical solutions for detecting the J-point. Among them, the wavelet transform method finds the modulus maxima at a specific scale after wavelet transformation, and then determines the J-point location based on the zero-crossing point; the low-pass differential method filters and differentially processes the signal, and locates the J-point by searching for extreme points and using a threshold; the Hilbert transform method combines Hilbert transform and filtering, and finds the intersection point after the QRS complex based on a threshold as the J-point. In addition, there are methods that locate the J-point by setting a threshold and calculating the slope abrupt change point.
[0003] However, the aforementioned existing technologies have technical limitations: for example, wavelet transform is computationally complex and has poor positioning results; low-pass differential method is difficult to accurately locate the differential peak corresponding to point J in abnormal situations such as J-wave, Delta wave, and severe noise interference; and Hilbert transform method has a large detection error and is easily affected by noise. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention discloses a method for locating point J in an electrocardiogram (ECG) signal, comprising: The target signal is obtained by filtering the original electrocardiogram signal, and the positions of the R peak and T peak in the target signal are detected. After performing secondary filtering on the target signal, the angle sequence is obtained by calculating the angle. Based on the R peak position, the S peak position is extracted from the angle sequence within a set time interval after the R peak using a dynamic threshold method. The signal interval to be analyzed is defined based on the peak points of the S-wave and T-wave. Within the signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. The J point is selected from the set of candidate vertex positions through distance filtering and dynamic programming.
[0005] Preferably, after performing secondary filtering on the target signal, the angle sequence is calculated. Using the R-peak position as a reference, the S-peak position is extracted from the angle sequence within a set time interval after the R-peak using a dynamic threshold method. Specifically, this includes: A bandpass filter is used to perform secondary filtering on the preprocessed target signal to obtain an ECG filtered signal. Based on the signal sampling rate and a dynamically adjustable amplitude difference ratio coefficient, the absolute value of the amplitude difference between two consecutive samples of the ECG filtered signal is calculated, and the absolute value is scaled and converted into an angle parameter. Based on the angle parameters, the detection threshold corresponding to each heartbeat is dynamically adapted, and an adaptation adjustment value sequence is obtained. The dynamic adaptation rule is to configure a higher threshold when the R peak appears and a lower threshold at other times. Calculate the absolute value of the difference between the sequence values of two consecutive points in the adaptation adjustment value sequence, scale the absolute value and convert it into an angle sequence, and extract all the peak points to be evaluated in the angle sequence. For each heartbeat's R-wave peak point, the peak points within a set time window after the extracted peak points to be evaluated are selected, and the peak point with the latest time ranking is selected as the search starting point for the S-wave peak point; based on the search starting point, the position with the smallest amplitude in the ECG filtered signal is found in the subsequent set time window, and this position is determined as the S-wave peak point position.
[0006] Preferably, the signal interval to be analyzed is defined based on the S-wave peak point and the T-wave peak point. Within the signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. Point J is then selected from the set of candidate vertex positions through distance filtering and dynamic programming. Specifically, this includes: Using the S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, a signal segment between the two boundaries in the ECG filtered signal is extracted; the curvature parameter of each sampling point in the signal segment is solved using the curvature calculation method, and the corresponding sampling points with curvature parameters greater than a preset threshold are selected as initial vertices; For any two adjacent initial vertices, the sequential polygon approximation algorithm is used to fit the signal segment between the two vertices; the endpoint of each fitted line segment during the fitting process is obtained and integrated with the initial vertices to form a candidate vertex set. Draw a straight line segment connecting the peak point of the S-wave to the midpoint between the peak point of the S-wave and the peak point of the T-wave. Calculate the distance from each vertex in the candidate vertex set to the straight line segment. Sort all distances in descending order and select the vertices with the highest distance values after sorting as candidate positions for point J. A dynamic programming algorithm was adopted, incorporating electrophysiological structural constraints. By constructing a multi-dimensional cost function, the candidate locations of each J point were evaluated, and the candidate location of the J point with the smallest cost function value was determined as the J point in the current electrocardiogram signal.
[0007] Preferably, a signal segment between the two boundaries is extracted from the ECG filtered signal, using the S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary. The curvature parameters of each sampling point in this signal segment are calculated using a curvature calculation method, and sampling points with curvature parameters greater than a preset threshold are selected as initial vertices. Specifically, this includes: Using the determined S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, a signal segment between the two boundaries in the ECG filtered signal is extracted; The three-point curvature approximation formula is used as the curvature calculation method to solve for the curvature parameter of each sampling point in the signal segment corresponding to each heartbeat. Sampling points with curvature parameters greater than a preset threshold are selected and used as the initial vertices of the corresponding signal segment. The preset threshold is determined by experimental verification to adapt to the curvature characteristics of the waveform around point J in the electrocardiogram signal.
[0008] Preferably, for any two adjacent initial vertices, a sequential polygon approximation algorithm is used to fit the signal segment between the two vertices; the endpoint of each fitted line segment during the fitting process is obtained and integrated with the initial vertices to form a candidate vertex set, specifically including: For any two adjacent initial vertices, a fitting process is performed, and a sequential polygon approximation algorithm is used to fit the signal segment between the two vertices: Starting from the current initial vertex, attempt to fit a straight line to the subsequent sampling points to the right, and calculate the fitting error for each fitting interval; If the fitting error meets the preset error allowable standard, continue to try fitting the next sampling point; if the fitting error exceeds the error allowable standard, backtrack to find the previous sampling point that meets the error allowable standard, take the interval from the current initial vertex to the backtracked sampling point as a fitting line segment and include it in the result set, and set the backtracked sampling point as the new fitting starting point. Repeat the above fitting process until the fitting of all signal segments is completed. Obtain the endpoint of each fitted line segment during the fitting process and integrate it with the initial vertex to form a candidate vertex set.
[0009] Preferably, a dynamic programming algorithm is used, incorporating electrocardiographic structural constraints. A multi-dimensional cost function is constructed to evaluate each candidate J-point location, and the candidate J-point with the minimum cost function value is determined as the J-point in the current electrocardiogram signal. Specifically, this includes: A dynamic programming algorithm, incorporating electrocardiographic structural constraints, is employed to evaluate candidate J-point locations by constructing a multi-dimensional cost function. The candidate J-point with the minimum cost function value is then determined as the J-point in the current electrocardiogram signal. The multi-dimensional cost function is as follows: ; The local curvature cost function ; Geometric location cost function ; Morphological cost function ; Where w1, w2, and w3 are preset weight parameters; Let J be the curvature parameter of the k-th candidate J point. Let J be the candidate position of the k-th point. The location of the S-wave peak. To preset the delay time, It is a vector consisting of the S-wave peak and the k-th candidate J point. It is the vector formed by the k-th candidate J point and the point Mst.
[0010] This invention also discloses a system for locating point J in an electrocardiogram signal, comprising: The basic waveform detection module is used to filter the original electrocardiogram signal to obtain the target signal, and to detect the R-peak position and T-peak position in the target signal. The S-peak extraction module is used to calculate the angle sequence after performing secondary filtering on the target signal. Based on the R-peak position, the S-peak position is extracted on the angle sequence within a set time interval after the R-peak using a dynamic threshold method. The J-point positioning module is used to define the signal interval to be analyzed based on the S-wave peak point and the T-wave peak point. Within the signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. The J-point is then selected from the set of candidate vertex positions through distance filtering and dynamic programming.
[0011] Preferably, the S-peak extraction module is further configured to perform secondary filtering on the preprocessed target signal using bandpass filtering to obtain an ECG filtered signal; based on the signal sampling rate and a dynamically adjustable amplitude difference ratio coefficient, calculate the absolute value of the amplitude difference between two consecutive sampled samples of the ECG filtered signal, and convert the absolute value into an angle parameter after scaling; according to the angle parameter, dynamically adapt the detection threshold corresponding to each heartbeat and obtain an adaptation adjustment value sequence, wherein the dynamic adaptation rule is to configure a higher threshold when the R-peak appears and a lower threshold at other times; Calculate the absolute value of the difference between the sequence values of two consecutive points in the adaptation adjustment value sequence, scale the absolute value and convert it into an angle sequence, and extract all peak points to be evaluated in the angle sequence; for the R wave peak point of each heartbeat, select the peak points located within a set time window after the extracted peak points to be evaluated, and select the peak point with the latest time sorting as the search starting point for the S wave peak; based on the search starting point, find the position with the smallest amplitude in the ECG filtered signal within the subsequent set time window, and determine the position of the S wave peak point.
[0012] The present invention also discloses a device for locating point J in an electrocardiogram signal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0013] The present invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.
[0014] This invention discloses a method, apparatus, and storage medium for locating point J in an electrocardiogram (ECG) signal. The method involves filtering the original ECG signal to obtain a target signal, detecting the positions of the R-peak and T-peak in the target signal, performing secondary filtering on the target signal to calculate an angle sequence, and then using the R-peak position as a reference, extracting the S-peak position within a set time interval after the R-peak in the angle sequence using a dynamic thresholding method. The signal interval to be analyzed is defined based on the S-wave peak point and the T-wave peak point. Within this signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. Point J is then selected from the candidate vertex position set through distance filtering and dynamic programming. This improves the accuracy of J-point location, enhances adaptability to complex ECG signals and noise interference, and provides reliable technical support for the automatic analysis and diagnosis of ECG signals.
[0015] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the electrocardiogram (ECG) waveform and the location of the J point, which is a method for locating the J point in an ECG signal according to an embodiment of the present invention.
[0017] Figure 2 This is a schematic diagram illustrating the specific process of a method for locating point J in an electrocardiogram signal according to an embodiment of the present invention.
[0018] Figure 3 This is a flowchart illustrating the S-peak detection method for locating the J point in an electrocardiogram signal, as disclosed in an embodiment of the present invention.
[0019] Figure 4 This is a flowchart of the method for locating the J point in an electrocardiogram signal, as disclosed in an embodiment of the present invention.
[0020] Figure 5 This is a flowchart illustrating the method for locating the J point in an electrocardiogram signal according to an embodiment of the present invention.
[0021] Figure 6 This is a schematic diagram of the structure of the J-point positioning system in an electrocardiogram signal disclosed in an embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0023] Unless otherwise defined, the technical or scientific terms used herein should be understood in their ordinary sense by one of ordinary skill in the art to which this invention pertains. The terms “first,” “second,” and similar terms as used in this embodiment do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a,” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one.
[0024] In electrocardiogram signals, as shown in the attached image. Figure 1 As shown, point J, as the end point of the QRS wave, is the turning point where the QRS terminal of ventricular depolarization suddenly transforms into the ST segment. It marks the end of ventricular depolarization and the beginning of ventricular repolarization.
[0025] In this embodiment, as shown in the appendix Figure 2 As shown in the figure, this embodiment discloses a method for locating point J in an electrocardiogram signal, which may specifically include the following steps: Step S1: After filtering the original electrocardiogram signal, the target signal is obtained, and the positions of the R peak and T peak in the target signal are detected.
[0026] Specifically, the original signal is preprocessed by first using median filtering to remove baseline drift, and then using a 0.67-40Hz bandpass filter to remove interference from power frequency, electromyography, etc. This reduces high-frequency components while preserving the positional information of ECG signal feature points, resulting in the filtered signal ecgF. The Pantompkin algorithm is then used to detect the R-peak position Rpeak[i], i=1,2,…,N. The search range for the T-wave peak point is determined based on the interval between two adjacent R-peaks. :
[0027] Where RR[i] = Rpeak[i+1] − Rpeak[i], RR[i] is the i-th RR interval, Rpeak[i] is the position of the R peak, and α and β are preset coefficients. In this embodiment, α can be 0.2 and β can be 0.5.
[0028] Find the range by searching. The position of the maximum absolute value of the internal signal amplitude is taken as the peak position of the T wave, Tpeak[i], i=1,2,…,N.
[0029] Filtering the raw ECG signal effectively eliminates interference from baseline drift, power frequency, and electromyography (EMG). While reducing unnecessary high-frequency components, it fully preserves the positional information of characteristic points in the ECG signal, laying a reliable foundation for accurate detection of relevant waveform peaks. Detecting the R-peaks in the processed signal can determine key reference points in the ECG signal, providing a benchmark for locating other waveforms. Furthermore, defining the search range for T-wave peaks based on the intervals between adjacent R-peaks and determining the T-wave peak position within this range allows for precise identification of T-wave characteristic points, further refining the positional information of important waveforms in the ECG signal. This provides necessary coordinate references for subsequently defining the J-point analysis interval and achieving accurate J-point location.
[0030] Step S2: After performing secondary filtering on the target signal, calculate the angle to obtain the angle sequence. Based on the R peak position, extract the S peak position within a set time interval after the R peak in the angle sequence using a dynamic threshold method.
[0031] Specifically, to detect the S-peak, the preprocessed ECG signal is subjected to secondary filtering. The angle of the filtered ECG signal is calculated, and using the detected R-peak position as a reference, a peak-finding operation is performed on the time range following the R-peak within the obtained angle sequence. The S-wave peak position Speak[i], i=1,2,…,N, is extracted using a dynamic thresholding method. (See attached diagram) Figure 3 Step S2 can specifically include the following:
[0032] Step S21: Apply a bandpass filter to the preprocessed target signal for secondary filtering to obtain the ECG filtered signal; Specifically, an M-order bandpass finite impulse response (FIR) filter is used to perform secondary bandpass filtering on the preprocessed ECG signal ecgF. The cutoff frequency can be selected from 0.67-25Hz to further eliminate high-frequency noise without affecting the morphology of the QRS complex, resulting in the filtered ECG signal ecgF1.
[0033] Step S22: Based on the signal sampling rate and the dynamically adjustable amplitude difference ratio coefficient, calculate the absolute value of the amplitude difference between two consecutive sampled samples of the ECG filtered signal, and convert the absolute value into an angle parameter after scaling. Specifically, the angle y(n) scaled to the absolute value of the amplitude difference between two consecutive samples of the filtered ECG signal ecgF1 is calculated in degrees. The calculation method is as follows:
[0034] Where fs represents the sampling rate of the signal, and c is the scaling factor of the amplitude difference. The initial value can be 512. When abRatio < 58 within 1.5s, c = 1024, and then it changes back to 512.
[0035] By performing a second bandpass filter on the preprocessed target signal, high-frequency noise interference can be further eliminated, while avoiding changes to the morphological characteristics of the QRS group, thus laying a purer signal foundation for the subsequent accurate extraction of the S-peak.
[0036] Based on the signal sampling rate and a dynamically adjustable amplitude difference ratio coefficient, the amplitude difference between consecutively sampled ECG filtered signals is processed and converted into an angle parameter. This transforms the signal variation amplitude into an angle form that is easier to analyze. Furthermore, by dynamically adjusting the ratio coefficient, it can better adapt to the characteristic differences of different signal segments, enhance the sensitivity to signal changes, and thus more accurately capture the feature information related to the S-peak, providing a reliable basis for subsequent extraction of the S-peak position through dynamic thresholding.
[0037] Step S23: Based on the angle parameters, dynamically adapt the detection threshold corresponding to each heartbeat and obtain an adaptation adjustment value sequence. The dynamic adaptation rule is to configure a higher threshold when the R peak appears and a lower threshold at other times. In this embodiment, since the amplitude and width of the QRS wave vary due to individual differences and measurement environments, the threshold w(n) for each heartbeat needs to be dynamically adjusted. This allows for setting a higher threshold when the R-peak occurs and a lower threshold at other times. The initial setting value, upper limit, and decay rate of this threshold are controlled by a constant determined through experimentation. When dynamically adapting the detection threshold for each heartbeat, the calculated angle parameters are used as the basis. This constant, determined experimentally, controls the upper limit of the threshold and the decay rate. The higher the value of the constant, the smaller the detection threshold and the faster its decay rate over time.
[0038] Therefore, the method of dynamically adjusting the threshold using the angle sequence y(n) is as follows:
[0039] Here, k1 and k2 are constants that can be determined in advance through experiments. The initial value of w(n) is 0 degrees, and the upper limit and the rate of decrease of w(n) are determined by k1 and k2. The higher the values of k1 and k2, the smaller w(n) is and the faster the rate of decrease.
[0040] The detection threshold for each heartbeat is dynamically adapted based on angle parameters, following the rule of setting a higher threshold when the R-peak appears and a lower threshold at other times. This allows for flexible handling of amplitude and width variations in the QRS wave caused by individual differences and varying measurement environments. Experimentally determined constants are used to control the initial value, upper limit, and decay rate of the threshold, making the threshold adjustment more closely match the actual signal characteristics. The value of the constant affects the threshold size and decay rate, further optimizing the dynamic change rhythm of the threshold. This ensures effective filtering of irrelevant interference at key locations such as the R-peak, while sensitively capturing signal changes at other times, thus providing a more accurate judgment standard for subsequent identification of feature points related to the S-peak.
[0041] Step S24: Calculate the absolute value of the difference between the sequence values of two consecutive points in the adaptation adjustment value sequence, scale the absolute value and convert it into an angle sequence, and extract all the peak points to be evaluated in the angle sequence. After calculating the absolute value of the difference between two consecutive points in the sequence, the absolute value is scaled using a scaling factor adapted to the sequence, and then the scaled result is converted into an angle sequence; all peak points in the angle sequence are extracted using a peak recognition algorithm.
[0042] Specifically, the threshold can be dynamically adjusted using the angle sequence y(n), where each corresponding cttmp value forms a sequence ct(n). The absolute value of the difference between the sequence values between two consecutive points in the ct(n) sequence is scaled to the angle tanR(n), and all peak points peakLocs of tanR(n) are found.
[0043]
[0044] Where c1 is the scaling factor for the difference between two adjacent points in the ct(n) sequence.
[0045] The difference between two consecutive points in the adaptation adjustment value sequence is processed and converted into an angle sequence tanR(n). This allows the trend of the sequence to be presented intuitively in the form of angles, highlighting the abrupt change characteristics of the signal and providing a clear analytical object for subsequent peak point identification.
[0046] Simultaneously, scaling is performed using a scaling factor adapted to the sequence, which makes the variation amplitude of the angle sequence more closely match the actual signal characteristics and enhances the comparability between different signal segments.
[0047] Step S25: For the R-wave peak point of each heartbeat, select the peak points located within a set time window after the extracted peak points to be evaluated, and select the peak point with the latest time sorting as the search starting point for the S-wave peak point; based on the search starting point, find the position with the smallest amplitude in the ECG filtered signal within the subsequent set time window, and determine the position of the S-wave peak point.
[0048] Specifically, after extracting all peak points of the angle sequence, for the R-peak position of each heartbeat, the peak points within the first specific time window after the extracted peak points are selected, and the point that is last in time among these peak points is selected as the search starting point for the S-wave peak. Then, based on this search starting point, in the second specific time window thereafter, the position with the smallest amplitude in the ECG signal after secondary filtering is found, and the position with the smallest amplitude is determined as the S-wave peak position of the corresponding heartbeat. The same S-wave peak position determination operation is performed for each heartbeat.
[0049] In this embodiment, for the i-th heartbeat Rpeak[i], find all points localRpeaks_af within the time range T1 seconds after Rpeak[i] in peakLocs. Take the last point in localRpeaks_af as the starting point S_st for searching the S-wave peak value, and find the point with the minimum amplitude of signal ecgF1 within the time range T2 seconds after it as the S-wave peak position Speak[i].
[0050] For the R-wave peak point of each heartbeat, peak points within a predetermined time window are selected from the extracted peak points to be evaluated. The point with the latest time ranking is chosen as the starting point for searching the S-wave peak. This accurately narrows the search range for the S-wave peak, ensuring the correlation between the search starting point and the S-wave and reducing interference from irrelevant signals. Using this starting point as a reference, the position with the smallest amplitude in the ECG filtered signal within the subsequent predetermined time window is selected as the S-wave peak point. This fully utilizes the waveform characteristic of the smallest S-wave amplitude for accurate positioning. Performing the same operation for each heartbeat ensures the consistency of the S-wave peak detection standard for different heartbeats, effectively improving the accuracy of S-wave peak positioning and providing reliable reference coordinates for subsequent delineation of the J-point analysis interval.
[0051] Step S3: Delineate the signal interval to be analyzed based on the peak points of the S-wave and T-wave. Extract a set of candidate vertex positions within the signal interval based on curvature calculation and polygon fitting. Select point J from the set of candidate vertex positions through distance filtering and dynamic programming.
[0052] As attached Figure 4 and 5 Step S3 may specifically include the following:
[0053] Step S31: Using the S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, extract the signal segment between the two boundaries in the ECG filtered signal; use the curvature calculation method to solve the curvature parameters of each sampling point in the signal segment, and select the corresponding sampling points with curvature parameters greater than a preset threshold as initial vertices.
[0054] Step S31 specifically includes: Using the determined S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, a signal segment between the two boundaries in the ECG filtered signal is extracted.
[0055] The three-point curvature approximation formula is used as the curvature calculation method to solve for the curvature parameter of each sampling point in the signal segment corresponding to each heartbeat. Sampling points with curvature parameters greater than a preset threshold are selected and used as the initial vertices of the corresponding signal segment. The preset threshold is determined by experimental verification to adapt to the curvature characteristics of the waveform around point J in the electrocardiogram signal.
[0056] Specifically, using the determined S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, a signal segment between the two boundaries in the secondary filtered ECG signal is extracted. The three-point curvature approximation formula is used as the curvature calculation method to solve the curvature parameter of each sampling point in the signal segment. Sampling points with curvature parameters greater than a preset threshold are selected and used as initial vertices. The preset threshold is determined through experimental verification to adapt to the curvature characteristics of the waveform around point J in the ECG signal. The same initial vertex selection operation is performed on the signal segment corresponding to each heartbeat.
[0057] In one specific embodiment, taking the S-wave peak point as the starting point and the midpoint Mst between the S-wave peak point and the T-wave peak point as the ending point, a signal segment between the S-wave peak point and Mst in the signal ecgF1 is extracted. The curvature of each point in the signal segment is calculated using the three-point curvature approximation formula. Preserve curvature greater than a set threshold The point is used as the initial vertex. Among them, curvature The calculation formula is as follows: ; By segmenting the signal into segments with the S-wave peak and the midpoint between the S-wave and T-wave peaks as boundaries, the potential waveform range for point J can be precisely located, eliminating irrelevant signal interference and allowing subsequent analysis to focus on the key waveform components related to point J. The curvature parameters of each sampling point in the signal segment are calculated using the three-point curvature approximation method, and points with curvature greater than a preset threshold are selected as initial vertices. This preset threshold, verified experimentally, adapts to the curvature characteristics of the waveform surrounding point J and effectively captures points with significant curvature changes—points often closely related to the morphological features of point J. Performing the same operation for each heartbeat ensures consistency in the initial vertex selection criteria, providing a reliable feature point basis for further extraction of candidate locations for point J.
[0058] Step S32: For any two adjacent initial vertices, use the sequential polygon approximation algorithm to fit the signal segment between the two vertices; obtain the endpoint of each fitted line segment during the fitting process and integrate it with the initial vertices to form a candidate vertex set.
[0059] Step S32 may include the following: Step S321: Fit any two adjacent initial vertices by using a sequential polygon approximation algorithm to fit the signal segment between the two vertices.
[0060] Step S322: Starting from the current initial vertex, attempt to fit the line to the subsequent sampling points to the right, and calculate the fitting error for each fitting interval.
[0061] Step S323: If the fitting error meets the preset error allowable standard, continue to try fitting the next sampling point; if the fitting error exceeds the error allowable standard, backtrack to find the previous sampling point that meets the error allowable standard, take the interval from the current initial vertex to the backtracked sampling point as a fitting line segment and include it in the result set, and set the backtracked sampling point as the new fitting starting point. Repeat the above fitting process until the fitting of all signal segments is completed.
[0062] Step S324: Obtain the endpoint of each fitted line segment during the fitting process and integrate it with the initial vertex to form a candidate vertex set.
[0063] Specifically, every two vertices and Between these two vertices, the signal is fitted using the sequential polygon approximation method. Starting from the current starting point... Try to fit a straight line to the right. For each (ii, jj), fit a straight line, connect points ii and jj, and calculate the fitting error (e.g., maximum residual). If the error ≤ ε, continue trying the next jj; otherwise, find the previous jj* that satisfies the condition and add that segment [ii, jj*] as a line segment to the result. Let ii = jj*, and continue approximating subsequent segments. The starting point of each segment is a vertex, and the ending point of the last segment forms a supplementary vertex set. The initial vertices and the supplementary vertices form a new set of vertices. .
[0064] By employing a sequential polygon approximation algorithm to fit signal segments between adjacent initial vertices, and by attempting line fitting point by point and adjusting the fitting interval based on the fitting error, key morphological features of the signal can be preserved while reducing redundant sampling points. When the fitting error is within acceptable limits, the fitting interval is expanded; otherwise, a suitable termination point is determined through backtracking. This ensures fitting accuracy while avoiding computational redundancy caused by excessive subdivision. Integrating the endpoints obtained during the fitting process with the initial vertices into a candidate vertex set fills in waveform feature points not covered by the initial vertices, fully capturing the morphological details of the signal segments. This approach preserves key vertices with significant curvature and supplements them with additional vertices reflecting waveform trend transitions through polygon fitting, providing a more comprehensive candidate point base for subsequent selection of the J-point.
[0065] Step S33: Draw a straight line segment connecting the peak point of the S-wave to the midpoint between the peak point of the S-wave and the peak point of the T-wave; calculate the straight line distance from each vertex in the candidate vertex set to the straight line segment; sort all the straight line distances in descending order, and select several vertices with the highest distance values after sorting as candidate positions for point J. When determining the candidate location of point J, first draw a straight line segment connecting the peak point of the S-wave with the midpoint of the peak point of the S-wave and the peak point of the T-wave. Use the point-to-line distance formula to calculate the distance from each vertex in the complete vertex set to the straight line segment. After sorting all distances in descending order, select the K vertices with the highest distance values after sorting as the candidate locations of point J.
[0066] Specifically, draw a line segment L(n) from peak S to point Mst, and calculate the vertex set. The distance d(n) from each vertex to line segment L(n) is calculated. The distance sequence d(n) is sorted in descending order by d_sort(n), and the points corresponding to the first K distance values are used as candidate positions Jcandidates for point J.
[0067] Step S34: Using a dynamic programming algorithm and incorporating electrocardiographic physiological constraints, a multi-dimensional cost function is constructed to evaluate each candidate J point location. The candidate J point location with the smallest cost function value is determined as the J point in the current electrocardiogram signal.
[0068] When using dynamic programming to select the final J point, the incorporated electrocardiographic and physiological structural constraints are implemented by defining three types of cost terms: the local curvature cost term is based on the curvature of the candidate point, assigning a smaller cost to the candidate point with a larger curvature value to select candidate positions that meet the physiological attributes of the J point; the geometric position cost term applies an increasing cost penalty to candidate points that deviate from the S-wave peak point within a preset physiological time range; and the morphological cost term is calculated based on the angle between the QRS complex and the candidate point, and between the candidate point and the ST segment. The smaller the angle, the lower the cost value. The calculation of all three types of cost terms is based on the characteristic parameters of the electrocardiogram signal after secondary filtering.
[0069] A final cost function is constructed by weighting and summing the local curvature cost term, geometric position cost term, and morphological cost term using weighting coefficients. The weighting coefficients are used to adjust the degree of influence of each cost term on the final screening result. The final cost function value corresponding to all candidate J-point positions is calculated, and the candidate position with the smallest cost function value is selected and determined as the J-point in the electrocardiogram signal.
[0070] The final cost function uses three independent weighting coefficients to sum the local curvature cost term, geometric position cost term, and morphological cost term. The weighting coefficient of the local curvature cost term is greater than that of the geometric position cost term and the morphological cost term, so as to prioritize the accuracy of the curvature feature at point J.
[0071] In this embodiment, step S34 may include the following:
[0072] A dynamic programming algorithm, incorporating electrocardiographic structural constraints, is employed to evaluate candidate J-point locations by constructing a multi-dimensional cost function. The candidate J-point with the minimum cost function value is then determined as the J-point in the current electrocardiogram signal. The multi-dimensional cost function is as follows: ; The local curvature cost function ; Geometric location cost function ; Morphological cost function ; Where w1, w2, and w3 are preset weight parameters; Let J be the curvature parameter of the k-th candidate J point. Let J be the candidate position of the k-th point. The location of the S-wave peak. To preset the delay time, It is a vector consisting of the S-wave peak and the k-th candidate J point. It is the vector formed by the k-th candidate J point and the point Mst.
[0073] Specifically, dynamic programming (DP) is used with physiological structure constraints to select point J from the candidate points Jcandidate. The cost function dp[k] of DP is defined using curvature, position, and angle features, as follows: Cost function 1, i.e., the local curvature cost function, is: .
[0074] in, The curvature parameter of the k-th candidate J point is used to select the point with the largest curvature, so a negative sign is added to minimize its cost.
[0075] Cost function 2, i.e., the geometric location cost function, is: ; in, Let J be the candidate position of the k-th point. The location of the S-wave peak. To predetermine the delay time, point J typically appears tens of milliseconds after the S wave. This penalty is imposed on points that deviate too far from the expected time (e.g., 20-40 milliseconds).
[0076] Cost function 3, also known as the morphological cost function, is calculated as follows: Calculate the angle between the two line segments (QRS-k segment and k-ST segment) before and after the k-th candidate J point. The smaller the angle (the sharper the turn), the lower the cost.
[0077]
[0078]
[0079]
[0080] in It is a vector consisting of the S-wave peak and the k-th candidate J point. It is a vector consisting of the k-th candidate J point and the point Mst. Final cost function:
[0081]
[0082] Where w1, w2, and w3 are weight parameters.
[0083] The position of point J is found by finding the candidate point corresponding to min(dp[k]) in the candidate point Jcandidate.
[0084] This step employs a dynamic programming algorithm incorporating electrocardiographic physiological constraints. By constructing a multi-dimensional cost function to evaluate candidate locations of point J, it comprehensively considers the key features of point J and achieves precise localization. Specifically, the local curvature cost term prioritizes candidate points whose curvature matches the physiological attributes of point J, ensuring the accuracy of their morphological characteristics; the geometric position cost term penalizes candidate points that deviate from the reasonable physiological time range after the S wave, ensuring the rationality of point J in the time dimension; and the morphological cost term selects locations that conform to the waveform transition characteristics based on the angle features of the line segments before and after the candidate point, fitting the physiological morphology of point J as a waveform transition point.
[0085] The final cost function is formed by weighting and summing the three types of cost terms using weighted coefficients, with emphasis on the weight of the local curvature cost term. This approach balances the influence of various features while prioritizing the accuracy of the core features of point J. Selecting the candidate position with the smallest cost function value as point J effectively integrates multi-dimensional information, reduces the bias of single feature judgment, and significantly improves the accuracy and reliability of point J localization. Especially when dealing with complex waveforms or noise interference, it can still stably identify the position of point J that conforms to physiological characteristics.
[0086] This embodiment discloses a method for locating point J in an electrocardiogram (ECG) signal. The method involves filtering the original ECG signal to obtain a target signal, detecting the positions of the R-peak and T-peak in the target signal, performing secondary filtering on the target signal to calculate an angle sequence, and then using the R-peak position as a reference, extracting the S-peak position within a set time interval after the R-peak in the angle sequence using a dynamic thresholding method. The signal interval to be analyzed is defined based on the S-wave peak point and the T-wave peak point. Within this signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. Point J is then selected from this set of candidate vertex positions through distance filtering and dynamic programming. This method improves the accuracy of J-point location, enhances adaptability to complex ECG signals and noise interference, and provides reliable technical support for the automatic analysis and diagnosis of ECG signals.
[0087] In another embodiment, as shown in the appendix Figure 6 As shown, a system for locating the J-point in an electrocardiogram (ECG) signal is also disclosed, including a basic waveform detection module 1, an S-peak extraction module 2, and a J-point location module 3. The basic waveform detection module 1 is used to filter the original ECG signal to obtain a target signal, and detect the R-peak and T-peak positions in the target signal. The S-peak extraction module 2 is used to perform secondary filtering on the target signal to calculate angles and obtain an angle sequence. Using the R-peak position as a reference, the S-peak position is extracted within a set time interval after the R-peak using a dynamic threshold method. The J-point location module 3 is used to delineate the signal interval to be analyzed based on the S-wave peak point and the T-wave peak point. Within the signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. The J-point is then selected from the set of candidate vertex positions through distance filtering and dynamic programming.
[0088] In this embodiment, the S-peak extraction module 2 is further configured to perform secondary filtering on the preprocessed target signal using bandpass filtering to obtain an ECG filtered signal; based on the signal sampling rate and a dynamically adjustable amplitude difference ratio coefficient, the absolute value of the amplitude difference between two consecutive sampled samples of the ECG filtered signal is calculated, and the absolute value is scaled and converted into an angle parameter; according to the angle parameter, the detection threshold corresponding to each heartbeat is dynamically adapted, and an adaptation adjustment value sequence is obtained. The dynamic adaptation rule is to configure a higher threshold when the R-peak appears and a lower threshold at other times. Calculate the absolute value of the difference between the sequence values of two consecutive points in the adaptation adjustment value sequence, scale the absolute value and convert it into an angle sequence, and extract all peak points to be evaluated in the angle sequence; for the R wave peak point of each heartbeat, select the peak points located within a set time window after the extracted peak points to be evaluated, and select the peak point with the latest time sorting as the search starting point for the S wave peak; based on the search starting point, find the position with the smallest amplitude in the ECG filtered signal within the subsequent set time window, and determine the position of the S wave peak point.
[0089] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Regarding the J-point localization system in the electrocardiogram signal disclosed in the embodiments, since it corresponds to the J-point localization method in the electrocardiogram signal disclosed in the embodiments, the description is relatively simple, and relevant parts can be referred to the method section.
[0090] In other embodiments, a device for locating point J in an electrocardiogram (ECG) signal is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the method for locating point J in an ECG signal as described in the above embodiments.
[0091] If the positioning system for point J in the aforementioned electrocardiogram (ECG) signal is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the positioning method embodiments for point J in the aforementioned ECG signals. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
[0093] In summary, the above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention should be covered by the present invention.
Claims
1. A method for locating point J in an electrocardiogram (ECG) signal, characterized in that, The steps include the following: The target signal is obtained by filtering the original electrocardiogram signal, and the positions of the R peak and T peak in the target signal are detected. After performing secondary filtering on the target signal, the angle sequence is obtained by calculating the angle. Based on the R peak position, the S peak position is extracted from the angle sequence within a set time interval after the R peak using a dynamic threshold method. The signal interval to be analyzed is defined based on the peak points of the S-wave and T-wave. Within the signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. The J point is selected from the set of candidate vertex positions through distance filtering and dynamic programming.
2. The method for locating point J in an electrocardiogram signal according to claim 1, characterized in that, After performing secondary filtering on the target signal, the angle sequence is obtained by calculating the angle. Using the R-peak position as a reference, the S-peak position is extracted from the angle sequence within a set time interval after the R-peak using a dynamic threshold method. Specifically, this includes: A bandpass filter is used to perform secondary filtering on the preprocessed target signal to obtain the ECG filtered signal. Based on the signal sampling rate and the dynamically adjustable amplitude difference ratio coefficient, the absolute value of the amplitude difference between two consecutive samples of the ECG filtered signal is calculated, and the absolute value is converted into an angle parameter after scaling. Based on the angle parameters, the detection threshold corresponding to each heartbeat is dynamically adapted, and an adaptation adjustment value sequence is obtained. The dynamic adaptation rule is to configure a higher threshold when the R peak appears and a lower threshold at other times. Calculate the absolute value of the difference between the sequence values of two consecutive points in the adaptation adjustment value sequence, scale the absolute value and convert it into an angle sequence, and extract all the peak points to be evaluated in the angle sequence. For each heartbeat's R-wave peak point, the peak points within a set time window after the extracted peak points to be evaluated are selected, and the peak point with the latest time ranking is selected as the search starting point for the S-wave peak point; based on the search starting point, the position with the smallest amplitude in the ECG filtered signal is found in the subsequent set time window, and this position is determined as the S-wave peak point position.
3. The method for locating point J in an electrocardiogram signal according to claim 2, characterized in that, The signal interval to be analyzed is defined based on the S-wave peak point and the T-wave peak point. Within the signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. Point J is selected from the set of candidate vertex positions through distance filtering and dynamic programming, specifically including: Using the S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, a signal segment between the two boundaries in the ECG filtered signal is extracted; the curvature parameter of each sampling point in the signal segment is solved using the curvature calculation method, and the corresponding sampling points with curvature parameters greater than a preset threshold are selected as initial vertices; For any two adjacent initial vertices, the sequential polygon approximation algorithm is used to fit the signal segment between the two vertices; the endpoint of each fitted line segment during the fitting process is obtained and integrated with the initial vertices to form a candidate vertex set. Draw a straight line segment connecting the peak point of the S-wave to the midpoint between the peak point of the S-wave and the peak point of the T-wave. Calculate the distance from each vertex in the candidate vertex set to the straight line segment. Sort all distances in descending order and select the vertices with the highest distance values after sorting as candidate positions for point J. A dynamic programming algorithm was adopted, incorporating electrophysiological structural constraints. By constructing a multi-dimensional cost function, the candidate locations of each J point were evaluated, and the candidate location of the J point with the smallest cost function value was determined as the J point in the current electrocardiogram signal.
4. The method for locating point J in an electrocardiogram signal according to claim 3, characterized in that, Using the S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, a signal segment between the two boundaries is extracted from the ECG filtered signal. The curvature parameters of each sampling point in this signal segment are calculated using a curvature calculation method, and sampling points with curvature parameters greater than a preset threshold are selected as initial vertices. Specifically, this includes: Using the determined S-wave peak point as the starting boundary and the midpoint between the S-wave peak point and the T-wave peak point as the ending boundary, a signal segment between the two boundaries in the ECG filtered signal is extracted; The three-point curvature approximation formula is used as the curvature calculation method to solve for the curvature parameter of each sampling point in the signal segment corresponding to each heartbeat. Sampling points with curvature parameters greater than a preset threshold are selected and used as the initial vertices of the corresponding signal segment. The preset threshold is determined by experimental verification to adapt to the curvature characteristics of the waveform around point J in the electrocardiogram signal.
5. The method for locating point J in an electrocardiogram signal according to claim 4, characterized in that, For any two adjacent initial vertices, the sequential polygon approximation algorithm is used to fit the signal segment between the two vertices; Obtain the endpoint of each fitted line segment during the fitting process and integrate it with the initial vertex to form a candidate vertex set, specifically including: For any two adjacent initial vertices, a fitting process is performed, and a sequential polygon approximation algorithm is used to fit the signal segment between the two vertices: Starting from the current initial vertex, attempt to fit a straight line to the subsequent sampling points to the right, and calculate the fitting error for each fitting interval; If the fitting error meets the preset error allowable standard, continue to try fitting the next sampling point; if the fitting error exceeds the error allowable standard, backtrack to find the previous sampling point that meets the error allowable standard, take the interval from the current initial vertex to the backtracked sampling point as a fitting line segment and include it in the result set, and set the backtracked sampling point as the new fitting starting point. Repeat the above fitting process until the fitting of all signal segments is completed. Obtain the endpoint of each fitted line segment during the fitting process and integrate it with the initial vertex to form a candidate vertex set.
6. The method for locating point J in an electrocardiogram signal according to claim 5, characterized in that, A dynamic programming algorithm, incorporating electrophysiological structural constraints, is employed to evaluate candidate J-point locations by constructing a multi-dimensional cost function. The candidate J-point with the minimum cost function value is then determined as the J-point in the current electrocardiogram signal. Specifically, this includes: A dynamic programming algorithm, incorporating electrocardiographic structural constraints, is employed to evaluate candidate J-point locations by constructing a multi-dimensional cost function. The candidate J-point with the minimum cost function value is then determined as the J-point in the current electrocardiogram signal. The multi-dimensional cost function is as follows: ; The local curvature cost function ; Geometric location cost function ; Morphological cost function ; Where w1, w2, and w3 are preset weight parameters; Let J be the curvature parameter of the k-th candidate J point. Let J be the candidate position of the k-th point. The location of the S-wave peak. To preset the delay time, It is a vector consisting of the S-wave peak and the k-th candidate J point. It is the vector formed by the k-th candidate J point and the point Mst.
7. A system for locating point J in an electrocardiogram signal, characterized in that, include: The basic waveform detection module is used to filter the original electrocardiogram signal to obtain the target signal, and to detect the R-peak position and T-peak position in the target signal. The S-peak extraction module is used to calculate the angle sequence after performing secondary filtering on the target signal. Based on the R-peak position, the S-peak position is extracted on the angle sequence within a set time interval after the R-peak using a dynamic threshold method. The J-point positioning module is used to define the signal interval to be analyzed based on the S-wave peak point and the T-wave peak point. Within the signal interval, a set of candidate vertex positions is extracted based on curvature calculation and polygon fitting. The J-point is then selected from the set of candidate vertex positions through distance filtering and dynamic programming.
8. A positioning system for point J in an electrocardiogram signal according to claim 7, characterized in that: The S-peak extraction module is further used to perform secondary filtering on the preprocessed target signal using bandpass filtering to obtain an ECG filtered signal; based on the signal sampling rate and a dynamically adjustable amplitude difference ratio coefficient, it calculates the absolute value of the amplitude difference between two consecutive sampled samples of the ECG filtered signal, and converts this absolute value into an angle parameter after scaling; according to the angle parameter, it dynamically adapts the detection threshold corresponding to each heartbeat and obtains an adaptation adjustment value sequence, wherein the dynamic adaptation rule is to configure a higher threshold when the R-peak appears and a lower threshold at other times; and calculates the... The absolute value of the difference between two consecutive points in the adaptation adjustment value sequence is scaled and converted into an angle sequence. All peak points to be evaluated in the angle sequence are extracted. For the R-wave peak point of each heartbeat, peak points located within a set time window after the extracted peak points to be evaluated are selected. The peak point with the latest time order is selected as the search starting point for the S-wave peak. Based on the search starting point, the position with the smallest amplitude in the ECG filtered signal is found in the subsequent set time window, and this position is determined as the S-wave peak point position.
9. A device for locating point J in an electrocardiogram signal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.