CN115828056A - Electrocardiogram characteristic signal extraction method and terminal - Google Patents
Electrocardiogram characteristic signal extraction method and terminal Download PDFInfo
- Publication number
- CN115828056A CN115828056A CN202211013188.4A CN202211013188A CN115828056A CN 115828056 A CN115828056 A CN 115828056A CN 202211013188 A CN202211013188 A CN 202211013188A CN 115828056 A CN115828056 A CN 115828056A
- Authority
- CN
- China
- Prior art keywords
- electrocardiogram
- wave
- electrocardiogram signal
- point
- wave peak
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000605 extraction Methods 0.000 title claims abstract description 10
- 238000001514 detection method Methods 0.000 claims abstract description 98
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 96
- 238000000034 method Methods 0.000 claims abstract description 34
- 238000001914 filtration Methods 0.000 claims abstract description 25
- 238000012545 processing Methods 0.000 claims abstract description 23
- 230000010354 integration Effects 0.000 claims abstract description 16
- 230000008569 process Effects 0.000 claims abstract description 11
- 238000004364 calculation method Methods 0.000 claims description 17
- 230000006870 function Effects 0.000 claims description 16
- 238000005070 sampling Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 8
- 230000008859 change Effects 0.000 claims description 6
- 230000001121 heart beat frequency Effects 0.000 claims description 6
- 230000003044 adaptive effect Effects 0.000 claims description 4
- 238000000718 qrs complex Methods 0.000 description 11
- 230000033001 locomotion Effects 0.000 description 7
- 206010003119 arrhythmia Diseases 0.000 description 4
- 238000010009 beating Methods 0.000 description 4
- 230000006793 arrhythmia Effects 0.000 description 3
- 210000003205 muscle Anatomy 0.000 description 3
- 230000002861 ventricular Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000000747 cardiac effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000003205 diastolic effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000005284 excitation Effects 0.000 description 2
- 230000036541 health Effects 0.000 description 2
- 210000002837 heart atrium Anatomy 0.000 description 2
- 230000028161 membrane depolarization Effects 0.000 description 2
- 230000002336 repolarization Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 206010008479 Chest Pain Diseases 0.000 description 1
- 206010010356 Congenital anomaly Diseases 0.000 description 1
- 206010033557 Palpitations Diseases 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 210000001992 atrioventricular node Anatomy 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 208000002173 dizziness Diseases 0.000 description 1
- 230000005672 electromagnetic field Effects 0.000 description 1
- 230000010247 heart contraction Effects 0.000 description 1
- 238000010339 medical test Methods 0.000 description 1
- 230000001575 pathological effect Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000004213 regulation of atrial cardiomyocyte membrane depolarization Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000033764 rhythmic process Effects 0.000 description 1
- 210000001013 sinoatrial node Anatomy 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 230000000638 stimulation Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 208000003663 ventricular fibrillation Diseases 0.000 description 1
Images
Landscapes
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
The invention relates to an electrocardiogram characteristic signal extraction method and a terminal, which are used for acquiring an input electrocardiogram signal; carrying out filtering pretreatment on the electrocardiogram signals; amplifying the electrocardiogram signal using a square function and processing the electrocardiogram signal using a moving window integration algorithm; sequentially detecting the electrocardiogram signals by using a characteristic point detection algorithm, wherein the types of the characteristic point detection algorithm comprise an R wave peak point detection algorithm, a P wave peak point detection algorithm, a T wave peak point detection algorithm, an S wave trough point detection algorithm and a Q wave trough point detection algorithm; in the process of detecting the electrocardiogram signals, a threshold self-adaptive algorithm is used according to the types of the feature point detection algorithms to obtain self-adaptive thresholds corresponding to the types, whether the electrocardiogram signals meet preset detection conditions of the feature point detection algorithms or not is judged, and the electrocardiogram signals meeting the preset detection conditions are used as feature point peak values/feature point valley values and stored. Therefore, the invention can accurately and completely detect the characteristic data of the electrocardiogram signal.
Description
Technical Field
The invention relates to the technical field of electrocardiogram signals, in particular to an electrocardiogram characteristic signal extraction method and a terminal.
Background
Arrhythmia refers to an abnormality in the frequency or rhythm of the heart beat, including both congenital and acquired. Mild patients feel dizziness, chest distress and palpitation, severe patients are life threatening, and need to seek medical advice immediately. The most common medical test for cardiac arrhythmias is an electrocardiogram. Due to the individual differences of patients, doctors can take treatment by subjective judgment, which requires the doctors to have certain experience. Automated analysis of the electrocardiogram is therefore highly desirable. The electrocardiogram signal reflects the electric signal of human heart in motion process, and the study of electrocardiogram signal characteristics is an important way to grasp the beating rule and health condition of heart.
Electrocardiographic signals are typically subject to muscle noise, motion artifacts, baseline wander, and electromagnetic field interference. Failure to detect the R-wave or failure to detect it can lead to unreliable results in an ecg signal. The amplitude threshold method cannot properly eliminate signal noise when QRS wave detection is carried out; the Pan-Tompkins method helps reduce motion artifacts and baseline drift, but does not eliminate high frequency noise. When a digital filter is used for QRS wave enhancement, although the signal-to-noise ratio can be improved, this method is too dependent on the order and nature of the digital filter. Neural networks can also be used for extraction of the electrocardiosignals, but this method is difficult to handle with noise. The band-pass filter and the hidden Markov model can be combined to be used for extracting the electrocardiosignal, but the hidden Markov model is easily influenced by noise and baseline drift. The use of the singular method for QRS wave detection, while feasible, is also difficult to handle with noise.
The electrocardiogram signal is the record of the current change condition in the periodic movement of human heart, before the heart contraction, there is the conduction stimulation of electric signal and then there is the physical deformation movement. As shown in fig. 1, a normal heart beat cycle includes a normal electrocardiogram waveform generated by the electrical activity of the atria and having characteristic signals including P-wave, PR interval, PR segment, QRS complex, ST segment, T-wave, QT interval, etc. and is characterized by the following specific features:
(1) The P wave, reflects the cardiac potential changes during both atrial depolarizations. From the motion cycle of the heart, the P-wave time phase is in the systolic phase of the heart beat, but has not yet begun the systolic phase.
(2) PR interval, refers to the waveform time from the beginning of the P wave to the beginning of the QRS complex. Indicating the time required for the electrical current excitation produced by the sinoatrial node to travel through the atria, atrioventricular junctions, atrioventricular nodes, and branches thereof, to the ventricles and cause ventricular excitation. The PR interval is also in the systolic phase of the heart beat.
(3) The QRS complex reflects the changes in electrical potential movement during depolarization of both ventricles. The QRS complex has a more pronounced characteristic in the electrocardiogram signal waveform, which contains three closely linked potential fluctuations: the first is a downward wave called the Q-wave; the second is a high and sharp R-wave going upwards; the last one is the downward S-wave. During the beating of the heart, the QRS wave corresponds to the systolic phase of the heart where large deformations occur.
(4) And the ST segment refers to the waveform part between the end point of the QRS wave complex and the start point of the T wave. At this stage, because the ventricular portions are depolarized but have not yet begun to repolarize, there is no potential change between the ventricular portions, and the waveform returns to a flat and smooth waveform, generally level with the baseline. Corresponding to the deformation state of the heart beat, the heart starts to recover at this stage, i.e. the heart starts to be subjected to diastolic deformation.
(5) And T wave reflecting the current change during repolarization of two ventricles. The direction of the T wave coincides with the direction of the R wave of the QRS complex, which is generally considered as the main wave of the QRS complex. In the beating cycle, the T wave corresponds to the diastolic phase, at which the heart returns to its original shape.
(6) The QT interval, refers to the waveform from the end of the QRS complex to the end of the T wave. It represents the total time required for the ventricles to begin depolarization and complete repolarization. The QT interval is shortened when the heart rate increases, and is lengthened when the heart rate decreases.
Currently, an electrocardiogram signal is a readily available bioelectric signal that provides important information about cardiac abnormalities. In the field of electrocardiographic signal processing, a great deal of research has been carried out by the prior people, and a plurality of relatively mature feature extraction technologies are proposed. Fast Fourier Transform (FFT) is a typical signal processing method, and the large space associated with short data records makes it difficult to record changes in the dominant frequency of ventricular fibrillation over short periods of time. Second, there are finite epochs in the data that produce frequency components in the analysis data that do not correspond to the frequency components of the discrete spectrum, which results in an increased number of spectral peaks, which reduces the ability of the FFT to resolve two close-in time frequencies. Although applying a window function can reduce this drawback, the FFT resolution is also reduced. Continuous Wavelet Transform (CWT) has been developed as a method of obtaining signal synchronization and high-resolution time-frequency information, and in the field of electrocardiographic signal processing, the number and location of QRS complexes can be precisely defined using multi-level decomposition of wavelet transform, and although wavelet transform methods have great advantages, there are some conditions that may not be performed correctly. The efficiency of wavelet transform may be limited by the presence of arrhythmia, which may cause inaccurate QRS complex detection, and the loss of important signal information may be caused by the application of a 3-lead actual electrocardiographic signal acquisition system. Therefore, how to accurately and completely detect the characteristic data of the electrocardiogram signal becomes a problem which needs to be solved urgently.
Disclosure of Invention
Technical problem to be solved
In order to solve the above problems in the prior art, the present invention provides an electrocardiogram characteristic signal extracting method and a terminal, which can accurately and completely detect the characteristic data of the electrocardiogram signal.
(II) technical scheme
In order to achieve the purpose, the invention adopts a technical scheme that: an electrocardiogram characteristic signal extraction method comprises the following steps:
s1, acquiring an input electrocardiogram signal;
s2, carrying out filtering pretreatment on the electrocardiogram signals;
s3, amplifying the electrocardiogram signal by using a square function, and processing the electrocardiogram signal by using a moving window integration algorithm;
s4, detecting the electrocardiogram signals in sequence by using a characteristic point detection algorithm, wherein the type of the characteristic point detection algorithm comprises an R wave peak value point detection algorithm, a P wave peak value point detection algorithm, a T wave peak value point detection algorithm, an S wave trough value point detection algorithm and a Q wave trough value point detection algorithm;
in the process of detecting the electrocardiogram signals, a threshold self-adaptive algorithm is used according to the type of the characteristic point detection algorithm to obtain a self-adaptive threshold corresponding to the type, whether the electrocardiogram signals meet the preset detection conditions of the characteristic point detection algorithm or not is judged, the preset detection conditions comprise the detection conditions of whether the characteristic points meet the self-adaptive threshold or not, and the electrocardiogram signals meeting the preset detection conditions are used as characteristic point peak values/characteristic point valley values and stored.
The other technical scheme adopted by the invention is as follows: an electrocardiogram characteristic signal extracting terminal comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the electrocardiogram characteristic signal extracting method when executing the computer program.
(III) advantageous effects
The beneficial effects of the invention are: after filtering and amplifying the electrocardiogram signal, whether the electrocardiogram signal meets the preset detection condition can be judged based on the adaptive threshold algorithm and the characteristic point detection algorithm, so that the determined electrocardiogram signal can be used as the peak value/valley value of the characteristic point and stored. Therefore, the invention can accurately and completely detect the characteristic data of the electrocardiogram signal, provides a basis for further analyzing and researching the relationship between the heart beat and the electrocardiogram and provides a data basis for simulating the heart beat driven by the characteristic data.
Drawings
FIG. 1 is a schematic diagram of the background art;
FIG. 2 is a flow chart of a method for extracting ECG characteristic signals according to the present invention;
FIG. 3 is a flow chart of an overall scheme of the electrocardiogram characteristic signal extraction method of the invention;
FIG. 4 is a flow chart of a feature point detection algorithm of the method for extracting ECG feature signals according to the present invention;
FIG. 5 is a flowchart of an R-wave peak point detection algorithm according to an embodiment;
FIG. 6 is a block diagram of an ECG characteristic signal extracting terminal according to the present invention;
[ description of reference ]
1. An electrocardiogram characteristic signal extraction terminal; 2. a memory; 3. a processor.
Detailed Description
For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.
Referring to fig. 2 to 5, a method for extracting an electrocardiogram characteristic signal includes:
s1, acquiring an input electrocardiogram signal;
s2, carrying out filtering pretreatment on the electrocardiogram signals;
s3, amplifying the electrocardiogram signal by using a square function, and processing the electrocardiogram signal by using a moving window integration algorithm;
s4, detecting the electrocardiogram signals in sequence by using a characteristic point detection algorithm, wherein the type of the characteristic point detection algorithm comprises an R wave peak value point detection algorithm, a P wave peak value point detection algorithm, a T wave peak value point detection algorithm, an S wave trough value point detection algorithm and a Q wave trough value point detection algorithm;
in the process of detecting the electrocardiogram signals, a threshold self-adaptive algorithm is used according to the type of the characteristic point detection algorithm to obtain a self-adaptive threshold corresponding to the type, whether the electrocardiogram signals meet the preset detection conditions of the characteristic point detection algorithm or not is judged, the preset detection conditions comprise the detection conditions of whether the characteristic points meet the self-adaptive threshold or not, and the electrocardiogram signals meeting the preset detection conditions are used as characteristic point peak values/characteristic point valley values and stored.
From the above description, the beneficial effects of the present invention are: after filtering and amplifying the electrocardiogram signal, whether the electrocardiogram signal meets the preset detection condition can be judged based on the adaptive threshold algorithm and the characteristic point detection algorithm, so that the determined electrocardiogram signal can be used as the peak value/valley value of the characteristic point and stored. Therefore, the invention can accurately and completely detect the characteristic data of the electrocardiogram signal, provides a basis for further analyzing and researching the relationship between the heart beat and the electrocardiogram and provides a data basis for simulating the heart beat driven by the characteristic data.
Further, the S2 includes:
processing the electrocardiogram signal by a band-pass filter, and then performing differential filtering processing on the electrocardiogram signal to obtain the change condition of the electrocardiogram signal in each waveform stage, wherein the formula of the differential filtering processing is as follows:
wherein x is an original electrocardiogram signal, n is a serial number of the original electrocardiogram signal x, and y (n) represents an electrocardiogram signal obtained after the original electrocardiogram signal is filtered.
From the above description, the band-pass filter is used to reduce the influence of muscle noise, 60Hz interference, baseline wander, T-wave interference, etc. of the electrocardiogram signal, and the variation of the electrocardiogram signal at each waveform stage can be obtained by breeze filtering, so as to ensure the reliability of the subsequent detection calculation.
Further, the amplifying the electrocardiogram signal using a square function in S3 includes:
performing point-by-point square processing on the electrocardiogram signals obtained after filtering by using a square function, wherein the square function formula is as follows:
y(n)=[x(n)] 2
wherein x is the electrocardiogram signal obtained after filtering, n is the serial number of the electrocardiogram signal obtained after filtering, and y (n) represents the electrocardiogram signal after amplifying;
the processing of the electrocardiogram signal by using the moving window integration algorithm in the S3 is calculated by the following formula:
where N is the number of samples in the integration window, x represents the amplified electrocardiogram signal, and y (N) represents the processed electrocardiogram signal.
From the above description, it can be known that, after performing point-by-point square processing on the electrocardiogram signals obtained after filtering by using a square function, it can be ensured that the values of the data points of all the electrocardiogram signals are positive and amplified, so that the feature points in the electrocardiogram are more obvious, and the subsequent detection and calculation of the feature points in the electrocardiogram are facilitated. And the purpose of the moving window integration algorithm is to obtain the slope of the R-wave and its corresponding waveform characteristic information.
Further, the S4 includes:
s41, R wave peak point detection:
the threshold self-adaptive algorithm comprises an R wave threshold algorithm, and the R wave threshold obtained by the R wave threshold algorithm is as follows: half of the average value of the maximum peak value of each integration window in the electrocardiogram, and the formula of the R wave threshold algorithm is as follows:
wherein x (k) is a processed electrocardiogram signal sample, i is a current window in the m window samples, k represents a sampling example of the electrocardiogram signal, and th is a calculated R wave threshold;
then, the electrocardiogram signal samples which are larger than the R-wave threshold value one by one and satisfy simultaneously that the electrocardiogram signal samples are larger than the previous electrocardiogram signal sample and the next electrocardiogram signal sample are determined as R-wave peak points, and the specific calculation formula is as follows:
further, after S41, the method further includes:
s42, the number of the R wave peak points is i, the distance between the adjacent R wave peak points is called as RR wave peak point interval, and the calculation formula of the average RR wave peak point interval is as follows:
wherein f is s Is the sampling frequency of the signal and r is the heart beat frequency. From the above description, if the difference between the collected RR peak point interval and the average RR peak point interval is large, it can be determined as arrhythmia, and it is used as the basis for pathological research. And the calculation of the beating frequency of the heart can be used as the judgment standard of the health condition of the heart.
Further, the P-wave peak point detection algorithm includes: acquiring an electrocardiogram signal of the maximum peak value on the left side of an R wave peak value point in an electrocardiogram, wherein the electrocardiogram signal meets the condition that the peak value is less than th, and determining the electrocardiogram signal as a P wave peak value point;
the T wave peak point detection algorithm comprises the following steps: acquiring an electrocardiogram signal of the maximum peak value on the right side of an R wave peak value point in an electrocardiogram, wherein the electrocardiogram signal meets the condition that the peak value is less than th, and determining the electrocardiogram signal as a T wave peak value point;
and further comprising the following steps of checking the determined P wave peak point and T wave peak point:
judging whether the distance between the R wave peak point and the adjacent P wave peak point and the distance between the adjacent T wave peak point do not exceed 30% of the RR wave peak value interval, if so, adding the values of all the P wave peak points and the values of all the T wave peak points to obtain an average value, and checking whether the difference between the values of the P wave peak points and the T wave peak points and the average value is within a preset range one by one;
if so, indicating that the P wave peak point/T wave peak point passes the detection;
and if not, marking the P wave peak value point/T wave peak value point.
From the above description, the P peak value point and the T peak value can be determined and detected, and the accuracy of feature point acquisition is ensured.
Further, the threshold adaptive algorithm comprises an S-wave threshold algorithm, the S-wave threshold obtained by the S-wave threshold algorithm is half of the minimum trough value in the electrocardiogram, and the formula of the S-wave threshold algorithm is as follows:
wherein x (k) is a processed electrocardiogram signal sample, i is a current window in the m window samples, k represents a sampling example of the electrocardiogram signal, and minth is a calculated S-wave threshold; then the electrocardiogram signal samples which are smaller than the S-wave threshold and simultaneously satisfy that the electrocardiogram signal samples which are smaller than the previous electrocardiogram signal sample and the next electrocardiogram signal sample are S-wave valley points, and the specific calculation formula is as follows:
further, the Q-wave peak point detection includes:
then the electrocardiogram signal samples which are greater than the S-wave threshold and satisfy the condition that the electrocardiogram signal samples which are less than the previous electrocardiogram signal sample and the next electrocardiogram signal sample are Q trough value points, and the specific formula is as follows:
wherein x (k) is a processed electrocardiogram signal sample, and k represents a sampling example of the electrocardiogram signal;
further comprising the following steps of checking the determined Q trough value points:
adding all the values of the Q trough value points to obtain an average value, and checking whether the difference between the values of the Q trough value points and the average value is within a preset range one by one;
if yes, the Q wave trough point passes the detection;
and if not, marking the Q trough value point.
Referring to fig. 6, an ecg characteristic signal extracting terminal includes a memory, a processor and a computer program stored in the memory and running on the processor, and the processor executes the computer program to implement the ecg characteristic signal extracting method.
Example one
Referring to fig. 2 to 5, a method for extracting an electrocardiogram characteristic signal includes:
s1, acquiring an input electrocardiogram signal;
the invention takes an international general standard 12-lead mode to obtain an input normal electrocardiogram waveform as an example, an electrocardiogram signal is required to be a raw format signal, the electrocardiogram signal is a horizontal scanning signal which is stored by taking time as a sequence and is embodied as a continuous waveform on a time axis, and if the electrocardiogram signal is not in the format, format conversion is required.
S2, filtering preprocessing is carried out on the electrocardiogram signals, the initial electrocardiogram signals often contain noise, and if the noise is not filtered, the detection of subsequent characteristic points is greatly influenced. The filtering process comprises band-pass filtering and differential filtering, and comprises the following steps:
processing the electrocardiogram signals through a band-pass filter, and reducing the influence of muscle noise, 60Hz interference, baseline drift, T wave interference and the like by using the band-pass filter;
and then carrying out differential filtering processing on the electrocardiogram signals to obtain the change condition of the electrocardiogram signals in each waveform stage, wherein the differential filtering processing is completed by using a five-point derivative transfer function, and the formula is as follows:
wherein x is an original electrocardiogram signal, n is a serial number of the original electrocardiogram signal x, and y (n) represents an electrocardiogram signal obtained after the original electrocardiogram signal is filtered. The frequency response of this derivative is almost linear between dc and 30Hz, that is to say it approximates the ideal derivative in this range.
S3, amplifying the electrocardiogram signal by using a square function, and processing the electrocardiogram signal by using a moving window integration algorithm;
wherein the amplifying the electrocardiogram signal using a square function in S3 comprises:
performing point-by-point square processing on the electrocardiogram signals obtained after filtering by using a square function, wherein the square function formula is as follows:
y(n)=[x(n)] 2
wherein x is the filtered electrocardiogram signal, n is the serial number of the filtered electrocardiogram signal, and y (n) represents the amplified electrocardiogram signal, so that all the electrocardiogram signal data are positive, and the data output after the differential processing are nonlinearly amplified to enhance the influence on the frequency of the higher electrocardiogram signal, i.e. to enhance the influence on the R-wave peak point in the central electrocardiogram signal;
in S3, the moving window integration algorithm is used to process the electrocardiogram signal, so as to obtain the slope of the R wave and the corresponding waveform feature information, and the following formula is used to calculate:
where N is the number of samples in the integration window, x represents the amplified electrocardiogram signal, and y (N) represents the processed electrocardiogram signal. At this stage of the process, the number of samples plays a very large role. In general, the width of the window should be approximately the same as the QRS complex as wide as possible. If the integration window is too wide, the waveform may confuse the QRS wave with the T wave; if too narrow, it is possible that some QRS complexes produce multiple peaks in the waveform. This can be a significant nuisance for the subsequent QRS detection process. The width of the window is generally determined by the experience of the setter and may be adjusted. For a sampling strategy with a sampling frequency of 200Hz, the window has a sampling width of 30 samples of electrocardiogram signals, typically 150ms.
S4, detecting the electrocardiogram signals in sequence by using a characteristic point detection algorithm, wherein the type of the characteristic point detection algorithm comprises an R wave peak value point detection algorithm, a P wave peak value point detection algorithm, a T wave peak value point detection algorithm, an S wave trough value point detection algorithm and a Q wave trough value point detection algorithm;
in the process of detecting the electrocardiogram signals, a threshold self-adaptive algorithm is used according to the type of the characteristic point detection algorithm to obtain a self-adaptive threshold corresponding to the type, whether the electrocardiogram signals meet the preset detection conditions of the characteristic point detection algorithm or not is judged, the preset detection conditions comprise the detection conditions of whether the characteristic points meet the self-adaptive threshold or not, and the electrocardiogram signals meeting the preset detection conditions are used as characteristic point peak values/characteristic point valley values and stored.
Wherein the S4 comprises:
s41, R wave peak point detection:
the threshold self-adaptive algorithm comprises an R wave threshold algorithm, and the R wave threshold obtained by the R wave threshold algorithm is as follows: half of the average value of the maximum peak value of each integration window in the electrocardiogram, and the formula of the R wave threshold algorithm is as follows:
wherein x (k) is a processed electrocardiogram signal sample, i is a current window in m window samples, k represents a sampling example of the electrocardiogram signal, and th is a calculated R-wave threshold;
then, the electrocardiogram signal samples which are greater than the R-wave threshold value one by one and satisfy the requirement of being greater than the previous electrocardiogram signal sample and the next electrocardiogram signal sample at the same time are determined as R-wave peak points, and the specific calculation formula is as follows:
specifically, as shown in fig. 5, in the process of sequentially comparing and detecting the electrocardiograph signal samples to determine the R-peak point, a counter d =0ms is initialized, and 1 is sequentially added to determine whether the condition of the above formula is satisfied, if the current x (d) does not satisfy the above formula, the counter d is added by 1, and then the above calculation formula is repeated to perform calculation, if the condition is satisfied, the current x (d) may be determined as the R-peak point, and the counter may be increased by 150ms (the value is merely an example, that is, a value close to the next R-peak point is taken, which may be adaptively set by a user), because the next R-peak does not appear in such a short time interval, which may minimize the possibility of R-peak detection error. When all the sample points pass the program, i.e. d is equal to or greater than the sample length of the electrocardiogram signal, the detection algorithm stops.
S42, the number of the R wave peak points is i, the distance between the adjacent R wave peak points is called as RR wave peak point interval, and the calculation formula of the average RR wave peak point interval is as follows:
wherein, f s Is the sampling frequency of the signal and r is the heart beat frequency. S43, P wave peak point detection and T wave peak point detection:
the P-wave peak point detection algorithm comprises the following steps: acquiring an electrocardiogram signal of the maximum peak value on the left side of an R wave peak value point in an electrocardiogram, wherein the electrocardiogram signal meets the condition that the peak value is less than th, and determining the electrocardiogram signal as a P wave peak value point;
the T wave peak point detection algorithm comprises the following steps: acquiring an electrocardiogram signal of the maximum peak value on the right side of an R wave peak value point in an electrocardiogram, wherein the electrocardiogram signal meets the condition that the peak value is less than th, and determining the electrocardiogram signal as a T wave peak value point;
and further comprising the following steps of checking the determined P wave peak point and T wave peak point:
judging whether the distance between the R wave peak point and the adjacent P wave peak point and the distance between the adjacent T wave peak point do not exceed 30% of the RR wave peak value interval, if so, adding the values of all the P wave peak points and the values of all the T wave peak points to obtain an average value, and checking whether the difference between the values of the P wave peak points and the T wave peak points and the average value is within a preset range one by one;
if so, indicating that the P wave peak point/T wave peak point passes the detection;
and if not, marking the P wave peak value point/T wave peak value point.
S44, detecting S trough value points:
the threshold self-adaptive algorithm comprises an S wave threshold algorithm, the S wave threshold obtained through the S wave threshold algorithm is half of the minimum trough value in the electrocardiogram, and the formula of the S wave threshold algorithm is as follows:
wherein x (k) is a processed electrocardiogram signal sample, i is a current window in the m window samples, k represents a sampling example of the electrocardiogram signal, and minth is a calculated S-wave threshold; then the electrocardiogram signal samples which are smaller than the S-wave threshold and simultaneously satisfy that the electrocardiogram signal samples which are smaller than the previous electrocardiogram signal sample and the next electrocardiogram signal sample are S-wave valley points, and the specific calculation formula is as follows:
s45, detecting a Q trough value point:
the Q wave peak point detection comprises:
then the electrocardiogram signal samples which are greater than the S-wave threshold and satisfy the condition that the electrocardiogram signal samples which are less than the former electrocardiogram signal sample and the latter electrocardiogram signal sample are Q trough point, the specific formula is as follows:
wherein x (k) is a processed electrocardiogram signal sample, and k represents a sampling example of the electrocardiogram signal;
further comprising the following steps of checking the determined Q trough value points:
adding all the values of the Q trough value points to obtain an average value, and checking whether the difference between the values of the Q trough value points and the average value is within a preset range one by one;
if so, indicating that the Q trough value point passes the detection;
and if not, marking the Q trough value point.
Example two
Referring to fig. 3, an ecg characteristic signal extracting terminal 1 includes a memory 2, a processor 3 and a computer program stored in the memory 2 and running on the processor 3, wherein the processor 3 implements the steps of the first embodiment when executing the computer program.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.
Claims (9)
1. An electrocardiogram characteristic signal extraction method is characterized by comprising the following steps:
s1, acquiring an input electrocardiogram signal;
s2, carrying out filtering pretreatment on the electrocardiogram signals;
s3, amplifying the electrocardiogram signal by using a square function, and processing the electrocardiogram signal by using a moving window integration algorithm;
s4, detecting the electrocardiogram signals in sequence by using a characteristic point detection algorithm, wherein the type of the characteristic point detection algorithm comprises an R wave peak value point detection algorithm, a P wave peak value point detection algorithm, a T wave peak value point detection algorithm, an S wave trough value point detection algorithm and a Q wave trough value point detection algorithm;
in the process of detecting the electrocardiogram signals, a threshold self-adaptive algorithm is used according to the type of the characteristic point detection algorithm to obtain a self-adaptive threshold corresponding to the type, whether the electrocardiogram signals meet the preset detection conditions of the characteristic point detection algorithm or not is judged, the preset detection conditions comprise the detection conditions of whether the characteristic points meet the self-adaptive threshold or not, and the electrocardiogram signals meeting the preset detection conditions are used as characteristic point peak values/characteristic point valley values and stored.
2. The method according to claim 1, wherein the S2 includes:
processing the electrocardiogram signal by a band-pass filter, and then performing differential filtering processing on the electrocardiogram signal to obtain the change condition of the electrocardiogram signal in each waveform stage, wherein the formula of the differential filtering processing is as follows:
wherein x is an original electrocardiogram signal, n is a serial number of the original electrocardiogram signal x, and y (n) represents an electrocardiogram signal obtained after the original electrocardiogram signal is filtered.
3. The method according to claim 2, wherein the amplifying the electrocardiogram signal using a square function in S3 comprises:
performing point-by-point square processing on the electrocardiogram signals obtained after filtering by using a square function, wherein the square function formula is as follows:
y(n)=[x(n)] 2
wherein x is the electrocardiogram signal obtained after filtering, n is the serial number of the electrocardiogram signal obtained after filtering, and y (n) represents the electrocardiogram signal after amplifying;
the processing of the electrocardiogram signal by using the moving window integration algorithm in the S3 is calculated by the following formula:
where N is the number of samples in the integration window, x represents the amplified electrocardiogram signal, and y (N) represents the processed electrocardiogram signal.
4. The method according to claim 3, wherein the S4 comprises:
s41, R wave peak point detection:
the threshold self-adaptive algorithm comprises an R wave threshold algorithm, and the R wave threshold obtained by the R wave threshold algorithm is as follows: half of the average value of the maximum peak value of each integration window in the electrocardiogram, and the formula of the R wave threshold algorithm is as follows:
wherein x (k) is a processed electrocardiogram signal sample, i is a current window in the m window samples, k represents a sampling example of the electrocardiogram signal, and th is a calculated R wave threshold;
then, the electrocardiogram signal samples which are larger than the R-wave threshold value one by one and satisfy simultaneously that the electrocardiogram signal samples are larger than the previous electrocardiogram signal sample and the next electrocardiogram signal sample are determined as R-wave peak points, and the specific calculation formula is as follows:
5. the method for extracting an electrocardiogram feature signal according to claim 4, further comprising, after S41:
s42, the number of the R wave peak points is i, the distance between the adjacent R wave peak points is called as RR wave peak point interval, and the calculation formula of the average RR wave peak point interval is as follows:
wherein f is s Is the sampling frequency of the signal and r is the heart beat frequency.
6. The method of extracting an ECG characteristic signal according to claim 5, wherein the P-wave peak point detection algorithm comprises: acquiring an electrocardiogram signal of the maximum peak value on the left side of an R wave peak value point in an electrocardiogram, wherein the electrocardiogram signal meets the condition that the peak value is less than th, and determining the electrocardiogram signal as a P wave peak value point;
the T wave peak point detection algorithm comprises the following steps: acquiring an electrocardiogram signal of the maximum peak value on the right side of an R wave peak value point in an electrocardiogram, wherein the electrocardiogram signal meets the condition that the peak value is less than th, and determining the electrocardiogram signal as a T wave peak value point;
and further comprising the following steps of checking the determined P wave peak point and T wave peak point:
judging whether the distance between the R wave peak point and the adjacent P wave peak point and the distance between the adjacent T wave peak point do not exceed 30% of the RR wave peak value interval, if so, adding the values of all the P wave peak points and the values of all the T wave peak points to obtain an average value, and checking whether the difference between the values of the P wave peak points and the T wave peak points and the average value is within a preset range one by one;
if so, indicating that the P wave peak point/T wave peak point passes the detection;
and if not, marking the P wave peak value point/T wave peak value point.
7. The method for extracting electrocardiogram feature signals according to claim 4, wherein the threshold adaptive algorithm comprises an S-wave threshold algorithm, the S-wave threshold obtained by the S-wave threshold algorithm is half of the minimum trough value in electrocardiogram, and the formula of the S-wave threshold algorithm is as follows:
wherein x (k) is a processed electrocardiogram signal sample, i is a current window in the m window samples, k represents a sampling example of the electrocardiogram signal, and minth is a calculated S-wave threshold;
then the electrocardiogram signal samples which are smaller than the S-wave threshold and simultaneously satisfy that the electrocardiogram signal samples which are smaller than the previous electrocardiogram signal sample and the next electrocardiogram signal sample are S-wave valley points, and the specific calculation formula is as follows:
8. the electrocardiogram feature signal extracting method according to claim 7, wherein the Q-wave peak point detection comprises:
then the electrocardiogram signal samples which are greater than the S-wave threshold and satisfy the condition that the electrocardiogram signal samples which are less than the former electrocardiogram signal sample and the latter electrocardiogram signal sample are Q trough point, the specific formula is as follows:
wherein x (k) is a processed electrocardiogram signal sample, and k represents a sampling example of the electrocardiogram signal;
further comprising the following steps of checking the determined Q trough value points:
adding all the values of the Q trough value points to obtain an average value, and checking whether the difference between the values of the Q trough value points and the average value is within a preset range one by one;
if so, indicating that the Q trough value point passes the detection;
and if not, marking the Q trough value point.
9. An ecg characteristic signal extracting terminal, comprising a memory, a processor and a computer program stored in the memory and operable on the processor, wherein the processor implements the ecg characteristic signal extracting method according to any one of claims 1 to 8 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211013188.4A CN115828056A (en) | 2022-08-23 | 2022-08-23 | Electrocardiogram characteristic signal extraction method and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211013188.4A CN115828056A (en) | 2022-08-23 | 2022-08-23 | Electrocardiogram characteristic signal extraction method and terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115828056A true CN115828056A (en) | 2023-03-21 |
Family
ID=85523173
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211013188.4A Pending CN115828056A (en) | 2022-08-23 | 2022-08-23 | Electrocardiogram characteristic signal extraction method and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115828056A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116687418A (en) * | 2023-08-08 | 2023-09-05 | 深圳市爱保护科技有限公司 | Electrocardiogram detection method, device, equipment and storage medium |
CN118044821A (en) * | 2024-02-19 | 2024-05-17 | 北京信心相联科技有限公司 | Multi-lead electrocardiograph data classification method, device and equipment |
-
2022
- 2022-08-23 CN CN202211013188.4A patent/CN115828056A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116687418A (en) * | 2023-08-08 | 2023-09-05 | 深圳市爱保护科技有限公司 | Electrocardiogram detection method, device, equipment and storage medium |
CN116687418B (en) * | 2023-08-08 | 2023-10-20 | 深圳市爱保护科技有限公司 | Electrocardiogram detection method, device, equipment and storage medium |
CN118044821A (en) * | 2024-02-19 | 2024-05-17 | 北京信心相联科技有限公司 | Multi-lead electrocardiograph data classification method, device and equipment |
CN118044821B (en) * | 2024-02-19 | 2024-10-11 | 北京信心相联科技有限公司 | Multi-lead electrocardiograph data classification method, device and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12268527B2 (en) | System and method for automated analysis and detection of cardiac arrhythmias from electrocardiograms | |
Sivaraks et al. | Robust and accurate anomaly detection in ECG artifacts using time series motif discovery | |
Lourenço et al. | Real time electrocardiogram segmentation for finger based ECG biometrics | |
CN101828917B (en) | Method and system for extracting electrocardiosignal characteristic | |
CN109770860B (en) | Electrocardiosignal processing device and electrocardio equipment | |
JPH11313806A (en) | Method of determining characteristic of signal indicating function of heart | |
CN112603325A (en) | Electrocardio abnormity discrimination system and method based on morphological filtering and wavelet threshold | |
CN115828056A (en) | Electrocardiogram characteristic signal extraction method and terminal | |
CN113499079A (en) | Atrial fibrillation detection method in electrocardiogram | |
Vondrak et al. | Selected transformation methods and their comparison for VCG leads deriving | |
Gupta et al. | R-peak based arrhythmia detection using hilbert transform and principal component analysis | |
Hegde et al. | A review on ECG signal processing and HRV analysis | |
CN110367973B (en) | Method for detecting initial point of QRS wave group of multi-lead electrocardiosignal | |
Jindal et al. | MATLAB based GUI for ECG arrhythmia detection using Pan-Tompkin algorithm | |
Mayapur | Detection and Processing of the R Peak | |
Liu et al. | Automatic Arrhythmia Detection Based on Convolutional Neural Networks. | |
Augustyniak | A robust heartbeat detector not depending on ECG sampling rate | |
Chieng et al. | An efficient instantaneous ECG delineation algorithm | |
Arvinti et al. | Effective wavelet algorithm for an automatic detection of atrial fibrillation | |
Deng et al. | Electrocardiographic criteria for the diagnosis of left ventricular hypertrophy based on data mining | |
Mayapur | Detection and classification of heart defects | |
Bagheri et al. | Accurate Methods for Automatic Detection of Characteristic Points in Electrocardiograms | |
Kavya et al. | Abnormality diagnosis in ECG signal using Daubechies wavelet | |
Rizzi et al. | Fast parallelized algorithm for ECG analysis | |
Padhy et al. | Synthesis of 12-lead ECG from a reduced lead set using singular value decomposition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |