CN108836305B - A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation - Google Patents

A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation Download PDF

Info

Publication number
CN108836305B
CN108836305B CN201810429640.2A CN201810429640A CN108836305B CN 108836305 B CN108836305 B CN 108836305B CN 201810429640 A CN201810429640 A CN 201810429640A CN 108836305 B CN108836305 B CN 108836305B
Authority
CN
China
Prior art keywords
wave
ecg
waves
signal
jumping
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.)
Active
Application number
CN201810429640.2A
Other languages
Chinese (zh)
Other versions
CN108836305A (en
Inventor
郭树理
韩丽娜
陈启明
桂心哲
张祎彤
张禾
刘宏斌
范利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chinese PLA General Hospital
Beijing Institute of Technology BIT
Original Assignee
Chinese PLA General Hospital
Beijing Institute of Technology BIT
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chinese PLA General Hospital, Beijing Institute of Technology BIT filed Critical Chinese PLA General Hospital
Priority to CN201810429640.2A priority Critical patent/CN108836305B/en
Publication of CN108836305A publication Critical patent/CN108836305A/en
Application granted granted Critical
Publication of CN108836305B publication Critical patent/CN108836305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7225Details of analog processing, e.g. isolation amplifier, gain or sensitivity adjustment, filtering, baseline or drift compensation
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/725Details of waveform analysis using specific filters therefor, e.g. Kalman or adaptive filters

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • Veterinary Medicine (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Public Health (AREA)
  • Biophysics (AREA)
  • Pathology (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Physiology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Psychiatry (AREA)
  • Power Engineering (AREA)
  • Cardiology (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation, belongs to Medical computer technology field.Core concept are as follows: denoising has been carried out to original ECG signal Hz noise;The mode for using curve matching simultaneously, goes baseline drift;After getting more accurate ECG signal, Q wave, R wave and S wave are positioned respectively respectively using the method for difference threshold algorithm and wavelet transformation, with the information comparison of expert's mark, threshold value, scale and translational movement parameter are adjusted separately, optimal positioning result is obtained.Based on the above results, for Q wave, R wave and S wave, chooses differential threshold respectively or small wave converting method is positioned.The present invention can carry out more accurate denoising to original ECG signal and provide basis further, it is possible to realize the accurate positioning of QRS wave for the digital assay of electrocardiogram.

Description

ECG (electrocardiogram) feature extraction method fusing Butterworth filtering and wavelet transformation
Technical Field
The invention relates to a method for extracting electrocardiosignal features, in particular to an ECG feature extraction method fusing Butterworth filtering and wavelet transformation, and belongs to the technical field of medical computers.
Background
The high morbidity and mortality associated with cardiovascular disease has long severely threatened human health and life. The World Health Organization (WHO) estimates that 3600 million people die of non-infectious diseases such as cardiovascular diseases, diabetes, respiratory diseases and malignant tumors every year in the world at present, and account for 2/3 of the total number of deaths in the world, and the number of the deaths is increased to 4400 ten thousand by 2020.
Chinese cardiovascular disease reports (2015) show that the mortality rate of Chinese cardiovascular disease is still the first of death in 2014, and is higher than that of tumors and other diseases. The mortality rate of cardiovascular diseases in rural areas in 2014 is 295.63/10 ten thousand, the mortality rate of heart diseases is 143.72/10 ten thousand, and the mortality rate of cerebrovascular diseases is 151.91/10 ten thousand (cerebral hemorrhage 74.51/10 ten thousand, cerebral infarction 45.30/10 ten thousand); the urban cardiovascular disease mortality is 261.99/10 ten thousand, the central disease mortality is 136.21/10 ten thousand, and the cerebrovascular disease mortality is 125.78/10 ten thousand (cerebral hemorrhage 52.25/10 ten thousand, cerebral infarction 41.99/10 ten thousand). With the acceleration of the aging step of the Chinese society, the data are rapidly increased, and the cardiovascular diseases become one of the major public health problems in China. Therefore, the prevention, diagnosis and treatment of heart diseases are particularly important and are a great challenge and research hotspot for medical personnel today.
The Electrocardiogram (ECG) examination records the current generated by myocytes in the contraction and relaxation process of each also dynamic cycle through electrodes placed on different parts of the human body surface, simultaneously records the change trend of the current along with the direction and strength of the dynamic cycle and traces the change curve of the Electrocardiogram in real time so as to judge the condition of the electrical activity of the heart, judge whether the myocytes die, have ischemia and have impulse conduction abnormity, and record the change of the characteristic Electrocardiogram with clinical significance. In addition, the electrocardiogram of certain electrolyte-disturbed diseases is also characteristically altered. For example, T-wave apex and QT interval can be shortened in hyperkalemia, ST segment can be prolonged in reduction of blood calcium, and the like; the extraction of features of ECG signals is of great significance for clinical studies.
However, in the detection process of the electrocardiosignal, the influence of factors such as power frequency interference, environmental noise and the like exists, and the precision in measurement is influenced. At present, the accuracy and reliability of the intelligent analysis of the electrocardiogram cannot be compared with the analysis of cardiologists, so the proportion of the electrocardiogram in the actual clinical application is not large.
Disclosure of Invention
The invention aims to further improve the acquisition accuracy of the conventional electrocardiosignals and the accurate detection of each QRS wave band, and provides an ECG feature extraction method integrating Butterworth filtering and wavelet transformation.
The core idea of the invention is as follows: carrying out denoising processing on the power frequency interference of the original ECG signal; simultaneously, baseline drift is removed by using a curve fitting mode; after obtaining more accurate ECG signals, respectively positioning Q waves, R waves and S waves by using a differential threshold value method and a wavelet transformation method, comparing the positioning Q waves, the R waves and the S waves with information labeled by experts, and respectively adjusting parameters of a threshold value, a scale and a translation quantity to obtain an optimal positioning result.
An ECG feature extraction method fusing Butterworth filtering and wavelet transformation comprises the following steps:
step A, carrying out spectrum analysis on the original ECG signal to obtain the highest frequency and the lowest frequency, and then carrying out filtering processing on the original ECG signal by using a Butterworth filter to obtain the filtered ECG1A signal; step a further comprises the following substeps:
SA.1 analyzing the spectrum of the ECG signal by using the discrete Fourier transform method according to formula (1) to obtain the spectrum X (e) of the ECG signal) Further, the maximum frequency f of the ECG signal is obtained1And the lowest frequency f of the frequency bands of power frequency interference and other noise interference2
Wherein, X (e)) Is the frequency spectrum of the ECG signal, ω is the frequency of the ECG signal, and ECG (n) is the nth amplitude of the ECG signal;
in the obtained X (e)) The highest frequency of the middle and low frequency bands, i.e. the highest frequency f of the ECG signal1(ii) a The lowest frequency of the high frequency band is the lowest frequency f of the frequency band of power frequency interference and other noise interference2
SA.2 filtering the ECG signal with a Butterworth filter to obtain a filtered ECG signal1Specifically, butterworth filtering is performed by equation (2):
wherein, in the formula (2)N represents an integer set, | H (ω) | is a mode of the Butterworth filter, | H (ω) | does not count2Is the square of the mode; omegac(2πf1<ωc<2πf2) P (p ∈ N) is the order, which is the cut-off frequency of the Butterworth filter;
step B, ECG outputted from step A1Performing curve fitting, calculating polynomial coefficient and removing baseline drift to obtain signal after removing baseline drift, ECG2
Step B again comprises the following substeps:
sb.1 curve fitting is performed based on equation (3):
where y is the polynomial to be fitted, the order of the polynomial q (q e N), a0,a1,...,apIs the coefficient of a polynomial of order q, x being the sampling time series, xiIs the ith power of x;
SB.2, based on the formula (4), calculating polynomial coefficients in the formula (3);
wherein,is a vector composed of polynomial coefficients,as amplitude vector of ECG signal, C ═ 1 x x2 ... xq]T,CTIs the transposition of C;
SB.3 obtaining the signal after baseline drift removal based on the formula (5);
ECG2=ECG1-y (5)
in equation (5), ECG2For removing the post-baseline-shift signal, ECG1Is a filtered signal; y is the output of equation (3);
step C, ECG output from step B2The signal uses a differential threshold method to position R waves, then position Q waves and S waves, and respectively output the positions of the R waves, the Q waves and the S waves;
step C in turn comprises the following substeps:
SC.1 sequentially calculates ECG based on equation (6) and equation (7)2A first order difference S (n) and a second order difference W (n) of the signals;
S(n)=ECG2(n)-ECG2(n-1) (6)
W(n)=S(n)-S(n-1) (7)
where S (n) is the nth first order difference, ECG2(n) is ECG2Nth amplitude of signal, ECG2(n-1) is ECG2The nth-1 amplitude of the signal, W (n) is the nth second order difference, and S (n-1) is the nth-1 first order difference;
SC.2 determines the maximum value max of S (n) output in step SC.1 by using an enumeration method1And maximum value max of W (n)2
SC.3 sets a threshold Y based on formula (8)1
Y1=m1·max1(0<m1<1) (8)
In equation (8), the threshold is Y1,m1Is an artificially set coefficient, and the range is (0, 1);
SC.4 judges whether there is a continuous k in S (n)1(k1E N) points exceeding Y1And ECG2(n) > 0, and according to the judgment result, the following operations are carried out:
SC.4A if there are consecutive k in S (n)1(k1E N) points exceeding Y1And ECG2(n) > 0, the point n is the R wave crest in the range, the position is R, and the jump is carried out to SC.5;
wherein k is1Is an integer of 2 or more;
SC.4B if there is no consecutive k in S (n)1(k1E N) points exceeding Y1Then k is1=k1-1, jump to step sc.4;
SC.5 sets the threshold value Y of the starting point based on the equations (9) and (10)2And an endpoint threshold Y3
Y2=m2·max2(0<m2<1) (9)
Y3=m3·max2(0<m3<1) (10)
In the formulas (9) and (10), the threshold values are Y2,Y3,m2,m3Is a coefficient set artificially;
SC.6 searches forward from each R wave to judge whether there is a continuous k in W (n)2(k2E is N) points less than Y2And according to the judgment result, the following operations are carried out:
SC.6A if W (n) has consecutive k2(k2E is N) points less than Y2The point n is the starting point s of the QRS wave with the range, and the jump is made to sc.5;
wherein k is2Is an integer of 2 or more;
SC.6B if there is no consecutive k in W (n)2(k2E is N) points less than Y2Then k is2=k2-1, jump to step sc.6;
SC.7 searches backward from each R wave to determine whether there are consecutive k in W (n)3(k3E is N) points less than Y3And according to the judgment resultThe fruit is subjected to the following operations:
wherein k is3Is an integer of 2 or more;
SC.7A if W (n) has consecutive k3(k3E is N) points less than Y3The point n is the end point e of the QRS wave with the point in the range, and the jump is carried out to SD.8;
SC.7B if there are no consecutive k in W (n)3(k3E is N) points less than Y3Then k is3=k3-1, jump to step sc.7;
sc.8 searches for an amplitude minimum value point Q in the range of the origin S of Q-wave, R-wave, and S-wave and the R-position where the R-wave is located, based on equation (11):
Q=min(ECG2(n)),(s<n<r) (11)
in formula (11), min (ECG)2(n)) is a search ECG2(n) a function of minima;
based on equation (12), an amplitude minimum value point S is searched for in the range of the R wave and the end point e:
S=min(ECG2(n)),(r<n<e) (12)
SC.9 compares the positions of the R wave, the Q wave and the S wave determined in the steps SC.4 and SC.8 with the positions marked by the experts, and based on the formula (13), the detection accuracy p of the R wave, the Q wave and the S wave is respectively obtained11,p12,p13
In the formula (13), the value of i is 1, 2, 3, N11,N12,N13The number of R wave, Q wave and S wave in ECG signal, N11 *,N12 *,N13 *Respectively detecting the number of correct R waves, Q waves and S waves;
step D, processing the ECG processed in the step B2The signal uses wavelet transform method to get wavelet decomposition pictures of different levels, then outputs Q, R, S wave position by detecting position and amplitude of wavelet transform coefficient modulus maximum; step D comprises the following steps:
SD.1 based on formulas (14) and (15), performing wavelet transformation on the ECG signal by using dual-orthogonal spline wavelets to obtain wavelet decomposition views under different levels;
wherein x is0(n)=ECG2(n), i.e. the processed ECG signal; z is a natural number set (the same below); x is the number of(j)(n) is xj-1(n) a dyadic wavelet transform of the high band signal on the j scale, d(j)(n) is xj-1(n) a dyadic wavelet transform of the low band signal on the j scale, hj-1(k),gj-1(k) A set kth set of orthogonal digital low pass filter and high pass filter coefficients, respectively;
SD.2, based on wavelet decomposition diagrams under different scales obtained by SD.1, detecting a maximum value point M and a minimum value point L of the amplitude for the waveform under the scale of c (c belongs to N); detecting a point with an amplitude value p (p is less than epsilon) between two points, wherein epsilon is a numerical value with the amplitude value approaching zero, and p is the position of an R wave of the original ECG signal;
SD.3 searches the mode minimum value of the R wave front position based on the R wave position p obtained by SD.2 and the waveform of b (b belongs to N) scale of formula (16), namely Q wave,
Q=x(b)(n)<x(b)(n-1),x(b)(n)<x(b)(n+1),(n<p) (16)
wherein x is(b)(n) is the amplitude of the nth sequence of the ECG signal on the b scale;
searching the mode minimum value of the position after the R wave, namely the S wave,
S=x(b)(n)<x(b)(n-1),x(b)(n)<x(b)(n+1),(n>p) (17)
wherein x is(b)(n) is the amplitude of the nth sequence of the ECG signal on the b scale;
SD.4 compares the positions of the R wave, the Q wave and the S wave detected in the steps SD.2 and SD.3 with the positions marked by experts, and respectively obtains the detection accuracy p of the R wave, the Q wave and the S wave based on a formula (18)21,p22,p23
In the formula (18), the value of i is 1, 2, 3, N21,N22,N23The number of R wave, Q wave and S wave in ECG signal, N21 *,N22 *,N23 *Respectively detecting the number of correct R waves, Q waves and S waves;
wherein, the step D and the step C can also exchange the sequence;
e, repeatedly adjusting artificially set parameters of a difference threshold method through R waves, Q waves and S waves labeled by experts, and repeatedly adjusting a wavelet transform hierarchy until accuracy is converged; step E also comprises the following steps:
SE.1 adjusting m based on R-, Q-and S-waves obtained in step C, respectively, and by repeated comparison with expert-labeled points1,m2,m3Respectively determining whether to jump to the step C, specifically:
SE.1A based on the R wave obtained in step C, and by repeating the process withComparing the R waves marked by the experts, and judging whether the accuracy is p11Increasing, then adjusting m1Jumping to step C; if accuracy p11If not, jumping to the step SE.1B;
step se.1b, based on the Q-wave obtained in step C, compares with the Q-wave labeled by the expert repeatedly,
if accuracy p12Increasing, then adjusting m2Jumping to step C; if accuracy p12If not, jumping to the step SE.1C;
step se.1c, based on the S-wave obtained in step C, compares with the S-wave labeled by the expert repeatedly,
if accuracy p13Increasing, then adjusting m3Jumping to step C; if accuracy p13If not, jumping to the step SE.2;
and SE.2, respectively based on the R wave, the Q wave and the S wave obtained in the step D and the points marked by the experts through repeated comparison, adjusting the values of b and c, and respectively determining whether to jump to the step D, wherein the specific steps are as follows:
SE.2A based on the R wave obtained in step D, compare with the R wave labeled by the expert through repetition, if the accuracy p21If yes, adjusting the value of b, and jumping to the step D; if accuracy p21If not, jumping to step SE.2B;
step se.2b is based on the Q-wave, S-wave obtained in step D, compared with the Q-wave and S-wave labeled by experts by iteration,
if accuracy p22、p23If the values are all increased, adjusting the value of c, and jumping to the step D; if accuracy p22、p23If at least one is not increased, jump to step F.
Step F, respectively comparing the detection accuracy of the step C and the detection accuracy of the step D, and selecting a detection method with high accuracy aiming at the R wave, the Q wave and the S wave, wherein the step F comprises the following steps:
SF.1 comparison of p11And p21If p is the size of11≥p21Jumping to the step C to extract R wave, if p11<p21Jumping to the step D, and extracting R waves;
SF.2 comparison of p12And p22If p is the size of12≥p22Jumping to step C, extracting Q wave, if p12<p22Jumping to the step D, and extracting the Q wave;
SF.3 comparison of p13And p23If p is the size of13≥p23Jumping to step C, extracting S wave, if p13<p23And D, jumping to the step D to extract the S wave, and ending the method.
Advantageous effects
Compared with the prior art, the ECG feature extraction method fusing Butterworth filtering and wavelet transformation has the following beneficial effects: the method can perform more accurate denoising processing on the original ECG signal, can realize accurate positioning of QRS waves, and provides a basis for digital analysis of the electrocardiogram.
Drawings
Fig. 1 is a flow chart of extraction of Q-wave, R-wave, and S-wave of an ECG feature extraction method that combines butterworth filtering and wavelet transformation according to the present invention.
Detailed Description
The invention is described in detail below by way of example with reference to the accompanying drawings.
Example 1
The invention provides an ECG signal feature extraction method fusing Butterworth filtering and wavelet transformation, which is shown in figure 1. The method specifically comprises the following steps:
step 1, carrying out spectrum analysis on the original ECG signal to obtain the highest frequency and the lowest frequency, and then carrying out filtering processing on the original ECG signal by using a Butterworth filter to obtain the filtered ECG1A signal; step 1 comprises the following substeps:
s1.1 analyzing the spectrum of the ECG signal by using the discrete Fourier transform method according to equation (19) to obtain the highest and lowest frequencies, X (e), of the spectrum of the ECG signal):
Wherein, X (e)) Is the frequency spectrum of the ECG signal, ω is the frequency of the ECG signal, and ECG (n) is the nth amplitude of the ECG signal;
in the obtained X (e)) The highest frequency of the middle and low frequency bands, i.e. the highest frequency f of the ECG signal1(ii) a The lowest frequency of the high frequency band is the lowest frequency f of the frequency band of power frequency interference and other noise interference2
S1.2 filtering the ECG signal by a Butterworth filter to obtain a filtered ECG signal1Performing butterworth filtering based on equation (20);
wherein N in the formula (20) represents an integer set, | H (ω) | is a mode of the Butterworth filter, | H (ω) | does not include2Is the square of the mode; omegac2 pi × 50Hz is the cut-off frequency of the butterworth filter, and p 2 is the order;
step 2, ECG output to step SA.21Performing curve fitting, calculating polynomial coefficient and removing baseline driftShifting to obtain signal ECG after baseline drift removal2
Step 2 again comprises the following substeps:
s2.1, performing curve fitting based on a formula (21);
where y is a polynomial to fit, the order q of the polynomial being 3, a0,a1,a2,a3Is the coefficient of a polynomial of order q, x being the sampling time series, xiIs the ith power of x;
s2.2, based on the formula (22), calculating a polynomial coefficient in the formula (3);
wherein,is a vector composed of polynomial coefficients,as amplitude vector of ECG signal, C ═ 1 x x2 x3]T,CTIs the transposition of C;
s2.3, obtaining a signal after baseline drift is removed based on a formula (23);
ECG2=ECG1-y (23)
in equation (23), ECG2For removing the post-baseline-shift signal, ECG1Is a filtered signal; y is the output of equation (21);
step 3, ECG output from step 22Method for using differential threshold value for signalThe method comprises the steps of firstly positioning R waves, then positioning Q waves and S waves, and respectively outputting the positions of the R waves, the Q waves and the S waves;
step 3 comprises the following substeps:
s3.1 sequential calculation of ECG based on equation (24) and equation (25)2A first order difference S (n) and a second order difference W (n) of the signals;
S(n)=ECG2(n)-ECG2(n-1) (24)
W(n)=S(n)-S(n-1) (25)
where S (n) is the nth first order difference, ECG2(n) is ECG2Nth amplitude of signal, ECG2(n-1) is ECG2The nth-1 amplitude of the signal, W (n) is the nth second order difference, and S (n-1) is the nth-1 first order difference;
s3.2 determining the maximum value max of S (n) output in step S3.1 by using an enumeration method1And maximum value max of W (n)2
S3.3 setting a threshold Y based on equation (26)1
Y1=m1·max1(0<m1<1) (26)
In equation (26), the threshold is Y1,m1=0.7;
S3.4 judging whether there is continuous k in S (n)1(k1E N) points exceeding Y1And ECG2(n) > 0, and according to the judgment result, the following operations are carried out:
S3.4A if there are consecutive k in S (n)1(k1E N) points exceeding Y1And ECG2(n) > 0, the point n is the R wave crest in the range, the position is R, and the step is S3.5;
wherein k is1Is an integer of 2 or more;
S3.4B if there is no consecutive k in S (n)1(k1E N) points exceeding Y1Then k is1=k1-1, jump to step sc.4;
s3.5 setting a threshold Y for the starting point based on equations (27) and (28)2And an endpoint threshold Y3
Y2=m2·max2(0<m2<1) (27)
Y3=m3·max2(0<m3<1) (28)
In equations (27) and (28), the threshold values are Y2,Y3,m2=0.5,m3=0.6;
S3.6 searching forward from each R wave, judging whether there is continuous k in W (n)2(k2E is N) points less than Y2And according to the judgment result, the following operations are carried out:
S3.6A if there are consecutive k in W (n)25 points less than Y2The point n is the starting point S of the QRS wave in the range, and the jump is made to S3.5;
wherein k is2Is an integer of 2 or more;
S3.6B if there is no consecutive k in W (n)25 points less than Y2Then k is2=k2-1, jump to step S3.6;
s3.7 searching backward from each R wave, judging whether there is continuous k in W (n)35 points less than Y3And according to the judgment result, the following operations are carried out:
wherein k is3Is an integer of 2 or more;
S3.7A if there are consecutive k in W (n)35 points less than Y3The point n is the end point e of the QRS wave with the point in the range, and the jump is made to S4.8;
S3.7B if there is no consecutive k in W (n)35 points less than Y3Then k is3=k3-1, jump to step S3.7;
s3.8 based on formula (29), searching an amplitude minimum value point Q in the range of the starting points S of the Q wave, the R wave and the S wave and the R position of the R wave:
Q=min(ECG2(n)),(s<n<r) (29)
in formula (29), min (ECG)2(n)) is a search ECG2(n) a function of minima;
based on equation (30), search for the amplitude minimum point S within the range of R-wave and end point e:
S=min(ECG2(n)),(r<n<e) (30)
s3.9 comparing the positions of the R wave, the Q wave and the S wave determined in the step S3.4 and the step S3.8 with the positions marked by the experts, and respectively obtaining the detection accuracy p of the R wave, the Q wave and the S wave based on a formula (13)11,p12,p13
In the formula (31), i takes on values of 1, 2, 3, N11,N12,N13The number of R wave, Q wave and S wave in ECG signal, N11 *,N12 *,N13 *Respectively detecting the number of correct R waves, Q waves and S waves;
step 4, processing the ECG processed in the step 22The signal uses wavelet transform method to get wavelet decomposition pictures of different levels, then outputs Q, R, S wave position by detecting position and amplitude of wavelet transform coefficient modulus maximum; step 4 comprises the following steps:
s4.1, based on the formulas (32) and (33), performing wavelet transformation on the ECG signal by using a dual-orthogonal spline wavelet to obtain wavelet decomposition views under different levels;
wherein x is0(n)=ECG2(n), i.e. the processed ECG signal; z is a natural number set (the same below); x is the number of(j)(n) is xj-1(n) a dyadic wavelet transform of the high band signal on the j scale, d(j)(n) is xj-1(n) a dyadic wavelet transform of the low band signal on the j scale, hj-1(k),gj-1(k) A set kth set of orthogonal digital low pass filter and high pass filter coefficients, respectively;
s4.2, detecting an amplitude maximum value point M and a minimum value point L for the waveform under the 2-scale based on the wavelet decomposition images under the different scales obtained in the S4.1; detecting a point with amplitude p (p is less than 0.05) between the two points, wherein p is the position of the R wave of the original ECG signal;
s4.3, based on the R wave position p obtained in S4.2 and the waveform under the scale of 1 in the formula (34), searching the mode minimum value of the R wave front position, namely Q wave,
Q=x(b)(n)<x(b)(n-1),x(b)(n)<x(b)(n+1),(n<p) (34)
wherein x is(b)(n) is the amplitude of the nth sequence of the ECG signal at scale 1;
searching the mode minimum value of the position after the R wave, namely the S wave,
S=x(b)(n)<x(b)(n-1),x(b)(n)<x(b)(n+1),(n>p) (35)
wherein x is(b)(n) is the amplitude of the nth sequence of the ECG signal at scale 1;
s4.4 byThe positions of the R wave, the Q wave and the S wave detected in the step S4.2 and the step S4.3 are compared with the positions marked by the experts, and the detection accuracy p of the R wave, the Q wave and the S wave is respectively obtained based on a formula (36)21,p22,p23
In the formula (13), the value of i is 1, 2, 3, N21,N22,N23The number of R wave, Q wave and S wave in ECG signal, N21 *,N22 *,N23 *Respectively detecting the number of correct R waves, Q waves and S waves;
wherein, the sequence of the step 4 and the step 3 can be exchanged;
step 5, repeatedly adjusting artificially set parameters of a difference threshold method through R waves, Q waves and S waves labeled by experts, and repeatedly adjusting a wavelet transform hierarchy until accuracy is converged; step 5 comprises the following steps:
s5.1 adjusting m based on R wave, Q wave and S wave obtained in step 3 respectively and by repeated comparison with points marked by experts1,m2,m3Respectively determining whether to jump to the step 3, specifically:
S5.1A comparing the R wave obtained in step 3 with the R wave labeled by the expert repeatedly if the accuracy p is higher11Increasing, then adjusting m1Jumping to step 3; if accuracy p11If not, go to step S5.1B;
step S5.1B compares the Q-wave obtained in step 3, with the Q-wave labeled by the expert through iteration,
if accuracy p12Increasing, then adjusting m2Jumping to step 3; if accuracy p12If not, go to step S5.1C;
step S5.1C compares the S-wave obtained in step 3 with the S-wave labeled by the expert through iteration,
if accuracy p13Increasing, then adjusting m3Jumping to step 3; if accuracy p13If not, jumping to the step S5.2;
s5.2, based on the R wave, the Q wave and the S wave obtained in the step 4 and the point marked by the expert repeatedly, adjusting the values of b and c, and respectively determining whether to jump to the step 4, specifically:
S5.2A comparing the R wave obtained in step 4 with the R wave labeled by the expert repeatedly if the accuracy p is high21If the value of b is increased, adjusting the value of b, and jumping to the step 4; if accuracy p21If not, go to step S5.2B;
step S5.2B compares the Q-wave and S-wave obtained in step 4 with those labeled by experts through iteration,
if accuracy p22、p23If the values are all increased, adjusting the value of c, and jumping to the step 4; if accuracy p22、p23If at least one is not increased, jump to step 6.
Step 6, respectively comparing the detection accuracy of the step 3 and the detection accuracy of the step 4, and selecting a detection method with high accuracy aiming at the R wave, the Q wave and the S wave, wherein the step 5 comprises the following steps:
s6.1 comparison of p11And p21If p is the size of11≥p21Jumping to step 3, extracting R wave, if p11<p21Jumping to the step 4, and extracting the R wave;
s6.2 comparison of p12And p22If p is the size of12≥p22Jumping to step 3, extracting Q wave, if p12<p22Jumping to the step 4, and extracting the Q wave;
s6.3 comparison of p13And p23If p is the size of13≥p23Jumping to step 3, extracting S wave, if p13<p23And jumping to the step 4 to extract the S wave, and ending the method.
It should be noted that the present specification only describes the preferred embodiments of the present invention, and the above embodiments are only used for illustrating the technical solutions of the present invention and not for limiting the present invention. Those skilled in the art can obtain technical solutions through logical analysis, reasoning or limited experiments according to the concepts of the present invention, and all such technical solutions are within the scope of the present invention.

Claims (1)

1. An ECG feature extraction method fusing Butterworth filtering and wavelet transformation is characterized in that: carrying out denoising processing on the power frequency interference of the original ECG signal; simultaneously, baseline drift is removed by using a curve fitting mode; after relatively accurate ECG signals are obtained, using a differential threshold method to adjust a threshold value and a wavelet transformation method to adjust scale and translation quantity parameters, respectively positioning Q waves, R waves and S waves, and comparing the parameters with information labeled by experts to obtain an optimal positioning result; the method comprises the following steps:
step A, performing spectral analysis on the original ECG signalObtaining the highest frequency and the lowest frequency, and then filtering the original ECG signal by using a Butterworth filter to obtain a filtered ECG1A signal; step a further comprises the following substeps:
SA.1 analyzing the spectrum of the ECG signal by using the discrete Fourier transform method according to formula (1) to obtain the spectrum X (e) of the ECG signal) Further, the maximum frequency f of the ECG signal is obtained1And the lowest frequency f of the frequency bands of power frequency interference and other noise interference2
Wherein, X (e)) Is the frequency spectrum of the ECG signal, ω is the frequency of the ECG signal, and ECG (n) is the nth amplitude of the ECG signal;
in the obtained X (e)) The highest frequency of the middle and low frequency bands, i.e. the highest frequency f of the ECG signal1(ii) a The lowest frequency of the high frequency band is the lowest frequency f of the frequency band of power frequency interference and other noise interference2
SA.2 filtering the ECG signal with a Butterworth filter to obtain a filtered ECG signal1Specifically, butterworth filtering is performed by equation (2):
wherein, in the formula (2), p (p belongs to N) is an order, and N represents an integer set; | H (ω) | is the mode of the Butterworth filter, | H (ω) | gaming2Is the square of the mode; omegac(2πf1<ωc<2πf2) Is the cut-off frequency of the butterworth filter;
step B, ECG outputted from step A1Performing curve fitting, calculating polynomial coefficient and removing baseline drift to obtain signal after removing baseline drift, ECG2
Step B again comprises the following substeps:
sb.1 curve fitting is performed based on equation (3):
where y is the polynomial to be fitted, the order of the polynomial q (q e N), a0,a1,...,apIs the coefficient of a polynomial of order q, x being the sampling time series, xiIs the ith power of x;
SB.2, based on the formula (4), calculating polynomial coefficients in the formula (3);
wherein,is a vector composed of polynomial coefficients,for amplitude vectors of ECG signals, C ═ 1 xx2 ... xq]T,CTIs the transposition of C;
SB.3 obtaining the signal after baseline drift removal based on the formula (5);
ECG2=ECG1-y (5)
in equation (5), ECG2For removing the post-baseline-shift signal, ECG1Is a filtered signal; y is the output of equation (3);
step C, ECG output from step B2The signal uses a differential threshold method to position R waves, then position Q waves and S waves, and respectively output the positions of the R waves, the Q waves and the S waves;
step C in turn comprises the following substeps:
SC.1 sequentially calculates ECG based on equation (6) and equation (7)2A first order difference S (n) and a second order difference W (n) of the signals;
S(n)=ECG2(n)-ECG2(n-1) (6)
W(n)=S(n)-S(n-1) (7)
where S (n) is the nth first order difference, ECG2(n) is ECG2Nth amplitude of signal, ECG2(n-1) is ECG2The nth-1 amplitude of the signal, W (n) is the nth second order difference, and S (n-1) is the nth-1 first order difference;
SC.2 determines the maximum value max of S (n) output in step SC.1 by using an enumeration method1And maximum value max of W (n)2
SC.3 sets a threshold Y based on formula (8)1
Y1=m1·max1(0<m1<1) (8)
In equation (8), the threshold is Y1,m1Is an artificially set coefficient, and the range is (0, 1);
SC.4 judges whether there is a continuous k in S (n)1(k1E N) points exceeding Y1And ECG2(n) > 0, and according to the judgment result, the following operations are carried out:
SC.4A if there are consecutive k in S (n)1(k1E N) points exceeding Y1And ECG2(n) > 0, the point n is the R wave crest in the range, the position is R, and the jump is carried out to SC.5;
wherein k is1Is an integer of 2 or more;
SC.4B if there is no consecutive k in S (n)1(k1E N) points exceeding Y1Then k is1=k1-1, jump to step sc.4;
SC.5 sets the threshold value Y of the starting point based on the equations (9) and (10)2And an endpoint threshold Y3
Y2=m2·max2(0<m2<1) (9)
Y3=m3·max2(0<m3<1) (10)
In formulae (9) and (10), Y2、Y3Respectively threshold values; m is2,m3Is a coefficient set artificially;
SC.6 searches forward from each R wave to judge whether there is a continuous k in W (n)2(k2E is N) points less than Y2And according to the judgment result, the following operations are carried out:
SC.6A if W (n) has consecutive k2(k2E is N) points less than Y2The point n is the starting point s of the QRS wave of the range, and the jump is carried out to SC.5;
wherein k is2Is an integer of 2 or more;
SC.6B if there is no consecutive k in W (n)2(k2E is N) points less than Y2Then k is2=k2-1, jump to step sc.6;
SC.7 searches backward from each R wave to determine whether there are consecutive k in W (n)3(k3E is N) points less than Y3And according to the judgment result, the following operations are carried out:
wherein k is3Is an integer of 2 or more;
SC.7A if W (n) has consecutive k3(k3E is N) points less than Y3The point n is the end point e of the QRS wave in the range and jumps to SD.8;
SC.7B if there are no consecutive k in W (n)3(k3E is N) points less than Y3Then k is3=k3-1, jump to step sc.7;
sc.8 searches for an amplitude minimum value point Q in the range of the origin S of Q-wave, R-wave, and S-wave and the R-position where the R-wave is located, based on equation (11):
Q=min(ECG2(n)),(s<n<r) (11)
in formula (11), min (ECG)2(n)) is a search ECG2(n) a function of minima;
based on equation (12), an amplitude minimum value point S is searched for in the range of the R wave and the end point e:
S=min(ECG2(n)),(r<n<e) (12)
SC.9 compares the positions of the R wave, the Q wave and the S wave determined in the steps SC.4 and SC.8 with the positions marked by the experts, and based on the formula (13), the detection accuracy p of the R wave, the Q wave and the S wave is respectively obtained11,p12,p13
In the formula (13), the value of i is 1, 2, 3, N11,N12,N13The number of R wave, Q wave and S wave in ECG signal, N11 *,N12 *,N13 *Respectively detecting the number of correct R waves, Q waves and S waves;
step D, processing the ECG processed in the step B2The signal uses wavelet transform method to get wavelet decomposition pictures of different levels, then outputs Q, R, S wave position by detecting position and amplitude of wavelet transform coefficient modulus maximum; step D comprises the following steps:
SD.1 based on formulas (14) and (15), performing wavelet transformation on the ECG signal by using dual-orthogonal spline wavelets to obtain wavelet decomposition views under different levels;
wherein x is0(n)=ECG2(n), i.e. the processed ECG signal; z is a natural number set (the same below); x is the number of(j)(n) is xj-1(n) a dyadic wavelet transform of the high band signal on the j scale, d(j)(n) is xj-1(n) a dyadic wavelet transform of the low band signal on the j scale, hj-1(k),gj-1(k) A set kth set of orthogonal digital low pass filter and high pass filter coefficients, respectively;
SD.2, based on wavelet decomposition diagrams under different scales obtained by SD.1, detecting a maximum value point M and a minimum value point L of the amplitude for the waveform under the scale of c (c belongs to N); detecting a point with an amplitude value p (p is less than epsilon) between two points, wherein epsilon is a numerical value with the amplitude value approaching zero, and p is the position of an R wave of the original ECG signal;
SD.3 searches the mode minimum value of the R wave front position based on the R wave position p obtained by SD.2 and the waveform of b (b belongs to N) scale of formula (16), namely Q wave,
Q=x(b)(n)<x(b)(n-1),x(b)(n)<x(b)(n+1),(n<p) (16)
wherein x is(b)(n) is the amplitude of the nth sequence of the ECG signal on the b scale;
searching the mode minimum value of the position after the R wave, namely the S wave,
S=x(b)(n)<x(b)(n-1),x(b)(n)<x(b)(n+1),(n>p) (17)
wherein x is(b)(n) is the amplitude of the nth sequence of the ECG signal on the b scale;
SD.4 compares the positions of the R wave, the Q wave and the S wave detected in the steps SD.2 and SD.3 with the positions marked by experts, and respectively obtains the detection accuracy p of the R wave, the Q wave and the S wave based on a formula (18)21,p22,p23
In the formula (18), the value of i is 1, 2, 3, N21,N22,N23The number of R wave, Q wave and S wave in ECG signal, N21 *,N22 *,N23 *Respectively detecting the number of correct R waves, Q waves and S waves;
wherein, the step D and the step C can also exchange the sequence;
e, repeatedly adjusting artificially set parameters of a difference threshold method through R waves, Q waves and S waves labeled by experts, and repeatedly adjusting a wavelet transform hierarchy until accuracy is converged; step E also comprises the following steps:
SE.1 adjusting m based on R-, Q-and S-waves obtained in step C, respectively, and by repeated comparison with expert-labeled points1,m2,m3Respectively determining whether to jump to the step C, specifically:
SE.1A based on the R wave obtained in step C, with iterative and expert labelingIs compared if accuracy p is high11Increasing, then adjusting m1Jumping to step C; if accuracy p11If not, jumping to the step SE.1B;
step se.1b, based on the Q-wave obtained in step C, compares with the Q-wave labeled by the expert repeatedly,
if accuracy p12Increasing, then adjusting m2Jumping to step C; if accuracy p12If not, jumping to the step SE.1C;
step se.1c, based on the S-wave obtained in step C, compares with the S-wave labeled by the expert repeatedly,
if accuracy p13Increasing, then adjusting m3Jumping to step C; if accuracy p13If not, jumping to the step SE.2;
and SE.2, respectively based on the R wave, the Q wave and the S wave obtained in the step D and the points marked by the experts through repeated comparison, adjusting the values of b and c, and determining whether to jump to the step D, wherein the specific steps are as follows:
SE.2A based on the R wave obtained in step D, compare with the R wave labeled by the expert through repetition, if the accuracy p21If yes, adjusting the value of b, and jumping to the step D; if accuracy p21If not, jumping to step SE.2B;
step se.2b is based on the Q-wave, S-wave obtained in step D, compared with the Q-wave and S-wave labeled by experts by iteration,
if accuracy p22、p23If the values are all increased, adjusting the value of c, and jumping to the step D; if accuracy p22、p23If at least one is not increased, jumping to the step F;
step F, respectively comparing the detection accuracy of the step C and the detection accuracy of the step D, and selecting a detection method with high accuracy aiming at the R wave, the Q wave and the S wave, wherein the step F comprises the following steps:
SF.1 comparison of p11And p21If p is the size of11≥p21Jumping to the step C to extract R wave, if p11<p21Jumping to the step D, and extracting R waves;
SF.2 comparison of p12And p22If p is the size of12≥p22Jumping to step C, extracting Q wave, if p12<p22Jumping to the step D, and extracting the Q wave;
SF.3 comparison of p13And p23If p is the size of13≥p23Jumping to step C, extracting S wave, if p13<p23And D, jumping to the step D to extract the S wave, and ending the method.
CN201810429640.2A 2018-05-08 2018-05-08 A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation Active CN108836305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810429640.2A CN108836305B (en) 2018-05-08 2018-05-08 A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810429640.2A CN108836305B (en) 2018-05-08 2018-05-08 A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation

Publications (2)

Publication Number Publication Date
CN108836305A CN108836305A (en) 2018-11-20
CN108836305B true CN108836305B (en) 2019-04-12

Family

ID=64212855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810429640.2A Active CN108836305B (en) 2018-05-08 2018-05-08 A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation

Country Status (1)

Country Link
CN (1) CN108836305B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542021A (en) * 2018-12-24 2019-03-29 广东理致技术有限公司 A kind of sensor weak signal data acquisition method and device
CN112244862B (en) * 2020-10-14 2024-05-14 哈尔滨理工大学 Electrocardiogram signal denoising algorithm based on RFDA wavelet threshold
CN112611444B (en) * 2020-12-30 2023-04-28 西安和其光电科技股份有限公司 Distributed optical fiber vibration monitoring system and method capable of achieving accurate positioning

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5025794A (en) * 1988-08-30 1991-06-25 Corazonix Corporation Method for analysis of electrocardiographic signal QRS complex
CN101799974A (en) * 2010-03-12 2010-08-11 上海交通大学 Electrocardio signal transmission method based on self-adaptive codebook
CN101828916A (en) * 2010-05-07 2010-09-15 深圳大学 Electrocardiosignal processing system
CN106037720A (en) * 2015-12-04 2016-10-26 贵州大学 Application method of hybrid continuous information analysis technology in medicine
CN107693011A (en) * 2017-11-13 2018-02-16 湖北科技学院 A kind of ECG signal baseline filtering method
CN107788969A (en) * 2017-09-29 2018-03-13 成都瑞迪康医疗科技有限公司 The automatic testing method of QRS complex in a kind of electrocardiosignal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9408549B2 (en) * 2009-11-03 2016-08-09 Vivaquant Llc Detecting fiducial points in physiological signals

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5025794A (en) * 1988-08-30 1991-06-25 Corazonix Corporation Method for analysis of electrocardiographic signal QRS complex
CN101799974A (en) * 2010-03-12 2010-08-11 上海交通大学 Electrocardio signal transmission method based on self-adaptive codebook
CN101828916A (en) * 2010-05-07 2010-09-15 深圳大学 Electrocardiosignal processing system
CN106037720A (en) * 2015-12-04 2016-10-26 贵州大学 Application method of hybrid continuous information analysis technology in medicine
CN107788969A (en) * 2017-09-29 2018-03-13 成都瑞迪康医疗科技有限公司 The automatic testing method of QRS complex in a kind of electrocardiosignal
CN107693011A (en) * 2017-11-13 2018-02-16 湖北科技学院 A kind of ECG signal baseline filtering method

Also Published As

Publication number Publication date
CN108836305A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
Bahoura et al. DSP implementation of wavelet transform for real time ECG wave forms detection and heart rate analysis
US8725238B2 (en) Electrocardiogram signal processing system
CN108836305B (en) A kind of ECG feature extracting method of fusion Butterworth filtering and wavelet transformation
CN111481192B (en) Electrocardiosignal R wave detection method based on improved U-Net
Sasikala et al. Extraction of P wave and T wave in Electrocardiogram using Wavelet Transform
CN105726018A (en) Automatic atrial fibrillation detection method irrelevant to RR interphase
Zou et al. An ultra-low power QRS complex detection algorithm based on down-sampling wavelet transform
CN103761424A (en) Electromyography signal noise reducing and aliasing removing method based on second-generation wavelets and ICA (independent component analysis)
CN114532993A (en) Automatic detection method for electroencephalogram high-frequency oscillation signals of epileptic
CN105266800A (en) Fetal electrocardiogram blind separation method based on low signal-to-noise ratio
Alhelal et al. FPGA-based denoising and beat detection of the ECG signal
CN109009087B (en) Rapid detection method for electrocardiosignal R wave
Li et al. A low-complexity ECG processing algorithm based on the Haar wavelet transform for portable health-care devices
CN110327032A (en) It is a kind of singly to lead the accurate recognizer of electrocardiosignal PQRST wave joint
El Bouny et al. A wavelet denoising and Teager energy operator-based method for automatic QRS complex detection in ECG signal
Meddah et al. FPGA implementation system for QRS complex detection
Elbuni et al. ECG parameter extraction algorithm using (DWTAE) algorithm
Zairi et al. Intelligent system for detecting cardiac arrhythmia on FPGA
CN111956209B (en) Electrocardiosignal R wave identification method based on EWT and structural feature extraction
Luengo et al. Blind analysis of atrial fibrillation electrograms: a sparsity-aware formulation
Sathawane et al. Prediction and analysis of ECG signal behaviour using soft computing
Wu et al. An improved method for ECG signal feature point detection based on wavelet transform
Dib et al. Delineation of the complex QRS and the T-end using wavelet transform and surface indicator
Talbi et al. New method of R-wave detection by continuous wavelet transform
Khandait et al. ECG signal processing using classifier to analyses cardiovascular disease

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
GR01 Patent grant
GR01 Patent grant