CN108634935B - Method, device and equipment for correcting signal baseline drift - Google Patents

Method, device and equipment for correcting signal baseline drift Download PDF

Info

Publication number
CN108634935B
CN108634935B CN201810438245.0A CN201810438245A CN108634935B CN 108634935 B CN108634935 B CN 108634935B CN 201810438245 A CN201810438245 A CN 201810438245A CN 108634935 B CN108634935 B CN 108634935B
Authority
CN
China
Prior art keywords
value
sampling
window
sub
values
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.)
Expired - Fee Related
Application number
CN201810438245.0A
Other languages
Chinese (zh)
Other versions
CN108634935A (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.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN201810438245.0A priority Critical patent/CN108634935B/en
Publication of CN108634935A publication Critical patent/CN108634935A/en
Application granted granted Critical
Publication of CN108634935B publication Critical patent/CN108634935B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof

Landscapes

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

Abstract

The invention discloses a method for correcting signal baseline drift, which is characterized in that a filtering window is divided into a preset number of sub-windows in advance, and each sub-window stores sampling values in a non-crossed numerical range, so that when the sampling values are inserted, the corresponding sub-window can be determined according to the numerical range of the sampling values to be inserted, and then the sampling values are inserted into the preset positions of the sub-windows. Therefore, the method can determine the sub-window according to the size of the sampling value to be inserted, and then insert the sampling value into the preset position, thereby avoiding comparing the sampling value with each sampling value in the filtering window in a large quantity, greatly reducing the complexity of the algorithm and saving the time. The invention also provides a device and equipment for correcting the signal baseline drift and a computer-readable storage medium, and the action of the device and the equipment corresponds to the action of the method.

Description

Method, device and equipment for correcting signal baseline drift
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, and a device for correcting a signal baseline wander, and a computer-readable storage medium.
Background
In the process of acquiring bioelectric signals such as electrocardio, electroencephalogram and myoelectricity, due to human activities, zero drift of a sensor and the like, low-frequency interference often exists in the acquired signals, and the low-frequency interference is reflected as the drift of a signal baseline in a time domain image of the signals. Moreover, because the frequency of the electrocardio signals, the electroencephalogram signals and the like is low, the baseline drift can seriously affect the acquired data, and the difficulty of analyzing the signals in the later period is increased.
Taking an electrocardiographic signal as an example, an electrocardiogram is one of the most commonly used clinical examinations, and can help medical staff diagnose arrhythmia, myocardial ischemia, myocardial infarction and parts, and judge the influence of drugs or electrolytes on the heart. The frequency of the electrocardiogram signal is low, the amplitude is millivolt, and the electrocardiogram is easy to be interfered to cause deformation, distortion and even signal saturation. Therefore, it is necessary to rapidly correct the baseline shift phenomenon in the electrocardiosignal, which is of great significance for subsequent diagnosis.
The current common method for correcting baseline drift is a median filtering method, which obtains a plurality of sampling values arranged according to sampling sequence by sampling signals, then takes out a preset number of sampling values from the sampling values and arranges the sampling values from small to large, thereby determining the median of the preset number of sampling values, and finally corrects the sampling values by using the median. However, this method requires continuous insertion and deletion of the sample values, and especially in the insertion process, in order to ensure that the inserted sample values are still arranged in the order from small to large, the sample values to be inserted need to be compared with each sample value, so the calculation amount is large, and the algorithm is complex. For example, the algorithm complexity of the method based on the comparison sorting is proved not to be lower than O (N × logN), and the operation is slow; although the operation speed of the bucket-based sorting method is faster than that of the comparative sorting method, the algorithm complexity is degraded to O (N × logN) when the input data is uneven in value.
It can be seen that how to reduce the complexity of the baseline wander signal correction method is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a method, a device and equipment for correcting signal baseline drift and a computer-readable storage medium, which are used for solving the problem of complexity of the traditional method for correcting baseline drift signals.
In order to solve the above technical problem, the present invention provides a method for correcting a signal baseline drift, which comprises:
sampling the signal to obtain a plurality of sampling values, and recording the sampling value at the nth time as Sn
Presetting a filtering window, wherein the filtering window is divided into a preset number of sub-windows, each sub-window stores the sampling values in a non-crossed numerical range, the sub-windows are arranged according to the numerical values of the sampling values stored in the sub-windows, the sampling values in the sub-windows are arranged according to the numerical values, the filtering window stores N, 2w and +1 sampling values, and w is the filtering radius of the filtering window;
according to the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-N
Determining interpolated sample values SnThen the median M of the sampled values in the filtering windown
Sampling value S at the nth-w momentn-wAnd median MnAnd (5) making a difference, namely obtaining a corrected signal sampling value at the nth-w moment.
The method comprises the steps that a filtering window is preset, the filtering window is divided into a preset number of sub-windows, sampling values in a non-crossed numerical range are stored in each sub-window, the sub-windows are arranged according to the numerical values of the sampling values stored in the sub-windows, the sampling values in the sub-windows are arranged according to the numerical values, the filtering window stores N2 w +1 sampling values, w is the filtering radius of the filtering window, and the sampling values S are obtained according to the sampling valuesnDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-NPreviously, comprising:
and determining an initial value c according to the value range of the sampling value, and inserting N initial values c into the filtering window.
Wherein the sampling values SnDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-NThe method comprises the following steps:
according to the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window;
determining the sample value S with the most advanced sampling time in the filtering windown-NThe value of (d);
according to the sampling value Sn-NThe value of (1) isDetermining a corresponding sub-window by the range;
determining the sampling value S in the sub-windown-NAnd deleting the sampled value with the same value.
Wherein the determination of the interpolated sample value SnThen the median M of the sampled values in the filtering windownThe method comprises the following steps:
according to the value S of the samplenSampling value Sn-wAnd a median Mn-1Determining the magnitude relation of the interpolated sampled value SnThen the median M of the sampled values in the filtering windownAnd median Mn-1In which the median M isn-1To in the sampled value SnA median of the sample values within the filtering window prior to insertion into the filtering window;
obtaining a median Mn-1And determining the median M according to the position relation and the position informationn
The invention also provides a device for correcting the signal baseline drift, which comprises:
a sampling module: the method is used for sampling a signal to obtain a plurality of sampling values, and the sampling value at the nth time is recorded as Sn
A filtering window setting module: the method comprises the steps that a filtering window is preset and divided into a preset number of sub-windows, sampling values in a non-crossed numerical range are stored in each sub-window, the sub-windows are arranged according to the numerical size of the sampling values stored in the sub-window, the sampling values in the sub-windows are arranged according to the numerical size, N is 2w +1 sampling values stored in the filtering window, and w is the filtering radius of the filtering window;
inserting and deleting modules: for dependent on the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-N
A median determination module: for determining interpolated sample values SnThen the median M of the sampled values in the filtering windown
A correction module: for sampling the value S at the n-w th timen-wAnd median MnAnd (5) making a difference, namely obtaining a corrected signal sampling value at the nth-w moment.
Wherein the apparatus comprises:
a filtering window initialization module: and the method is used for determining an initial value c according to the value range of the sampling value and inserting N initial values c into the filtering window.
Wherein the insertion deletion module comprises:
an insertion unit: for dependent on the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window;
a numerical value determination unit: for determining the sample value S with the most advanced sample time in the filter windown-NThe value of (d);
a sub-window determination unit: for measuring the value S of the samplen-NDetermining a corresponding sub-window according to the numerical range of the numerical value;
a deletion unit: for determining the sampling values S in the sub-windown-NAnd deleting the sampled value with the same value.
Wherein the median determination module comprises:
a positional relationship determination unit: for dependent on the value S of the samplenSampling value Sn-wAnd a median Mn-1Determining the magnitude relation of the interpolated sampled value SnThen the median M of the sampled values in the filtering windownAnd median Mn-1In which the median M isn-1To in the sampled value SnA median of the sample values within the filtering window prior to insertion into the filtering window;
a median determination unit: for obtaining median Mn-1And determining the median M according to the position relation and the position informationn
In addition, the invention also provides a device for correcting the signal baseline drift, which comprises:
a memory: for storing a computer program;
a processor: for executing the computer program to carry out the steps of a method of signal baseline drift correction as described above.
Finally, the present invention also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor implements the steps of a method of signal baseline drift correction as described above.
The method for correcting the signal baseline drift divides a filter window into a preset number of sub-windows in advance, and each sub-window stores sampling values in a non-crossed numerical range, so that when the sampling values are inserted, the corresponding sub-window can be determined according to the numerical range of the sampling values to be inserted, and then the sampling values are inserted into the preset positions of the sub-windows. Therefore, the method can determine the sub-window according to the size of the sampling value to be inserted, and then insert the sampling value into the preset position, thereby avoiding comparing the sampling value with each sampling value in the filtering window in a large quantity, greatly reducing the complexity of the algorithm and saving the time.
The invention also provides a device and equipment for correcting the signal baseline drift and a computer readable storage medium, the action of which corresponds to the action of the method, and the detailed description is omitted.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a flowchart illustrating an implementation of an embodiment of a method for correcting a signal baseline wander according to the present invention;
FIG. 2 is a comparison of before and after signal correction provided by the present invention;
fig. 3 is a block diagram of a signal baseline wander correcting apparatus provided in the present invention.
Detailed Description
The core of the invention is to provide a method, a device and equipment for correcting signal baseline drift and a computer readable storage medium, which effectively reduce the complexity of correcting the signal baseline drift.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following describes an embodiment of a method for correcting a signal baseline drift provided by the present invention, and referring to fig. 1, the embodiment includes:
step S110: sampling the signal to obtain a plurality of sampling values, and recording the sampling value at the nth time as Sn
In particular, the signal may be a bioelectric signal, such as an electrocardiographic signal.
Step S120: the method comprises the steps of presetting a filtering window, wherein the filtering window is divided into a preset number of sub-windows, each sub-window stores sampling values in a non-crossed numerical range, the sub-windows are arranged according to the numerical values of the sampling values stored in the sub-windows, the sampling values in the sub-windows are arranged according to the numerical values, the filtering window stores N-2 w +1 sampling values, and w is the filtering radius of the filtering window.
Specifically, a filtering window may be initialized, an initial value c is determined according to a value range of the sampling value, and then N initial values c are inserted into the filtering window. For example, when the sampling value ranges from 0 to 4095, the initial value may be (4095+1)/2, that is, 2048.
It should be noted that the sub-window stores the sampling values in non-intersecting numerical ranges, where the numerical ranges may be uniformly divided numerical segments, or non-uniformly divided numerical segments. In this embodiment, as a more preferable mode, assuming that the value range of the sampling value is divided into seven value segments, and the sampling value in each value segment is stored in a respective sub-window, the value range of the fourth value segment in the seven value segments arranged in the order from small to large may be set to be smaller, so that the sampling value in the fourth sub-window is relatively smaller, and since a median generally appears in the fourth sub-window, some comparison steps are less performed when performing subsequent insertion or deletion, thereby further reducing the calculation amount of this embodiment.
In addition, in this embodiment, when the correction effect is not ideal enough, the filtering radius or the sampling frequency may be manually adjusted.
And finally, arranging the sub-windows according to the numerical values of the sampling values stored in the sub-windows, and arranging the sampling values in the sub-windows according to the numerical values, wherein the size can be from large to small, and can also be from small to large. However, it is necessary to ensure that the arrangement order of the sampling values in the sub-window and the sub-window is consistent.
Step S130: according to the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-N
Specifically, the preset position may be that, in the sampling value sequence of the sub-window, the sampling value S can be guaranteednThe previous sampling values are all smaller than the sampling value SnThe position of (a).
And deleting the sampling value S with the most advanced sampling time in the filtering windown-NIn particular, the sampling value S with the most advanced sampling time in the filtering window is determined firstn-NIs then given byAccording to the sampling value Sn-NDetermining a corresponding sub-window in the numerical range of the numerical value S, and finally determining the sampling value S in the sub-windown-NAnd deleting the sampled value with the same value.
Step S140: determining interpolated sample values SnThen the median M of the sampled values in the filtering windown
In the present embodiment, the interpolated sample value S is held in advancenPrevious median Mn-1Can be determined according to the median Mn-1And inserting the sampled value SnMedian M afternThe median is determined by the positional relationship between them. Specifically, the sampling value S can be firstly obtainednSampling value Sn-wAnd a median Mn-1Determining the magnitude relation of the interpolated sampled value SnThen the median M of the sampled values in the filtering windownAnd median Mn-1In which the median M isn-1To in the sampled value SnA median of the sample values within the filtering window prior to insertion into the filtering window; then, a median M is obtainedn-1And determining the median M according to the position relation and the position informationn
When the sub-windows are arranged in the order from small to large and the sampling values in the sub-windows are also arranged in the order from small to large, the above-mentioned sampling value S is usednSampling value Sn-wAnd a median Mn-1Determining the median MnAnd median Mn-1The position relationship of (2) can be specifically divided into the following five steps:
(1) if the input signal sampling value S at the N-th timen-NThe median M obtained in the previous round of calculation is less than or equal ton-1And the current signal sample value SnIs greater than the median M obtained in the previous calculationn-1Then the median M of the wheeln-1For M in the filtering windown-1Sampling values of a position subsequent to the position;
(2) if the input signal sampling value S at the N-th timen-NGreater than the previous meterThe median M calculatedn-1And the current signal sample value SnThe median M obtained in the previous round of calculation is less than or equal ton-1Then the median M of the wheelnFor M in the filtering windown-1Sampling value of the position before the position;
(3) if the input signal sampling value S at the N-th timen-NThe median M of the previous round of outputn-1Equal and present signal sample value SnLess than the median M obtained in the previous calculationn-1Then the statistical sampling value in the filtering window is Mn-1If the value is Mn-1Is 1, the median M of the wheelnFor M in the filtering windown-1Sampling value of the position before the position;
(4) if the conditions in the three steps are not met, the median M of the wheelnIs equal to Mn-1
(5) Sampling S of input signal at the N-th timen-NDeleting from the filtering window, i.e. deleting from the filtering window one and Sn-NElements having the same numerical value.
Step S150: sampling value S at the nth-w momentn-wAnd median MnAnd (5) making a difference, namely obtaining a corrected signal sampling value at the nth-w moment.
After step S150, steps S130, S140 and S150 may be repeated to finally obtain a corrected sampling sequence, and then a corrected continuous signal may be recovered according to the corrected sampling sequence, as shown in fig. 2.
The rapid baseline wander correction method provided by the embodiment has high operation speed, and the method only needs to be implemented
Figure BDA0001655242070000081
The I data can be corrected by comparing the I data, and the I x (2N +3) comparison can not be exceeded in the worst case. Meanwhile, frequent operations such as addition, subtraction, traversal and accumulation do not exist, and the cooperation of hardware is not relied on. In addition, the embodiment only occupies
Figure BDA0001655242070000082
Even if a larger filtering radius is selected, the memory unit does not occupy too much storage space, so that the method occupies less resources and is particularly suitable for the use of an embedded platform.
In summary, in the method for correcting signal baseline drift provided by this embodiment, the filtering window is divided into the preset number of sub-windows in advance, and each sub-window stores the sampling values in the non-intersecting numerical value range, so that when the sampling value is inserted, the corresponding sub-window can be determined according to the numerical value range of the sampling value to be inserted, and then the sampling value is inserted into the preset position of the sub-window. Therefore, the method can determine the sub-window according to the size of the sampling value to be inserted, and then insert the sampling value into the preset position, thereby avoiding comparing the sampling value with each sampling value in the filtering window in a large quantity, greatly reducing the complexity of the algorithm and saving the time.
The following describes a signal baseline wander correcting apparatus provided by an embodiment of the present invention, and the signal baseline wander correcting apparatus described below and the signal baseline wander correcting method described above may be referred to in correspondence.
Referring to fig. 3, the apparatus specifically includes:
the sampling module 310: the method is used for sampling a signal to obtain a plurality of sampling values, and the sampling value at the nth time is recorded as Sn
The filter window setting module 320: the method comprises the steps of presetting a filtering window, wherein the filtering window is divided into a preset number of sub-windows, each sub-window stores sampling values in a non-crossed numerical range, the sub-windows are arranged according to the numerical values of the sampling values stored in the sub-windows, the sampling values in the sub-windows are arranged according to the numerical values, the filtering window stores N-2 w +1 sampling values, and w is the filtering radius of the filtering window.
Insertion and deletion module 330: for dependent on the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-N
The median determination module 340: for determining interpolated sample values SnThen the median M of the sampled values in the filtering windown
The correction module 350: for sampling the value S at the n-w th timen-wAnd median MnAnd (5) making a difference, namely obtaining a corrected signal sampling value at the nth-w moment.
Wherein the apparatus comprises:
a filtering window initialization module: and the method is used for determining an initial value c according to the value range of the sampling value and inserting N initial values c into the filtering window.
Wherein the insertion deletion module comprises:
an insertion unit: for dependent on the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window;
a numerical value determination unit: for determining the sample value S with the most advanced sample time in the filter windown-NThe value of (d);
a sub-window determination unit: for measuring the value S of the samplen-NDetermining a corresponding sub-window according to the numerical range of the numerical value;
a deletion unit: for determining the sampling values S in the sub-windown-NAnd deleting the sampled value with the same value.
Wherein the median determination module comprises:
a positional relationship determination unit: for dependent on the value S of the samplenSampling value Sn-wAnd a median Mn-1Determining the magnitude relation of the interpolated sampled value SnThen the median M of the sampled values in the filtering windownAnd median Mn-1In which the median M isn-1To in the sampled value SnA median of the sample values within the filtering window prior to insertion into the filtering window;
a median determination unit: for obtaining median Mn-1And determining the median M according to the position relation and the position informationn
The apparatus for signal baseline wander correction of the present embodiment is used to implement the foregoing method for signal baseline wander correction, and therefore specific implementations of the apparatus can be seen in the foregoing portions of the embodiment for signal baseline wander correction, for example, the sampling module 310, the filtering window setting module 320, the insertion deletion module 330, the median determination module 340, and the correction module, which are respectively used to implement steps S110, S120, S130, S140, and S105 in the foregoing method for signal baseline wander correction. Therefore, specific embodiments thereof may be referred to in the description of the corresponding respective partial embodiments, and will not be described herein.
In addition, since the apparatus for signal baseline wander correction of this embodiment is used for implementing the foregoing method for signal baseline wander correction, its role corresponds to that of the foregoing method, and is not described herein again.
In addition, the invention also provides a device for correcting the signal baseline drift, which comprises:
a memory: for storing a computer program;
a processor: for executing the computer program to carry out the steps of a method of signal baseline drift correction as described above.
Finally, the present invention also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor implements the steps of a method of signal baseline drift correction as described above.
Since the present invention provides a signal baseline wander correcting apparatus and a computer readable storage medium for implementing the steps of the foregoing signal baseline wander correcting method, the functions thereof correspond to the functions of the foregoing signal baseline wander correcting method, and are not further described herein.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
A method, an apparatus, a device and a computer-readable storage medium for signal baseline wander correction provided by the present invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present invention without departing from the principle of the present invention, and these improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A method of signal baseline drift correction, comprising:
sampling the signal to obtain a plurality of sampling values, and recording the sampling value at the nth time as Sn
Presetting a filtering window, wherein the filtering window is divided into a preset number of sub-windows, each sub-window stores the sampling values in a non-crossed numerical range, the sub-windows are arranged according to the numerical values of the sampling values stored in the sub-windows, the sampling values in the sub-windows are arranged according to the numerical values, the filtering window stores N, 2w and +1 sampling values, and w is the filtering radius of the filtering window; the numerical range is a uniformly divided numerical segment or a non-uniformly divided numerical segment;
according to the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-N
Determining interpolated sample values SnThen the median M of the sampled values in the filtering windown
Sampling value S at the nth-w momentn-wAnd median MnAnd (5) making a difference, namely obtaining a corrected signal sampling value at the nth-w moment.
2. The method of claim 1, wherein the preset filtering window is divided into a preset number of sub-windows, each of the sub-windows stores the sampling values in a non-intersecting value range, the sub-windows are arranged according to the value sizes of the sampling values stored in the sub-window, the sampling values in the sub-windows are arranged according to the value sizes, the filtering window stores N-2 w +1 sampling values, wherein w is a filtering radius of the filtering window, and w is a value after S is the sampling value of the basis sampling valuenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the position with the most advanced sampling time in the filtering windowSampling value Sn-NPreviously, comprising:
and determining an initial value c according to the value range of the sampling value, and inserting N initial values c into the filtering window.
3. The method of claim 1, wherein the function is based on a sample value SnDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-NThe method comprises the following steps:
according to the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window;
determining the sample value S with the most advanced sampling time in the filtering windown-NThe value of (d);
according to the sampling value Sn-NDetermining a corresponding sub-window according to the numerical range of the numerical value;
determining the sampling value S in the sub-windown-NAnd deleting the sampled value with the same value.
4. A method according to any of claims 1-3, characterized in that the determination of the interpolated sample value S is performed bynThen the median M of the sampled values in the filtering windownThe method comprises the following steps:
according to the value S of the samplenSampling value Sn-wAnd a median Mn-1Determining the magnitude relation of the interpolated sampled value SnThen the median M of the sampled values in the filtering windownAnd median Mn-1In which the median M isn-1To in the sampled value SnA median of the sample values within the filtering window prior to insertion into the filtering window;
obtaining a median Mn-1And determining the median M according to the position relation and the position informationn
5. An apparatus for signal baseline drift correction, comprising:
a sampling module: the method is used for sampling a signal to obtain a plurality of sampling values, and the sampling value at the nth time is recorded as Sn
A filtering window setting module: the method comprises the steps that a filtering window is preset and divided into a preset number of sub-windows, sampling values in a non-crossed numerical range are stored in each sub-window, the sub-windows are arranged according to the numerical size of the sampling values stored in the sub-window, the sampling values in the sub-windows are arranged according to the numerical size, N is 2w +1 sampling values stored in the filtering window, and w is the filtering radius of the filtering window; the numerical range is a uniformly divided numerical segment or a non-uniformly divided numerical segment;
inserting and deleting modules: for dependent on the value S of the samplenDetermining corresponding sub-windows according to the value range, and sampling values SnInserting the preset position of the sub-window and deleting the sampling value S with the sampling time most ahead in the filtering windown-N
A median determination module: for determining interpolated sample values SnThen the median M of the sampled values in the filtering windown
A correction module: for sampling the value S at the n-w th timen-wAnd median MnAnd (5) making a difference, namely obtaining a corrected signal sampling value at the nth-w moment.
6. The apparatus of claim 5, wherein the apparatus comprises:
a filtering window initialization module: and the method is used for determining an initial value c according to the value range of the sampling value and inserting N initial values c into the filtering window.
7. The apparatus of claim 5, wherein the insert deletion module comprises:
an insertion unit: for dependent on the value S of the samplenThe value range ofCorresponding sub-window, sampling value SnInserting the preset position of the sub-window;
a numerical value determination unit: for determining the sample value S with the most advanced sample time in the filter windown-NThe value of (d);
a sub-window determination unit: for measuring the value S of the samplen-NDetermining a corresponding sub-window according to the numerical range of the numerical value;
a deletion unit: for determining the sampling values S in the sub-windown-NAnd deleting the sampled value with the same value.
8. The apparatus of any one of claims 5-7, wherein the median determination module comprises:
a positional relationship determination unit: for dependent on the value S of the samplenSampling value Sn-wAnd a median Mn-1Determining the magnitude relation of the interpolated sampled value SnThen the median M of the sampled values in the filtering windownAnd median Mn-1In which the median M isn-1To in the sampled value SnA median of the sample values within the filtering window prior to insertion into the filtering window;
a median determination unit: for obtaining median Mn-1And determining the median M according to the position relation and the position informationn
9. An apparatus for signal baseline drift correction, comprising:
a memory: for storing a computer program;
a processor: the steps of a method for executing the computer program to effect a signal baseline drift correction according to any one of claims 1-4.
10. A computer-readable storage medium, having a computer program stored thereon, which, when being executed by a processor, carries out the steps of a method of signal baseline drift correction according to any one of claims 1 to 4.
CN201810438245.0A 2018-05-09 2018-05-09 Method, device and equipment for correcting signal baseline drift Expired - Fee Related CN108634935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810438245.0A CN108634935B (en) 2018-05-09 2018-05-09 Method, device and equipment for correcting signal baseline drift

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810438245.0A CN108634935B (en) 2018-05-09 2018-05-09 Method, device and equipment for correcting signal baseline drift

Publications (2)

Publication Number Publication Date
CN108634935A CN108634935A (en) 2018-10-12
CN108634935B true CN108634935B (en) 2021-07-13

Family

ID=63753852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810438245.0A Expired - Fee Related CN108634935B (en) 2018-05-09 2018-05-09 Method, device and equipment for correcting signal baseline drift

Country Status (1)

Country Link
CN (1) CN108634935B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110082586B (en) * 2019-04-19 2021-06-11 西门子电力自动化有限公司 Method and device for correcting sampled data of power system
CN111953318B (en) * 2020-06-28 2021-04-13 上海定九康科技股份有限公司 Median filtering method and device adaptive to pipeline architecture and filter
CN113899963A (en) * 2021-08-30 2022-01-07 科华数据股份有限公司 Alternating current system interference electricity detection method and device and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009008582A (en) * 2007-06-29 2009-01-15 Shimadzu Corp Chromatogram data processor
CN102386889A (en) * 2011-09-29 2012-03-21 深圳Tcl新技术有限公司 Baseline drift removal method and device and median filter
CN103793886A (en) * 2014-02-14 2014-05-14 山东工商学院 Image median filtering method based on incomplete rapid sorting algorithm
CN104217408A (en) * 2014-09-30 2014-12-17 成都市晶林科技有限公司 Method for filtering and denoising images of uncooled infrared focal plane detector

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009008582A (en) * 2007-06-29 2009-01-15 Shimadzu Corp Chromatogram data processor
CN102386889A (en) * 2011-09-29 2012-03-21 深圳Tcl新技术有限公司 Baseline drift removal method and device and median filter
CN103793886A (en) * 2014-02-14 2014-05-14 山东工商学院 Image median filtering method based on incomplete rapid sorting algorithm
CN104217408A (en) * 2014-09-30 2014-12-17 成都市晶林科技有限公司 Method for filtering and denoising images of uncooled infrared focal plane detector

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种中值滤波的快速算法;朱冰莲 等;《信号处理》;20080831;第24卷(第4期);第684-686页 *

Also Published As

Publication number Publication date
CN108634935A (en) 2018-10-12

Similar Documents

Publication Publication Date Title
CN108634935B (en) Method, device and equipment for correcting signal baseline drift
Sameni et al. A nonlinear Bayesian filtering framework for ECG denoising
US10258250B2 (en) GPU-based parallel electrocardiogram signal analysis method, computer readable storage medium and device
CN104783780B (en) ECG De method and device
CN1291694C (en) Method for blood vessel photographic image process by digital reduction method
US5908393A (en) Reducing noise in a biological signal
CN107233093B (en) R wave detection method and device and electronic equipment
CN110680308A (en) Electrocardiosignal denoising method based on fusion of improved EMD and threshold method
KR20140139564A (en) Systems and methods for ecg monitoring
Singh et al. ECG signal denoising based on empirical mode decomposition and moving average filter
EP3716134A1 (en) Parallel analysis device for ecg signals, and method and mobile terminal
Lee et al. Periodicity-based nonlocal-means denoising method for electrocardiography in low SNR non-white noisy conditions
CN114521899B (en) Electrocardiosignal filtering method, electrocardiosignal filtering device, computer equipment and storage medium
US20190150778A1 (en) ECG Signal Parallel Analysis Apparatus, Method and Mobile Terminal
CN114795241B (en) Electrocardiosignal noise detection method and system
CN111631707A (en) Method, device and equipment for filtering baseline drift in electrocardiosignal and storage medium
CN110269608B (en) Method and device for removing signal interference and readable storage medium
CN115969398B (en) Blink detection method and device
CN111700610A (en) Method, device and system for analyzing electroencephalogram outbreak suppression mode and storage medium thereof
CN113616217B (en) Method and device for generating baseline drift curve
CN113786202B (en) Electrocardiogram characteristic starting point and ending point detection method, system, device and medium
WO2018023698A1 (en) Fetal-electrocardiogram separation method and device
CN108201437B (en) Signal processing method and device
CN109497995B (en) Electrocardiosignal R wave detection method, electrocardiosignal R wave detection equipment and computer readable medium
CN104902809B (en) Method and apparatus for reducing motion artifacts in ECG signals

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210713

CF01 Termination of patent right due to non-payment of annual fee