CN108926342B - A method of ECG signal baseline drift is eliminated based on sparse matrix - Google Patents
A method of ECG signal baseline drift is eliminated based on sparse matrix Download PDFInfo
- Publication number
- CN108926342B CN108926342B CN201810568551.6A CN201810568551A CN108926342B CN 108926342 B CN108926342 B CN 108926342B CN 201810568551 A CN201810568551 A CN 201810568551A CN 108926342 B CN108926342 B CN 108926342B
- Authority
- CN
- China
- Prior art keywords
- matrix
- sparse
- baseline drift
- ecg signal
- data
- 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
Links
Classifications
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/24—Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
- A61B5/316—Modalities, i.e. specific diagnostic methods
- A61B5/318—Heart-related electrical modalities, e.g. electrocardiography [ECG]
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/24—Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
- A61B5/316—Modalities, i.e. specific diagnostic methods
Landscapes
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Heart & Thoracic Surgery (AREA)
- Medical Informatics (AREA)
- Biophysics (AREA)
- Pathology (AREA)
- Engineering & Computer Science (AREA)
- Biomedical Technology (AREA)
- Veterinary Medicine (AREA)
- Physics & Mathematics (AREA)
- Molecular Biology (AREA)
- Surgery (AREA)
- Animal Behavior & Ethology (AREA)
- General Health & Medical Sciences (AREA)
- Public Health (AREA)
- Cardiology (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
The present invention discloses a kind of method for eliminating ECG signal baseline drift based on sparse matrix, ECG peak signal is modeled as sparse matrix, background signal is modeled as low-pass signal, by sparse matrix algorithm calculate eliminate baseline drift after ECG signal and baseline, have it is easy to operate, the speed of service is fast, electrocardiosignal figure is not easy the advantages of being distorted, baseline drift is eliminated by baseline of zero graduation, has really achieved the purpose that ECG signal eliminates baseline drift, and have and detect using QSR wave.Data complexity is reduced by the rarefaction representation of sparse matrix, the information contained by data can be given full play to, removes lengthy and jumbled data information, reaches and maximally utilize data.
Description
Technical field
It is the present invention relates to a kind of method of baseline drift in elimination ECG signal, in particular to a kind of to be disappeared based on sparse matrix
Except the method for ECG signal baseline drift.
Background technique
Electrocardiogram (electrocardiogram, ECG) is the relevant potential change figure of related cardiomotility.ECG electrocardio letter
Baseline drift noise jamming problem in number is long-standing, caused when mainly being breathed by the person of being recorded, and not can avoid.Baseline
Drift can raise ECG ECG ST wave band, the serious distortion of electrocardio track be caused, to affect normal medical judgment.Mesh
Preceding to have proposed and apply many methods for eliminating ECG signal baseline drift both at home and abroad, filter method and fitting base drift method are two classes
Main method.Wherein filter method inhibits and prevents a kind of important algorithm of interference, and fitting base drift method is by accordingly being joined
Examination point is fitted a kind of algorithm of baseline again.
The filter order that high-pass filtering method needs when designing is especially big, computationally intensive, while easily leading to the mistake of ECG waveform
Very, wherein the wavelet thresholding method based on wavelet theory, threshold value are chosen very big and complicated for operation to effect of signals.Though EMD decomposition method
The electrocardiosignal for so overcoming the problem of threshold value value difficulty in wavelet transformation, but decomposing recombination is distorted than more serious, makes score
Solution result loses meaning.And be fitted base drift method it is ineffective when handling biggish drift ECG waveform signal, cannot reach good
The effect of good elimination baseline drift.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of sides that ECG signal baseline drift is eliminated based on sparse matrix
Method eliminates the baseline drift in ECG signal, and keeps the validity of ECG signal.
In order to solve the technical problem, the technical solution adopted by the present invention is that: one kind eliminating ECG letter based on sparse matrix
The method of number baseline drift, comprising the following steps:
S01), electrocardiogram (ECG) data is loaded, electrocardiogram (ECG) data is inputted in the form of matrix S, and matrix S is the data that N row 1 arranges, and is extracted
The total data of matrix S is y, N=length (y), indicates the length for being loaded into data;
S02), cutoff frequency fc, filter order d, the coefficient of ratio r of filter are set, and constrained parameters α and λ are set;
S03), band-like sparse matrix A, B, calculating process are calculated are as follows: setting parameter matrix a1, b1 define Omc=2* π *
Fc, t=((1-cos (omc))/(1+cos (omc)))d, d convolution algorithm of progress then is recycled to matrix a1, b1 respectively and is obtained
A2, b2, then b2 obtains matrix b, matrix a=b+t*a2 as convolution algorithm with [- 1 1], is made using matrix a, b about A, B square
The sparse operation of battle array, obtains sparse band matrix A, B of two N*N ranks, matrix B is multiplied to obtain parameter with the transposed matrix of B
Matrix B TB, and seek the inverse matrix A of A-1;
S04), calculating matrix D generates the dilute of (N-1) * N rank by matrix e if e is the matrix for being all 1 that N-1 row 1 arranges
The sparse matrix D2 of matrix D 1 and (N-2) * N rank is dredged, matrix D 1, D2 row are combined into the matrix D of (2N-3) * N rank, and ask that D's is inverse
Matrix D-1;
S05), high-pass filtering matrix H=B* (A/x) is set, x indicates to eliminate the ECG signal after baseline drift;
S06), the sparse matrix that Lambda is 2N-3 rank is set, the nonzero element in Lambda is the data extracted in step 1
Y, Gamma are that leading diagonal is all the N rank sparse matrix that 1, remaining element is 0,
Setting parameter matrix M=2* λ * Gamma+D-1*Lambda*D;
ECG signal x=A* ((BTB+A after then eliminating baseline drift-1* M*A)/D),
S07), algorithm iteration times N it, i=1,2 are set, and 3 ... .Nit are started the cycle over from i=1 and executed step S06, directly
To i > Nit or xnStop circulation, x when < gnFor the difference that x is recycled twice in succession, g is the threshold value of setting, executes above-mentioned recycle
To x be exactly ECG signal after eliminating baseline drift, x=[x0,x1......xn-1]T, baseline f=y-x-H (y-x).Utilize matrix
A, b obtains matrix A, the process of B: set A, B as the sparse matrix of two N*N ranks,
Further, matrix A, the process of B are obtained using matrix a, b are as follows: set the non-of matrix a for the leading diagonal of A
Neutral element, the leading diagonal of B are set as the nonzero element of matrix b, rest part 0.
Further, matrix D 1, the process of D2 are obtained using matrix e are as follows: set D1 as the sparse matrix of (N-1) * N rank, D2
For the sparse matrix of (N-2) * N rank, it sets the leading diagonal of D1, D2 to the nonzero element of matrix e, rest part 0.
Further, in step S02, cutoff frequency fc=0.006, filter order d=1, coefficient of ratio r=6, constraint ginseng
Number α=0.8, the α of λ=0.5.
Further, in step S01, N 6468.
Beneficial effects of the present invention: inventive algorithm has easy to operate, and the speed of service is fast, what electrocardiosignal figure was not easy to be distorted
Advantage eliminates baseline drift by baseline of zero graduation, has really achieved the purpose that ECG signal eliminates baseline drift, and advantageous
It is detected with QSR wave.Data complexity is reduced by the rarefaction representation of sparse matrix, the letter contained by data can be given full play to
Breath, removes lengthy and jumbled data information, reaches and maximally utilize data.
Detailed description of the invention
Fig. 1 is the ECG signal figure eliminated after baseline drift.
Specific embodiment
The present invention is further illustrated in the following with reference to the drawings and specific embodiments.
Embodiment 1
The present embodiment discloses a kind of method for eliminating ECG signal baseline drift based on sparse matrix, specifically includes following step
It is rapid:
S01), electrocardiogram (ECG) data is loaded, electrocardiogram (ECG) data is inputted in the form of matrix S, and matrix S is the data that N row 1 arranges, and is extracted
The total data of matrix S is y, N=length (y), indicates the length for being loaded into data;
S02), cutoff frequency fc, filter order d, the coefficient of ratio r of filter are set, and constrained parameters α and λ are set;
S03), band-like sparse matrix A, B, calculating process are calculated are as follows: setting parameter matrix a1, b1 define Omc=2* π *
Fc, t=((1-cos (omc))/(1+cos (omc)))d, d convolution algorithm of progress then is recycled to matrix a1, b1 respectively and is obtained
A2, b2, then b2 obtains matrix b, matrix a=b+t*a2 as convolution algorithm with [- 1 1], is made using matrix a, b about A, B square
The sparse operation of battle array, obtains sparse band matrix A, B of two N*N ranks, matrix B is multiplied to obtain parameter with the transposed matrix of B
Matrix B TB, and seek the inverse matrix A of A-1;
S04), calculating matrix D generates the dilute of (N-1) * N rank by matrix e if e is the matrix for being all 1 that N-1 row 1 arranges
The sparse matrix D2 of matrix D 1 and (N-2) * N rank is dredged, matrix D 1, D2 row are combined into the matrix D of (2N-3) * N rank, and ask that D's is inverse
Matrix D-1;
S05), high-pass filtering matrix H=B* (A/x) is set, x indicates to eliminate the ECG signal after baseline drift;
S06), the sparse matrix that Lambda is (2N-3) rank is set, the nonzero element in Lambda is the number extracted in step 1
According to y, Gamma is that leading diagonal is all the N rank matrix that 1, remaining element is 0,
Setting parameter matrix M=2* λ * Gamma+D-1*Lambda*D;
ECG signal x=A* ((BTB+A after then eliminating baseline drift-1* M*A)/D),
S07), algorithm iteration times N it, i=1,2 are set, and 3 ... .Nit are started the cycle over from i=1 and executed step S06, directly
To i > Nit or xnStop circulation, x when < gnFor the difference that x is recycled twice in succession, g is the threshold value of setting, executes above-mentioned recycle
To x be exactly ECG signal after eliminating baseline drift, x=[x0,x1......xn-1]T, background signal f=y-x-H (y-x).
S07), algorithm iteration times N it, i=1,2 are set, and 3 ... .Nit are started the cycle over from i=1 and executed step S06, directly
To i > Nit or xnStop circulation, x when < gnFor the difference that x is recycled twice in succession, g is the threshold value of setting, executes above-mentioned recycle
To x be exactly ECG signal after eliminating baseline drift, x=[x0,x1......xn-1]T, baseline f=y-x-H (y-x), H (y-x) generation
Table high-pass filtering matrix, uses the formula of step S05.
In the present embodiment, matrix A, the process of B are obtained using matrix a, b are as follows: set matrix a's for the leading diagonal of A
Nonzero element, the leading diagonal of B are set as the nonzero element of matrix b, rest part 0.
In the present embodiment, matrix D 1, the process of D2 are obtained using matrix e are as follows: set D1 as the sparse matrix of (N-1) * N rank,
D2 is the sparse matrix of (N-2) * N rank, sets the leading diagonal of D1, D2 to the nonzero element of matrix e, rest part 0.
In the present embodiment, in step S02, cutoff frequency fc=0.006, filter order d=1, coefficient of ratio r=6, constraint
Parameter alpha=0.8, λ=0.5 α, then in step S03, matrix a1, b1, which carry out 1 convolution algorithm, can obtain matrix a2, b2,
In the present embodiment, in step S01, N 6468 has 6468 data in original electrocardiographicdigital data.
As shown in Figure 1, the ECG signal figure after baseline drift is eliminated for the present embodiment, it can be seen from the figure that eliminating baseline
ECG signal after drift is cleaner, and remains wave crest and trough, that is, maintains the authenticity of ECG signal.
ECG peak signal is modeled as sparse matrix by the present invention, and background signal is modeled as low-pass signal, passes through sparse square
Battle array algorithm calculate eliminate baseline drift after ECG signal and baseline, have it is easy to operate, the speed of service is fast, and electrocardiosignal figure is not easy
The advantages of distortion, eliminates baseline drift by baseline of zero graduation, has really achieved the purpose that ECG signal eliminates baseline drift,
And has and detected using QSR wave.Data complexity is reduced by the rarefaction representation of sparse matrix, can be given full play to contained by data
Some information removes lengthy and jumbled data information, reaches and maximally utilize data.
Described above is only basic principle and preferred embodiment of the invention, and those skilled in the art do according to the present invention
Improvement and replacement out, belong to the scope of protection of the present invention.
Claims (5)
1. a kind of method for eliminating ECG signal baseline drift based on sparse matrix, it is characterised in that: the following steps are included: S01),
Electrocardiogram (ECG) data is loaded, electrocardiogram (ECG) data is inputted in the form of matrix S, and matrix S is the data that N row 1 arranges, and extracts whole numbers of matrix S
According to the length for for y, N=length (y), indicating to be loaded into data;
S02), cutoff frequency fc, filter order d, the coefficient of ratio r of filter are set, and constrained parameters α and λ are set;
S03), band-like sparse matrix A, B, calculating process are calculated are as follows: setting parameter matrix a1, b1 define omc=2* π * fc, t=
((1-cos(omc))/(1+cos(omc)))d, d convolution algorithm of progress then is recycled to matrix a1, b1 respectively and obtains a2, b2,
Then b2 obtains matrix b, matrix a=b+t*a2 as convolution algorithm with matrix [- 1 1], is made using matrix a, b about A, B matrix
Sparse operation, obtain sparse band matrix A, B of two N*N ranks, matrix B be multiplied to obtain parameter square with the transposed matrix of B
Battle array BTB, and seek the inverse matrix A of A-1;
S04), calculating matrix D generates the sparse square of (N-1) * N rank by matrix e if e is the matrix for being all 1 that N-1 row 1 arranges
The battle array D1 and sparse matrix D2 of (N-2) * N rank, matrix D 1, D2 row are combined into the matrix D of (2N-3) * N rank, and seek the inverse matrix of D
D-1;
S05), high-pass filtering matrix H=B* (A/x) is set, and x indicates to eliminate the ECG signal after baseline drift;
S06), the sparse matrix that Lambda is (2N-3) rank is set, the nonzero element in Lambda is the data y extracted in step 1,
Gamma is that leading diagonal is all the N rank matrix that 1, remaining element is 0,
Parameter matrix M=2* λ * Gamma+D-1*Lambda*D;
ECG signal x=A* ((BTB+A after then eliminating baseline drift-1* M*A)/D),
S07), algorithm iteration times N it, i=1,2 are set, 3 ... .Nit are started the cycle over from i=1 and are executed step S06, until i >
Nit or xnStop circulation, x when < gnFor the difference that x is recycled twice in succession, g is the threshold value of setting, executes what above-mentioned circulation obtained
X is exactly ECG signal after eliminating baseline drift, x=[x0,x1......xn-1]T, baseline f=y-x-H (y-x), H (y-x) represent height
Pass filter matrix is calculated using the formula of step S05.
2. the method according to claim 1 for eliminating ECG signal baseline drift based on sparse matrix, it is characterised in that: benefit
Matrix A, the process of B are obtained with matrix a, b: being set A, B as the sparse matrix of two N*N ranks, set matrix for the leading diagonal of A
The nonzero element of a, the leading diagonal of B are set as the nonzero element of matrix b, rest part 0.
3. the method according to claim 1 for eliminating ECG signal baseline drift based on sparse matrix, it is characterised in that: benefit
Matrix D 1, the process of D2 are obtained with matrix e are as follows: set D1 as the sparse matrix of (N-1) * N rank, D2 is the sparse square of (N-2) * N rank
Battle array, sets the leading diagonal of D1, D2 to the nonzero element of matrix e, rest part 0.
4. the method according to claim 1 for eliminating ECG signal baseline drift based on sparse matrix, it is characterised in that: step
In rapid S02, cutoff frequency fc=0.006, filter order d=1, coefficient of ratio r=6, constrained parameters α=0.8, λ=0.5 α.
5. the method according to claim 1 for eliminating ECG signal baseline drift based on sparse matrix, it is characterised in that: step
In rapid S01, N 6468.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810568551.6A CN108926342B (en) | 2018-06-05 | 2018-06-05 | A method of ECG signal baseline drift is eliminated based on sparse matrix |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810568551.6A CN108926342B (en) | 2018-06-05 | 2018-06-05 | A method of ECG signal baseline drift is eliminated based on sparse matrix |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108926342A CN108926342A (en) | 2018-12-04 |
CN108926342B true CN108926342B (en) | 2019-04-05 |
Family
ID=64449473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810568551.6A Active CN108926342B (en) | 2018-06-05 | 2018-06-05 | A method of ECG signal baseline drift is eliminated based on sparse matrix |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108926342B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115105088B (en) * | 2022-06-20 | 2023-03-14 | 山东省人工智能研究院 | Improved electrocardiosignal denoising method based on wavelet domain sparse characteristic |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140086346A1 (en) * | 2012-09-21 | 2014-03-27 | Samsung Electronics Co., Ltd. | Method and system for removal of baseline wander and power-line interference |
CN103070681B (en) * | 2012-12-08 | 2016-08-03 | 太原理工大学 | A kind of ventricular late potential separation method based on sparse component analysis |
US10610162B2 (en) * | 2016-05-31 | 2020-04-07 | Stmicroelectronics S.R.L. | Method for the detecting electrocardiogram anomalies and corresponding system |
-
2018
- 2018-06-05 CN CN201810568551.6A patent/CN108926342B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108926342A (en) | 2018-12-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110659621A (en) | Combined noise reduction method based on variational modal decomposition and permutation entropy | |
CN110680308B (en) | Electrocardiosignal denoising method based on fusion of improved EMD and threshold method | |
Dey et al. | Analysis of P-QRS-T components modified by blind watermarking technique within the electrocardiogram signal for authentication in wireless telecardiology using DWT | |
Chang | Ensemble empirical mode decomposition for high frequency ECG noise reduction | |
CN105125204B (en) | A kind of electrocardiosignal noise-reduction method based on ESMD methods | |
CN108444709B (en) | Rolling bearing fault diagnosis method combining VMD and FastICA | |
CN108338784A (en) | The Denoising of ECG Signal of wavelet entropy threshold based on EEMD | |
CN108926342B (en) | A method of ECG signal baseline drift is eliminated based on sparse matrix | |
CN108844617B (en) | The adaptive sparse tree construction noise-reduction method of main reducing gear very noisy vibration signal | |
CN110151175A (en) | Surface electromyogram signal noise-eliminating method based on CEEMD and improvement wavelet threshold | |
CN111650654B (en) | Ground magnetic resonance signal peak noise elimination method combining EMD and WT algorithms | |
CN107233093A (en) | Detection method, device and the electronic equipment of R ripples | |
CN111680785A (en) | ECG signal processing method based on sparse characteristic and antagonistic neural network combination | |
CN105044769B (en) | The method for improving the resolution ratio of seismic signal | |
CN109724693B (en) | Fusion spectrum denoising method based on stationary wavelet | |
CN114358093A (en) | Method and equipment for detecting partial discharge in power equipment | |
CN106236075B (en) | A kind of noise-reduction method applied to portable electrocardiograph institute thought-read electrograph | |
CN105187341A (en) | Stationary wavelet transform denoising method based on cross validation | |
CN109602416A (en) | A kind of method of ECG signal joint baseline correction and noise reduction | |
CN114330445A (en) | Wavelet threshold denoising method based on transformer vibration signal sensitive IMF | |
CN106204487A (en) | A kind of Ultrasonic Image Denoising method based on sparse constraint | |
CN104242877B (en) | Core pulse signal digital Gaussian manufacturing process based on simulation CR RC circuits | |
Figoń et al. | ECG signal quality improvement techniques | |
CN113598785B (en) | Electrocardiosignal denoising method based on wavelet domain sparse characteristic | |
CN113180680B (en) | Improved electrocardiosignal noise reduction method based on singular spectrum analysis |
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 |