A pacemaker artifact suppression method and system based on median difference
Through the median difference method, the median first-order forward differential operation and flat filling of hyperbolic cosine function are used to solve the problem of interference of pacemaker artifacts on the ECG signal, and the analysis accuracy of the ECG signal and the pacing pulse suppression performance are improved.
Patent Information
- Application Number
- CN202310174990.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2043-02-28
AI Technical Summary
The pacemaker artifacts interfere with the ECG signal severely, resulting in a decrease in the specificity and sensitivity of the ECG rhythm analysis, which may lead to the inability to correctly distinguish the defibrillation/non-defibrillation categories.
Using a median difference method, the median first-order forward differential operation and flat filling of hyperbolic cosine function is used to accurately filter out the pacing pulse artifacts and reduce interference to the ECG signal.
It improves the accuracy of rhythm classification with pacing pulse interference ECG signals, has better pacing pulse suppression performance, and has small calculation amount.
Smart Images

Figure CN116138788B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrocardiogram signal processing, and in particular to a pacemaker artifact suppression method and system based on median difference. Background Art
[0002] In modern society, when arrhythmia occurs, pacemakers are usually installed on patients to help them improve their arrhythmias, and they also have a certain therapeutic effect on heart failure. The working principle of a pacemaker is to send tiny electrical pulses to the heart when needed. The pacing electrode wire is composed of an insulated wire, which is responsible for transmitting tiny electrical pulses to the heart to stimulate the heart to beat.
[0003] However, the artifacts generated by the pacing pulses during the operation of the pacemaker will seriously interfere with the original ECG signal, thereby reducing the specificity and sensitivity of ECG rhythm analysis when using an automatic defibrillator (AED), which may make it impossible to correctly distinguish between defibrillation / non-defibrillation categories. Summary of the invention
[0004] In response to the technical problem of pacemaker artifacts interfering with ECG signals in the prior art, the present invention proposes a pacemaker artifact suppression method and system based on median difference, which utilizes the median first-order forward difference function to quickly locate the pacing pulse group characteristics in the ECG signal, and the flat filling characteristic of the hyperbolic cosine function to the signal to accurately filter out the pacing pulses and reduce interference with the ECG signal.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A pacemaker artifact suppression method based on median difference comprises the following steps:
[0007] S1: Acquire ECG data with pacemaker pulse signal artifacts to be processed;
[0008] S2: preprocessing the ECG data to obtain preprocessed data;
[0009] S3: Perform a median first-order forward difference operation on the preprocessed data to obtain a difference sequence, and then correct the difference sequence to obtain a corrected median difference sequence;
[0010] S4: Determine the pacing pulse artifact filtering threshold based on the corrected median difference sequence of S3;
[0011] S5: determining the pacing artifact in the ECG data according to the pacing pulse artifact filtering threshold in S4, and setting it to a null value to filter out the pacing artifact;
[0012] S6: using a hyperbolic cosine function to fill in the blank positions where the pacing artifacts are filtered out to obtain a filling sequence;
[0013] S7: Smoothing the filling sequence output by S6 to obtain ECG data with suppressed artifacts.
[0014] Preferably, in S1, the pacemaker pulse signal includes at least three categories: a pacing pulse amplitude equal to 2 times the R peak amplitude of the ECG signal, a pacing pulse amplitude equal to 1 times the R peak amplitude of the ECG signal, and a pacing pulse amplitude equal to 0.5 times the R peak amplitude of the ECG signal.
[0015] Preferably, in S1, the ECG data includes six waveforms (N, AF, SVTA, VF, VFL, VT-hi), each waveform includes at least 100 samples, and each sample has at least 1000 sampling points.
[0016] Preferably, the S2 includes:
[0017] S21: A low-pass filter with a cutoff frequency of 20 Hz is designed using a Butterworth first-order filter to low-pass filter the ECG data to remove myoelectric interference;
[0018] S22: A high-pass filter with a cutoff frequency of 2 Hz was designed using a Butterworth second-order filter to perform high-pass filtering on the ECG data to remove baseline drift;
[0019] S23: A Butterworth first-order filter is used to design a band-stop filter with cutoff frequencies of [49.8 Hz, 50.2 Hz] and [49.9 Hz, 50.1 Hz] to perform high-pass filtering on the ECG data to remove power frequency interference.
[0020] Preferably, S3 includes:
[0021] S31: Perform a first-order forward difference calculation on the preprocessed data to obtain a difference sequence. The calculation formula is as follows:
[0022] dif k =X k -X k-1 (1)
[0023] In formula (1), dif k represents the first-order forward difference sequence; X k represents the kth preprocessed data; X k-1 represents the k-1th preprocessed data; k = 0, 1, 2, .... N, N represents the total number of preprocessed data;
[0024] S32: Perform median processing on the first-order forward difference sequence calculated by S31:
[0025] median_int=Median(dif k) k=0,1,2...N (2)
[0026] The meaning of formula (2) is to calculate the median integer of the first-order difference forward sequence; median_int represents the median integer of the first-order difference forward sequence; Median(dif k ) represents the difference sequence dif k Perform median processing;
[0027] mad_int=Median(|dif k -median_int|) k=0,1,2...N (3)
[0028] If mad_int==0: mad_int=1 (4)
[0029] The meaning of formulas (3) and (4) is to correct the median integer; mad_int represents the corrected median integer; when mad_int is equal to 0, mad_int is directly set to 1;
[0030] modified_y=0.6745*(dif k -median_int) / mad_int (5)
[0031] In formula (5), modified_y represents the modified median difference sequence, that is, the modified input ECG signal set.
[0032] Preferably, in S4, the calculation formula of the pacing pulse artifact filtering threshold is as follows:
[0033] threshold=percentile(|modified_y|,α)+∈ (6)
[0034] In formula (6), threshold represents the threshold for filtering out pacing pulse artifacts; modified_y represents the modified median difference sequence; α, ∈ are both hyperparameters.
[0035] Preferably, the S5 includes:
[0036] S51: Detect the location of the pacing artifact in the ECG data according to the pacing pulse artifact filtering threshold:
[0037] spikes=|modified_y|>threshold (7)
[0038] In formula (7), Spikes represents the pacing artifact; modified_y represents the modified median difference sequence, that is, the modified input ECG signal set; threshold represents the pacing pulse artifact filtering threshold;
[0039] S52: setting the position of the pacing artifact in the ECG data to a null value, that is, filtering out the pacing artifact;
[0040] If spikes[i]!=0:
[0041] X i =nan (8)
[0042] In formula (8), spikes[i] represents the pacing artifact; X i represents the original input ECG signal with pacing artifacts, that is, the parameters in the median difference sequence after median correction; i represents the subscript position of the pacing artifact in modify_y, that is, X i The subscript position of ;
[0043] S53: Obtain the pacing pseudo film segment group according to the subscript position of spikes:
[0044]
[0045] In formula (9), gaps represents the electrocardiogram signal X with pacing artifacts according to formula (8): i The blank segment group left after removing the artifacts; K m Indicates that the mth segment in the blank segment group is in X i The first subscript in K1 indicates the first subscript position of the first fragment, and K2 indicates the first subscript position of the second fragment; n km Indicates the length of the mth segment.
[0046] Preferably, the S6 includes:
[0047] S61: For each segment group in gaps, determine the horizontal and vertical coordinates of the starting point and the ending point:
[0048] x p1 =k1,y p1 =X(k1) (10)
[0049]
[0050] In formulas (10) and (11), (x p1 ,y p1) represents the starting point coordinates of the first segment group in gaps; k1 represents the starting subscript of the first artifact blank segment; X(k1) represents the value of the ECG signal corresponding to the starting subscript of the first artifact blank segment; (x p2 ,y p2 ) represents the end point coordinates of the first segment group in gaps; Indicates the length of the first artifact blank segment;
[0051] S62: Filling is performed using a hyperbolic cosine function according to the coordinates of the start point and the end point of the segment group to obtain a filling sequence:
[0052]
[0053] b=y p1 -a*cosh(x p1 ) (13)
[0054]
[0055]
[0056] In formulas (12), (13), (14), and (15), cosh represents the hyperbolic cosine function; x p2 % rate represents the p2 Perform a modulo operation, that is, take the remainder; a represents the slope of the line connecting Point1 and Point2; b represents the intercept of the line connecting Point1 and Point2 on the y-axis; represents the i-th point in each segment group; coshed_y represents the filling sequence after pacing pulse artifact filtering and filling.
[0057] Preferably, in S7, the expression of ECG data for suppressing artifacts is:
[0058] Y_out k =Median(coshed_y,size=β) (16)
[0059] In formula (16), Y_out k represents the artifact-free ECG data obtained; Median represents the one-dimensional median smoothing function; coshed_y represents the filling sequence after the pacing pulse artifact is filtered out and filled; β represents the size of the smoothing window.
[0060] The present invention also provides a pacemaker artifact suppression system based on median difference, comprising a data acquisition unit, a preprocessing unit, a median difference operation unit, an artifact filtering unit and a post-processing unit connected in sequence;
[0061] A data acquisition unit, used for acquiring ECG data with pacemaker pulse signal artifacts to be processed;
[0062] A preprocessing unit, used to construct a low-pass filter, a high-pass filter and a band-stop filter to preprocess the ECG data;
[0063] The median difference operation unit is used to perform a median first-order forward difference operation on the preprocessed data and perform correction to obtain a corrected median difference sequence;
[0064] An artifact filtering unit, used for removing artifacts in the corrected median difference sequence according to an artifact filtering threshold;
[0065] The post-processing unit is used to fill and smooth the sequence after the artifacts are removed to obtain ECG data after the artifacts are suppressed.
[0066] In summary, due to the adoption of the above technical solution, compared with the prior art, the present invention has at least the following beneficial effects:
[0067] The present invention makes full use of the median first-order forward difference function to quickly locate the pacing pulse group characteristics in the electrocardiogram signal, and the flat filling characteristics of the hyperbolic cosine function on the signal to accurately filter out the pacing pulses and the interference of the burst pulse artifacts on the electrocardiogram signal, thereby improving the rhythm classification accuracy of the electrocardiogram signal with pacing pulse interference, with small calculation amount and better pacing pulse suppression performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 Schematic diagram of a pacemaker artifact suppression method based on median difference according to an exemplary embodiment of the present invention.
[0069] Figure 2 FIG. 4 is an N-band electrocardiogram containing pacing pulse artifacts according to an exemplary embodiment of the present invention.
[0070] Figure 3 FIG. 4 is an N-band electrocardiogram with pacing pulse artifacts removed according to an exemplary embodiment of the present invention.
[0071] Figure 4 VT band original electrocardiogram containing pacing pulse artifacts according to an exemplary embodiment of the present invention.
[0072] Figure 5 FIG. 4 is an original electrocardiogram in the VT band with pacing pulse artifacts removed according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0073] The present invention is further described in detail below in conjunction with the examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following examples, and all technologies realized based on the content of the present invention belong to the scope of the present invention.
[0074] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0075] like Figure 1 As shown, the present invention provides a pacemaker artifact suppression method based on median difference, which specifically includes the following steps:
[0076] S1: Acquire various ECG (electrocardiogram) data with pacemaker pulse signal artifacts to be processed.
[0077] In this embodiment, the ECG data includes six waveforms, namely N, AF, SVTA, VF, VFL, and VT-hi (which are the most important waveform types in the MIT and CU international authoritative ECG databases, and are also the waveforms that require defibrillation classification as specified in the national standard AED defibrillation classification standard). Each waveform includes at least 100 samples, and each sample has at least 1000 sampling points.
[0078] Construction of VT-hi: 1000 sampling points with an average heart rate above 150 beats / minute (i.e. greater than 150 beats / minute) are selected in the VT waveform to construct the VT_hi waveform.
[0079] The pacemaker pulse signal includes at least three categories: the pacing pulse amplitude is equal to 2 times the R peak amplitude of the ECG signal, the pacing pulse amplitude is equal to 1 times the R peak amplitude of the ECG signal, and the pacing pulse amplitude is equal to 0.5 times the R peak amplitude of the ECG signal.
[0080] S2: Preprocess the ECG data to obtain preprocessed data.
[0081] In this embodiment, the ECG data is preprocessed and filtered three times in total. The specific steps include:
[0082] S21: A low-pass filter with a cutoff frequency of 20 Hz is designed using a Butterworth first-order filter to perform low-pass filtering on the ECG data to remove myoelectric interference.
[0083] S22: A high-pass filter with a cutoff frequency of 2 Hz was designed using a Butterworth second-order filter to high-pass filter the ECG data and remove baseline drift.
[0084] S23: A Butterworth first-order filter is used to design a band-stop filter with cutoff frequencies of [49.8 Hz, 50.2 Hz] and [49.9 Hz, 50.1 Hz] to perform high-pass filtering on the ECG data to remove power frequency interference.
[0085] S3: Perform a first-order forward difference operation on the median of the preprocessed data to obtain a difference sequence, and then correct the difference sequence to obtain a corrected median difference sequence.
[0086] In this embodiment, the preprocessed data is an electrocardiogram signal with pacing artifacts.
[0087] S31: Perform a first-order forward difference calculation on the preprocessed data to obtain a difference sequence. The calculation formula is as follows:
[0088] dif k =X k -X k-1 (1)
[0089] In formula (1), dif k represents the first-order forward difference sequence; X k represents the kth preprocessed data; X k-1 represents the k-1th preprocessed data; k = 0, 1, 2, .... N, N represents the total number of preprocessed data.
[0090] S32: Perform median processing on the first-order forward difference sequence calculated by S31:
[0091] median_int=Median(dif k ) k=0,1,2...N (2)
[0092] The meaning of formula (2) is to calculate the median integer of the first-order difference forward sequence; median_int represents the median integer of the first-order difference forward sequence; Median(dif k ) represents the difference sequence dif k Perform median processing;
[0093] mad_int=Median(|dif k -median_int|) k=0,1,2...N (3)
[0094] If mad_int==0: mad_int=1 (4)
[0095] The meaning of formulas (3) and (4) is to correct the median integer; mad_int represents the corrected median integer; when mad_int is equal to 0, mad_int is directly set to 1, because mad_int in formula (5) is the denominator and cannot be zero.
[0096] modified_y=0.6745*(dif k -median_int) / mad_int (5)
[0097] In formula (5), modified_y represents the modified median difference sequence, that is, the modified input ECG signal set.
[0098] In this embodiment, the parameter in modified_y is an ECG signal with pacing artifacts, X i represents the i-th ECG signal with pacing artifacts.
[0099] S4: Determine the pacing pulse artifact filtering threshold based on the corrected median difference sequence in S3. The calculation formula is as follows:
[0100] threshold=percentile(|modified_y|,α)+∈ (6)
[0101] In formula (6), threshold represents the threshold for filtering out pacing pulse artifacts; modified_y represents the modified median difference sequence; α, ∈ are both hyperparameters and need to be determined by testing with large sample data.
[0102] S5: Determine the location of the pacing artifact in the ECG data according to the pacing pulse artifact filtering threshold in S4, and set it to a null value to filter out the pacing artifact.
[0103] S51: Detecting pacing artifacts in ECG data according to the pacing pulse artifact filtering threshold:
[0104] spikes=|modified_y|>threshold (7)
[0105] In formula (7), Spikes represents pacing artifact, modified_y represents the median difference sequence (input ECG signal) after median correction; the part where modified_y is greater than threshold is defined as pacing artifact, which is the part of the input signal that needs to be filtered out.
[0106] S52: Setting the position of the pacing artifact in the ECG data to a null value (ie, a nan value), that is, filtering out the pacing artifact.
[0107] If spikes[i]!=0:
[0108] X i =nan (8)
[0109] In formula (8), spikes[i] represents the pacing artifact; X i represents the original input ECG signal with pacing artifacts (i.e., the parameters in the median difference sequence after median correction); i represents the subscript position of the pacing artifact in modify_y (also the original input ECG signal X i subscript position).
[0110] S53: According to the subscript position of spikes, the pacing pseudo-video segment group can also be obtained:
[0111]
[0112] In formula (9), gaps represents the electrocardiogram signal X with pacing artifacts according to formula (8): i The blank segment group left after removing the artifacts; K m Indicates that the mth segment in the blank segment group is in X i The first subscript in K1 indicates the first subscript position of the first fragment, and K2 indicates the first subscript position of the second fragment; n km Indicates the length of the mth segment.
[0113] S6: Use a hyperbolic cosine function to fill in the blank positions where the pacing artifacts are filtered out to obtain a filling sequence.
[0114] S61: For each segment group in gaps, determine the horizontal and vertical coordinates of the starting point and the ending point.
[0115] Point1 (starting point): x p1 =k1,y p1 =X(k1) (10)
[0116] Point2 (end point):
[0117] In formulas (10) and (11), (x p1 ,y p1 ) represents the coordinates of the starting point of the first segment group in gaps; k1 represents the starting subscript of the first artifact blank segment; X(k1) represents the value of the original ECG signal corresponding to the starting subscript of the first artifact blank segment; k1 is obtained according to formula (9), and X(k1) is the value X(k1) obtained by bringing k1 back to the original ECG signal X, that is, the value corresponding to the subscript k1 position; (x p2 ,y p2) represents the end point coordinates of the first segment group in gaps; It represents the length of the first artifact blank segment. When the artifact segments are removed according to formula (8) and formula (9), the length of each blank segment can be obtained.
[0118] S62: A filling sequence is obtained by using a hyperbolic cosine function to fill in the starting and ending coordinates of the segment group; this describes the filling of a blank segment group (a filling operation needs to be performed on each blank segment group), p1 is the starting point, p2 is the ending point, and pi is the point between p1 and p2.
[0119]
[0120] b=y p1 -a*cosh(x p1 ) (13)
[0121]
[0122]
[0123] In formulas (12), (13), (14), and (15), cosh represents the hyperbolic cosine function; x p2 % rate represents the p2 Perform a modulo operation, that is, take the remainder; a represents the slope of the line connecting Point1 and Point2; b represents the intercept of the line connecting Point1 and Point2 on the y-axis; represents the i-th point in each segment group; coshed_y represents the filling sequence after the pacing pulse artifact is filtered out and filled; where rate = 600.
[0124] S7. Use median filtering to smooth the filling sequence output by S6 to obtain ECG data after suppressing artifacts, and then use the ECG data after suppressing artifacts to determine the defibrillation / non-defibrillation category to improve the accuracy of the determination.
[0125] Specifically:
[0126] Y_out k =Median(coshed_y,size=β) (16)
[0127] In formula (16), Y_out k represents the artifact-free ECG data obtained; Median represents the one-dimensional median smoothing function; coshed_y represents the filling sequence output by S6 after the pacing pulse artifact is filtered out and filled; β represents the size of the smoothing window, which needs to be determined by testing with large sample data.
[0128] The present invention makes full use of the median first-order forward difference function to quickly locate the pacing pulse group characteristics in the electrocardiogram signal, and the flat filling characteristics of the hyperbolic cosine function on the signal to accurately filter out the pacing pulse, which greatly improves the rhythm classification of the electrocardiogram signal with pacing pulse interference, has a small amount of calculation, and has better pacing pulse suppression performance.
[0129] To verify the effect of the present invention, Figure 2 , Figure 3 , Figure 4 , Figure 5 shown.
[0130] Figure 2 and Figure 3 The first control group, Figure 2 The original N-band electrocardiogram contains pacing pulse artifacts. Figure 3 For Figure 2 After running this method on the original ECG signal, the ECG after removing the pacing pulse artifact can be seen Figure 3 Compare Figure 2 More regular and clear.
[0131] Figure 4 and Figure 5 The second control group, Figure 4 This is the original ECG of the VT band containing the pacing pulse artifact. Figure 5 For Figure 4 After running this method on the original ECG signal, the ECG after removing the pacing pulse artifact can be seen Figure 5 Compare Figure 4 More regular and clear.
[0132] Based on the above method, the present invention also provides a pacemaker artifact suppression system based on median difference, including a data acquisition unit, a preprocessing unit, a median difference operation unit, an artifact filtering unit and a post-processing unit connected in sequence.
[0133] The output end of the data acquisition unit is connected to the input end of the preprocessing unit, the output end of the preprocessing unit is connected to the input end of the median difference operation unit, the output end of the median difference operation unit is connected to the input end of the artifact filtering unit, and the output end of the artifact filtering unit is connected to the input end of the post-processing unit.
[0134] A data acquisition unit, used to acquire various ECG (electrocardiogram) data with pacemaker pulse signal artifacts to be processed;
[0135] A preprocessing unit, used to construct a low-pass filter, a high-pass filter and a band-stop filter to preprocess the ECG data;
[0136] The median difference operation unit is used to perform a median first-order forward difference operation on the preprocessed data and perform correction to obtain a corrected median difference sequence;
[0137] An artifact filtering unit, used for removing artifacts in the corrected median difference sequence according to an artifact filtering threshold;
[0138] The post-processing unit is used to fill and smooth the sequence after the artifacts are removed to obtain ECG data after the artifacts are suppressed.
[0139] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A pacemaker artifact suppression method based on median difference, characterized in that: The following steps are involved: S1: Acquire ECG data with pacemaker pulse signal artifacts to be processed; S2: preprocessing the ECG data to obtain preprocessed data; S3: Perform a median first-order forward difference operation on the preprocessed data to obtain a difference sequence, and then correct the difference sequence to obtain a corrected median difference sequence; S4: Determine the pacing pulse artifact filtering threshold based on the corrected median difference sequence of S3; S5: determining the pacing artifact in the ECG data according to the pacing pulse artifact filtering threshold in S4, and setting it to a null value to filter out the pacing artifact; S6: using a hyperbolic cosine function to fill in the blank positions where the pacing artifacts are filtered out to obtain a filling sequence; S7: Smoothing the filling sequence output by S6 to obtain ECG data with suppressed artifacts.
2. A pacemaker artifact suppression method based on median difference as claimed in claim 1, characterized in that: In S1, the pacemaker pulse signal includes at least three categories: a pacing pulse amplitude equal to 2 times the R peak amplitude of the ECG signal, a pacing pulse amplitude equal to 1 times the R peak amplitude of the ECG signal, and a pacing pulse amplitude equal to 0.5 times the R peak amplitude of the ECG signal.
3. A pacemaker artifact suppression method based on median difference as claimed in claim 1, characterized in that: In S1, the ECG data includes six waveforms (N, AF, SVTA, VF, VFL, VT-hi), each waveform includes at least 100 samples, and each sample has at least 1000 sampling points.
4. A pacemaker artifact suppression method based on median difference as claimed in claim 1, characterized in that: The S2 includes: S21: A low-pass filter with a cutoff frequency of 20 Hz is designed using a Butterworth first-order filter to low-pass filter the ECG data to remove myoelectric interference; S22: A high-pass filter with a cutoff frequency of 2 Hz was designed using a Butterworth second-order filter to perform high-pass filtering on the ECG data to remove baseline drift; S23: A Butterworth first-order filter is used to design a band-stop filter with cutoff frequencies of [49.8 Hz, 50.2 Hz] and [49.9 Hz, 50.1 Hz] to perform high-pass filtering on the ECG data to remove power frequency interference.
5. The pacemaker artifact suppression method based on median difference according to claim 1, characterized in that: The S3 includes: S31: Perform a first-order forward difference calculation on the preprocessed data to obtain a difference sequence. The calculation formula is as follows: dif k =X k -X k-1 (1) In formula (1), dif k represents the first-order forward difference sequence; X k represents the kth preprocessed data; X k-1 represents the k-1th preprocessed data; k = 0, 1, 2, .... N, N represents the total number of preprocessed data; S32: Perform median processing on the first-order forward difference sequence calculated by S31: median_int=Median(dif k ) k=0,1,2...N (2) The meaning of formula (2) is to calculate the median integer of the first-order difference forward sequence; median_int represents the median integer of the first-order difference forward sequence; Median(dif k ) represents the difference sequence dif k Perform median processing; mad_int=Median(|dif k -median_int|) k=0,1,2...N (3) If mad_int==0:mad_int=1 (4) The meaning of formulas (3) and (4) is to correct the median integer; mad_int represents the corrected median integer; when mad_int is equal to 0, mad_int is directly set to 1; modified_y=0.6745*(dif k -median_int) / mad_int (5) In formula (5), modified_y represents the modified median difference sequence, that is, the modified input ECG signal set.
6. A pacemaker artifact suppression method based on median difference as claimed in claim 1, characterized in that: In S4, the calculation formula of the pacing pulse artifact filtering threshold is as follows: threshold=percentile(|modified_y|,α)+∈ (6) In formula (6), threshold represents the threshold for filtering out pacing pulse artifacts; modified_y represents the modified median difference sequence; α, ∈ are both hyperparameters.
7. A pacemaker artifact suppression method based on median difference as claimed in claim 1, characterized in that: The S5 includes: S51: Detect the location of the pacing artifact in the ECG data according to the pacing pulse artifact filtering threshold: spikes=|modified_y|>threshold (7) In formula (7), Spikes represents the pacing artifact; modified_y represents the modified median difference sequence, that is, the modified input ECG signal set; threshold represents the pacing pulse artifact filtering threshold; S52: setting the position of the pacing artifact in the ECG data to a null value, that is, filtering out the pacing artifact; If spikes[i]!=0: X i =in (8) In formula (8), spikes[i] represents the pacing artifact; X i represents the original input ECG signal with pacing artifacts, that is, the parameters in the median difference sequence after median correction; i represents the subscript position of the pacing artifact in modify_y, that is, X i The subscript position of ; S53: Obtain the pacing pseudo film segment group according to the subscript position of spikes: In formula (9), gaps represents the electrocardiogram signal X with pacing artifacts according to formula (8): i The blank segment group left after removing the artifacts; K m Indicates that the mth segment in the blank segment group is in X i The first subscript in K1 indicates the first subscript position of the first fragment, and K2 indicates the first subscript position of the second fragment; n km Indicates the length of the mth segment.
8. The pacemaker artifact suppression method based on median difference according to claim 1, characterized in that: The S6 includes: S61: For each segment group in gaps, determine the horizontal and vertical coordinates of the starting point and the ending point: x p1 =k1,y p1 =X(k1) (10) In formulas (10) and (11), (x p1 ,y p1 ) represents the starting point coordinates of the first segment group in gaps; k1 represents the starting subscript of the first artifact blank segment; X(k1) represents the value of the ECG signal corresponding to the starting subscript of the first artifact blank segment; (x p2 ,y p2 ) represents the end point coordinates of the first segment group in gaps; Indicates the length of the first artifact blank segment; S62: Filling is performed using a hyperbolic cosine function according to the coordinates of the start point and the end point of the segment group to obtain a filling sequence: b=y p1 -a*cosh(x p1 ) (13) In formulas (12), (13), (14), and (15), cosh represents the hyperbolic cosine function; x p2 % rate represents the p2 Perform a modulo operation, that is, take the remainder; a represents the slope of the line connecting Point1 and Point2; b represents the intercept of the line connecting Point1 and Point2 on the y-axis; represents the i-th point in each segment group; coshed_y represents the filling sequence after pacing pulse artifact filtering and filling.
9. The pacemaker artifact suppression method based on median difference according to claim 1, characterized in that: In S7, the expression of ECG data for suppressing artifacts is: Y_out k =Median(coshed_y,size=β) (16) In formula (16), Y_out k represents the artifact-free ECG data obtained; Median represents the one-dimensional median smoothing function; coshed_y represents the filling sequence after the pacing pulse artifact is filtered out and filled; β represents the size of the smoothing window.
10. A pacemaker artifact suppression system based on median difference according to any one of the methods of claims 1 to 9, characterized in that: It includes a data acquisition unit, a pre-processing unit, a median difference calculation unit, an artifact filtering unit and a post-processing unit which are connected in sequence; A data acquisition unit, used for acquiring ECG data with pacemaker pulse signal artifacts to be processed; A preprocessing unit, used to construct a low-pass filter, a high-pass filter and a band-stop filter to preprocess the ECG data; The median difference operation unit is used to perform a median first-order forward difference operation on the preprocessed data and perform correction to obtain a corrected median difference sequence; An artifact filtering unit, used for removing artifacts in the corrected median difference sequence according to an artifact filtering threshold; The post-processing unit is used to fill and smooth the sequence after the artifacts are removed to obtain ECG data after the artifacts are suppressed.
Citation Information
Patent Citations
Pace-making signal detecting method and system and electrocardio detecting device
CN103860162A
Pace-making signal detection method and device, and wearable health device
CN109107041A