Method, device and equipment for filtering baseline drift in electrocardiosignal and storage medium

文档序号:1221487 发布日期:2020-09-08 浏览:12次 中文

阅读说明:本技术 心电信号中基线漂移的滤除方法、装置、设备及存储介质 (Method, device and equipment for filtering baseline drift in electrocardiosignal and storage medium ) 是由 申超波 郭维 阮晓雯 徐亮 于 2020-04-29 设计创作,主要内容包括:本发明涉及数据处理领域,公开了一种基于心电信号中基线漂移的滤除方法、装置、设备及存储介质。所述心电信号中基线漂移的滤除方法包括:读取待处理的原始心电信号,并对所述原始心电信号进行预处理,得到第一心电信号序列;将所述第一心电信号序列水平翻转后正向输入预置IIR滤波器,并进行滤除干扰处理,得到第二心电信号序列;将所述第二心电信号序列水平翻转后反向输入所述IIR滤波器,并进行校正延迟相位处理,得到第三心电信号序列;将所述第三心电信号序列作为滤除基线漂移干扰后的心电信号并输出。本发明能在滤除心电信号的基线漂移同时,尽可能地保留了心电信号的特征信号,提高心电信号的保真性。本发明还可应用于智慧医疗领域中,从而推动智慧城市的建设。(The invention relates to the field of data processing, and discloses a filtering method, a device, equipment and a storage medium based on baseline drift in electrocardiosignals. The method for filtering the baseline drift in the electrocardiosignals comprises the following steps: reading an original electrocardiosignal to be processed, and preprocessing the original electrocardiosignal to obtain a first electrocardiosignal sequence; after horizontally turning over the first electrocardiosignal sequence, positively inputting the first electrocardiosignal sequence into a preset IIR filter, and carrying out interference filtering treatment to obtain a second electrocardiosignal sequence; the second electrocardiosignal sequence is input into the IIR filter in a reverse direction after being horizontally overturned, and correction delay phase processing is carried out to obtain a third electrocardiosignal sequence; and outputting the electrocardiosignal sequence as the electrocardiosignal after the baseline drift interference is filtered. The invention can filter the baseline drift of the electrocardiosignal, simultaneously reserve the characteristic signal of the electrocardiosignal as much as possible and improve the fidelity of the electrocardiosignal. The invention can also be applied to the field of intelligent medical treatment, thereby promoting the construction of intelligent cities.)

1. A method for filtering baseline wander in electrocardiosignals is characterized by comprising the following steps:

reading an original electrocardiosignal to be processed, and preprocessing the original electrocardiosignal to obtain a first electrocardiosignal sequence;

after horizontally turning over the first electrocardiosignal sequence, positively inputting the first electrocardiosignal sequence into a preset IIR filter, and carrying out interference filtering treatment to obtain a second electrocardiosignal sequence;

the second electrocardiosignal sequence is input into the IIR filter in a reverse direction after being horizontally overturned, and correction delay phase processing is carried out to obtain a third electrocardiosignal sequence;

and outputting the electrocardiosignal sequence as the electrocardiosignal after the baseline drift interference is filtered.

2. The method of claim 1, wherein the reading of the original electrocardiographic signal to be processed and the preprocessing of the original electrocardiographic signal to obtain the first electrocardiographic signal sequence comprises:

reading an original electrocardiosignal to be processed;

sampling the original electrocardiosignals to obtain sampling time points and sampling values corresponding to the sampling time points;

and according to each sampling time point, sequentially writing the sampling time point and the sampling value into a preset two-dimensional array to obtain a first electrocardiosignal sequence.

3. The method for filtering baseline wander in an electrocardiographic signal according to claim 2, wherein after the step of reading an original electrocardiographic signal to be processed and preprocessing the original electrocardiographic signal to obtain a first electrocardiographic signal sequence, the method further comprises:

judging whether the numerical value of the first sampling time point of the first electrocardiosignal sequence is zero or not;

if not, subtracting the value of the first sampling time point from the sampling time points of all the sampling values so as to enable the value of the first sampling time point of the first electrocardiosignal sequence to be zero;

outputting the first cardiac signal sequence with the value of zero at the first sampling time point.

4. The method of claim 3, wherein before the step of inverting the first cardiac signal sequence horizontally and then inputting it to a preset IIR filter in a forward direction, and performing interference filtering processing to obtain a second cardiac signal sequence, the method further comprises:

determining amplitude mutation points in the first electrocardiosignal sequence based on a wavelet transform modulus maximum method;

according to the sudden change sampling value s corresponding to the amplitude sudden change point0And a sudden change sampling time point n0Segmenting the first cardiac signal sequence;

adding a continuation sequence to the segmented first signal sequence, and outputting the first signal sequence added with the continuation sequence, wherein the continuation sequence is a preset signal sequence with the length of 3p, and p is the order of the IIR filter;

wherein the formula of the wavelet transform modulus maximum method is | Wf(s)0,n)|≤|Wf(s0,n0) I, n is the sampling time point, | Wf(s)0N) | is the modulus, s, corresponding to the sampling time point0And n0And respectively corresponding to the amplitude break point, and a break sampling value and a break sampling time point.

5. The method of claim 4, wherein the step of inverting the first cardiac signal sequence horizontally and then inputting the inverted first cardiac signal sequence to a preset IIR filter in a forward direction, and performing interference filtering processing to obtain a second cardiac signal sequence comprises:

horizontally overturning the first electrocardiosignal sequence to obtain a fourth electrocardiosignal sequence, wherein the first numerical value and the last numerical value of the fourth electrocardiosignal sequence are respectively the last numerical value and the first numerical value of the first electrocardiosignal sequence;

determining a corresponding impulse response sequence according to the amplitude square function of the IIR filter;

and performing forward convolution on the fourth electrocardiosignal sequence and the impulse response sequence to filter the deviation generated by interference in the first electrocardiosignal sequence to obtain a second electrocardiosignal sequence.

6. The method as claimed in claim 5, wherein the IIR filter has an amplitude squared function expressed as

Wherein, is the ripple parameter, Rp(W) a rational function of order p with input frequency W as argument;

when p is an odd number, the number of the groups,

when p is an even number, the number of the transition metal atoms is,

Figure RE-FDA0002609013250000023

wherein WiFor input frequency, 0<Wi<1 and i is 1, 2, … k.

7. The method for filtering baseline wander in electrocardiographic signals according to claim 6, wherein the step of inverting the second electrocardiographic signal sequence horizontally and inputting the inverted second electrocardiographic signal sequence to the IIR filter, and performing correction delay phase processing to obtain a third electrocardiographic signal sequence comprises the steps of:

horizontally overturning the second electrocardiosignal sequence to obtain a fifth electrocardiosignal sequence, wherein the first numerical value and the last numerical value of the fifth electrocardiosignal sequence are respectively the last numerical value and the first numerical value of the second electrocardiosignal sequence;

carrying out reverse convolution on the fifth electrocardiosignal sequence and the impulse response sequence so as to correct the delay phase generated by the forward convolution to obtain a sixth electrocardiosignal sequence;

and according to the amplitude mutation point, subtracting a continuation sequence from the sixth signal sequence, and combining to obtain a third electrocardiosignal sequence.

8. A device for filtering baseline wander in an ecg signal, the device comprising:

the system comprises a preprocessing module, a first processing module and a second processing module, wherein the preprocessing module is used for reading an original electrocardiosignal to be processed and preprocessing the original electrocardiosignal to obtain a first electrocardiosignal sequence;

the first filtering module is used for inputting the first electrocardiosignal sequence into a preset IIR filter in a forward direction after horizontally turning over the first electrocardiosignal sequence, and carrying out interference filtering processing to obtain a second electrocardiosignal sequence;

the second filtering module is used for inverting the second electrocardiosignal sequence horizontally and then inputting the second electrocardiosignal sequence to the IIR filter in a reverse direction, and performing correction delay phase processing to obtain a third electrocardiosignal sequence;

and the output module is used for outputting the electrocardiosignal with the third electrocardiosignal sequence as the electrocardiosignal after the baseline drift interference is filtered.

9. A device for filtering baseline wander in an electrocardiographic signal, the device comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;

the at least one processor invokes the instructions in the memory to cause the apparatus for filtering baseline wander in cardiac electrical signals to perform the method for filtering baseline wander in cardiac electrical signals of any of claims 1-7.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the method for filtering baseline wander in cardiac electrical signals according to any one of claims 1-7.

Technical Field

The invention relates to the technical field of data processing, in particular to a method, a device, equipment and a storage medium for filtering baseline drift in electrocardiosignals.

Background

Cardiac electrical signals are a common method for detecting and diagnosing cardiovascular diseases. In order to obtain a diagnosis result of an electrocardiographic signal quickly, deep learning is introduced into this field. Deep learning can make up for the defects of the traditional filtering method by extracting deep features of the electrocardiosignals. However, most of deep learning models are learned by extracting noise-containing signal features, so that noise contained in signals is removed, and therefore, a clean electrocardiosignal needs to be obtained before a deep learning training sample is input.

The baseline drift is the most common one of the electrocardiosignal noises, and the amplitude of the baseline drift is the highest in the electrocardiosignals and is most easily found in the observed electrocardiosignals. The method is derived from the influence of the respiration of a human body on organs, so that the baseline of electrocardiosignals deviates from the normal baseline level, the morphology of the electrocardiosignals is influenced, and the analysis and judgment of a doctor on the signals are also influenced in serious cases. The frequency of the baseline drift is generally between 0.05 Hz and 2 Hz, and belongs to low-frequency noise. The current method for filtering out baseline wander is mainly to use a high-pass filter to filter out the baseline wander. However, the frequency range of the electrocardiosignals is 0.05-100 Hz, and the frequency of baseline drift is in the frequency range of the electrocardiosignals, so that the adoption of a high-pass filter often causes the loss of the low-frequency part of the electrocardiosignals to cause ST-segment distortion, and the final diagnosis result is influenced under severe conditions.

Disclosure of Invention

The invention mainly aims to solve the problem of characteristic loss of electrocardiosignals in the process of filtering baseline drift.

The invention provides a baseline shifting method in electrocardiosignals in a first aspect, which comprises the following steps:

reading an original electrocardiosignal to be processed, and preprocessing the original electrocardiosignal to obtain a first electrocardiosignal sequence;

after horizontally turning over the first electrocardiosignal sequence, positively inputting the first electrocardiosignal sequence into a preset IIR filter, and carrying out interference filtering treatment to obtain a second electrocardiosignal sequence;

the second electrocardiosignal sequence is input into the IIR filter in a reverse direction after being horizontally overturned, and correction delay phase processing is carried out to obtain a third electrocardiosignal sequence;

and outputting the electrocardiosignal sequence as the electrocardiosignal after the baseline drift interference is filtered.

Optionally, in a first implementation manner of the first aspect of the present invention, the reading an original electrocardiographic signal to be processed, and preprocessing the original electrocardiographic signal to obtain a first electrocardiographic signal sequence includes:

reading an original electrocardiosignal to be processed;

sampling the original electrocardiosignals to obtain sampling time points and sampling values corresponding to the sampling time points;

and according to each sampling time point, sequentially writing the sampling time point and the sampling value into a preset two-dimensional array to obtain a first electrocardiosignal sequence.

Optionally, in a second implementation manner of the first aspect of the present invention, after the step of reading an original electrocardiographic signal to be processed and preprocessing the original electrocardiographic signal to obtain a first electrocardiographic signal sequence, the method further includes:

judging whether the numerical value of the first sampling time point of the first electrocardiosignal sequence is zero or not;

if not, subtracting the value of the first sampling time point from the sampling time points of all the sampling values so as to enable the value of the first sampling time point of the first electrocardiosignal sequence to be zero;

outputting the first cardiac signal sequence with the value of zero at the first sampling time point.

Optionally, in a third implementation manner of the first aspect of the present invention, before the step of horizontally inverting the first cardiac signal sequence, and then inputting the horizontally inverted first cardiac signal sequence to a preset IIR filter in a forward direction, and performing interference filtering processing to obtain a second cardiac signal sequence, the method further includes:

determining amplitude mutation points in the first electrocardiosignal sequence based on a wavelet transform modulus maximum method;

according to the sudden change sampling value s corresponding to the amplitude sudden change point0And a sudden change sampling time point n0Segmenting the first cardiac signal sequence;

adding a continuation sequence to the segmented first signal sequence, and outputting the first signal sequence added with the continuation sequence, wherein the continuation sequence is a preset signal sequence with the length of 3p, and p is the order of the IIR filter;

wherein the formula of the wavelet transform modulus maximum method is | Wf(s)0,n)|≤|Wf(s0,n0) I, n is the sampling time point, | Wf(s)0N) | is the modulus, s, corresponding to n0And n0And respectively corresponding to the amplitude break point, and a break sampling value and a break sampling time point.

Optionally, in a fourth implementation manner of the first aspect of the present invention, the horizontally flipping the first cardiac signal sequence, then inputting the horizontally flipped first cardiac signal sequence to a preset IIR filter in a forward direction, and performing interference filtering processing to obtain a second cardiac signal sequence includes:

horizontally overturning the first electrocardiosignal sequence to obtain a fourth electrocardiosignal sequence, wherein the first numerical value and the last numerical value of the fourth electrocardiosignal sequence are respectively the last numerical value and the first numerical value of the first electrocardiosignal sequence;

determining a corresponding impulse response sequence according to the amplitude square function of the IIR filter;

and performing forward convolution on the fourth electrocardiosignal sequence and the impulse response sequence to filter the deviation generated by interference in the first electrocardiosignal sequence to obtain a second electrocardiosignal sequence.

Optionally, in a fifth implementation manner of the first aspect of the present invention, an expression of an amplitude square function of the IIR filter isWherein p represents the order of the IIR filter as a ripple parameter, RpOf order p, with input frequency W being selfRational functions of variables;

when p is an odd number, the number of the groups,

when p is an even number, the number of the transition metal atoms is,wherein WiFor input frequency, 0<Wi<1 and i is 1, 2, … k.

Optionally, in a sixth implementation manner of the first aspect of the present invention, the horizontally inverting the second cardiac signal sequence, inputting the horizontally inverted second cardiac signal sequence to the IIR filter in an inverse direction, and performing correction delay phase processing to obtain a third cardiac signal sequence includes:

horizontally overturning the second electrocardiosignal sequence to obtain a fifth electrocardiosignal sequence, wherein the first numerical value and the last numerical value of the fifth electrocardiosignal sequence are respectively the last numerical value and the first numerical value of the second electrocardiosignal sequence;

carrying out reverse convolution on the fifth electrocardiosignal sequence and the impulse response sequence so as to correct the delay phase generated by the forward convolution to obtain a sixth electrocardiosignal sequence;

and according to the amplitude mutation point, subtracting the continuation sequence from the sixth signal sequence and combining to obtain a third electrocardiosignal sequence.

The second aspect of the present invention provides a device for filtering baseline wander in an electrocardiographic signal, the device comprising:

the system comprises a preprocessing module, a first processing module and a second processing module, wherein the preprocessing module is used for reading an original electrocardiosignal to be processed and preprocessing the original electrocardiosignal to obtain a first electrocardiosignal sequence;

the first filtering module is used for inputting the first electrocardiosignal sequence into a preset IIR filter in a forward direction after horizontally turning over the first electrocardiosignal sequence, and carrying out interference filtering processing to obtain a second electrocardiosignal sequence;

the second filtering module is used for inverting the second electrocardiosignal sequence horizontally and then inputting the second electrocardiosignal sequence to the IIR filter in a reverse direction, and performing correction delay phase processing to obtain a third electrocardiosignal sequence;

and the output module is used for outputting the electrocardiosignal with the third electrocardiosignal sequence as the electrocardiosignal after the baseline drift interference is filtered.

Optionally, in a first implementation manner of the second aspect of the present invention, the preprocessing module is specifically configured to:

reading an original electrocardiosignal to be processed;

sampling the original electrocardiosignals to obtain sampling time points and sampling values corresponding to the sampling time points;

and according to each sampling time point, sequentially writing the sampling time point and the sampling value into a preset two-dimensional array to obtain the first electrocardiosignal sequence.

Optionally, in a second implementation manner of the second aspect of the present invention, the filtering apparatus further includes a calibration module, where the calibration module is specifically configured to:

judging whether the numerical value of the first sampling time point of the first electrocardiosignal sequence is zero or not;

if not, subtracting the value of the first sampling time point from the sampling time points of all the sampling values so as to enable the value of the first sampling time point of the first electrocardiosignal sequence to be zero;

outputting the first cardiac signal sequence with the value of zero at the first sampling time point.

Optionally, in a third implementation manner of the second aspect of the present invention, the filtering apparatus further includes:

a continuation module, the continuation module specifically to:

determining amplitude mutation points in the first electrocardiosignal sequence based on a wavelet transform modulus maximum method;

according to the sudden change sampling value s corresponding to the amplitude sudden change point0And a sudden change sampling time point n0Segmenting the first cardiac signal sequence;

adding a continuation sequence to the segmented first signal sequence, and outputting the first signal sequence added with the continuation sequence, wherein the continuation sequence is a preset signal sequence with the length of 3p, and p is the order of the IIR filter;

wherein the formula of the wavelet transform modulus maximum method is | Wf(s)0,n)|≤|Wf(s0,n0)|, |Wf(s0N) | is the modulus, s, corresponding to the sampling time point n0And n0And respectively corresponding to the amplitude break point, and a break sampling value and a break sampling time point.

Optionally, in a fourth implementation manner of the second aspect of the present invention, the first filtering module includes:

the first overturning unit is used for horizontally overturning the first electrocardiosignal sequence to obtain a fourth electrocardiosignal sequence, wherein a first numerical value and a last numerical value of the fourth electrocardiosignal sequence are respectively a last numerical value and a first numerical value of the first electrocardiosignal sequence;

the determining unit is used for determining a corresponding impulse response sequence according to the amplitude square function of the IIR filter;

and the first convolution unit is used for performing forward convolution on the fourth electrocardiosignal sequence and the impulse response sequence to filter the deviation generated by interference in the first electrocardiosignal sequence and obtain a second electrocardiosignal sequence.

Optionally, in a fifth implementation manner of the second aspect of the present invention, the second filtering module includes:

the second overturning unit is used for horizontally overturning the second electrocardiosignal sequence to obtain a fifth electrocardiosignal sequence, wherein a first numerical value and a last numerical value of the fifth electrocardiosignal sequence are respectively a last numerical value and a first numerical value of the second electrocardiosignal sequence;

the second convolution unit is used for carrying out reverse convolution on the fifth electrocardiosignal sequence and the impulse response sequence so as to correct the delay phase generated by the forward convolution to obtain a sixth electrocardiosignal sequence;

and the merging unit is used for subtracting the continuation sequence from the sixth signal sequence and merging the sixth signal sequence to obtain a third electrocardiosignal sequence according to the amplitude mutation point.

In a third aspect, the present invention provides a device for filtering baseline wander in an electrocardiographic signal, including: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line; the at least one processor invokes the instructions in the memory to cause the filtering apparatus for baseline wander in the cardiac electrical signal to perform the filtering method described above.

A fourth aspect of the present invention provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the above method for filtering baseline wander in an ecg signal.

According to the technical scheme, after electrocardiosignals are obtained from a database or an electrocardiograph, the electrocardiosignals are translated to the position with the data starting point of 0, then the translated electrocardiosignals are inverted by taking y as (N-1)/2 as a symmetry axis, and the phase of the frequency domain at the moment is | e-jw(N-1)||Y1(ejw) I, the frequency domain phase is Y2(ejw)|=|H(ejw)||Y1(ejw) L. Then, the electrocardiosignal passing through the filter is inverted again and reversely passes through the filter, and the phase of the obtained electrocardiosignal is | Y (e)jw)|=|H(ejw))|2|X(ejw) Therefore, there is no phase difference, i.e. zero phase, between the electrocardiographic signals before and after filtering. Therefore, the characteristic signals of the electrocardiosignals are kept as much as possible, and the characteristic extraction and classification identification of the electrocardiosignals are facilitated. In addition, in the scheme, the output third electrocardiosignal sequence can generate the advanced output of the amplitude catastrophe point signal. Therefore, the first electrocardiosignal sequence is subjected to reversal filtering twice at the amplitude mutation point in a segmented mode, the reversal timing sequence is eliminated, and the advance output is achieved, so that more characteristics of the electrocardiosignals are reserved. The electrocardiosignal obtained by the method is more even and uniform in distribution, the possibility of distortion of the mutation point is reduced, and the extraction of the characteristics of the electrocardiosignal is facilitated. The invention can also be applied to intelligent medical treatmentIn the field, the construction of smart cities is promoted.

Drawings

FIG. 1 is a schematic diagram of a first embodiment of a method for filtering baseline wander in an ECG signal according to an embodiment of the present invention;

FIG. 2 is a diagram illustrating a method for filtering baseline wander in an ECG signal according to a second embodiment of the present invention;

FIG. 3 is a diagram illustrating a method for filtering baseline wander from an ECG signal according to a third embodiment of the present invention;

FIG. 4 is a diagram illustrating a fourth embodiment of a method for filtering baseline wander in an ECG signal according to an embodiment of the invention;

FIG. 5 is a schematic diagram of an embodiment of a device for filtering baseline wander in an ECG signal according to an embodiment of the invention;

FIG. 6 is a schematic diagram of another embodiment of a device for filtering baseline wander in an ECG signal according to an embodiment of the invention;

fig. 7 is a schematic diagram of an embodiment of a device for filtering baseline wander in an ecg signal according to an embodiment of the present invention.

Detailed Description

The embodiment of the invention provides a method, a device, equipment and a storage medium for filtering baseline drift in electrocardiosignals. After acquiring electrocardiosignals from a database or an electrocardiograph, translating the electrocardiosignals to a position with a data starting point of 0, inverting the translated electrocardiosignals by taking y ═ 2/2 as a symmetry axis, inverting the electrocardiosignals after inversion, then passing through a filter, inverting the electrocardiosignals after passing through the filter again, and reversely passing through the filter, wherein the electrocardiosignals before and after filtering do not have a phase difference, namely a zero phase. Therefore, the characteristic signals of the electrocardiosignals are kept as much as possible, and the characteristic extraction and classification identification of the electrocardiosignals are facilitated. In addition, the electrocardiosignal distribution obtained by the method is more smooth and uniform, the possibility of the distortion of the mutation point is reduced, and the extraction of the characteristics of the electrocardiosignal is facilitated.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种ICU病房用颅脑损伤检测仪

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!