The specific embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The bio electricity that the embodiment of the invention is addressed is produced by the biological cell electrical activity, comprises electrocardio, brain electricity, myoelectricity, neuroelectricity, stomach electricity and eye electricity or the like.
The bio electricity sampled signal generally is meant through electrode or sensor acquisition in the embodiment of the invention, the digital signal that obtains through simulation amplification, analog filtering and analog digital conversion then.
During hereinafter was described, this bio electricity sampled signal was a primary signal, and bioelectrical signals is treated signal.
Fig. 3 is the processing of bioelectric signals method flow diagram of the embodiment of the invention.Fig. 4 is the polarizing voltage detection method flow chart of the embodiment of the invention.With reference to Fig. 3 and Fig. 4, the processing of bioelectric signals method of the embodiment of the invention comprises the steps:
S00, initialization.
Present embodiment preferably adopts this step.In certain embodiments, other parameters can be called, this step can be omitted.
All high pass filters that use in the present embodiment are digital filter, therefore, can conveniently carry out parameter adjustment according to different bioelectrical signals, and can realize digitized processing, reduce the instrument volume.
The present embodiment preferably formula of these all digital filters is Y (N)=c2*Y (N-1)+c1* (X (N)-X (N-1)), and c1, c2 are parameter, and the span of c1, c2 is greater than 0 less than 1.The different filter difference is that c1 and c2's is different.Y (N) is a N point filter process end value, and Y (N-1) is a N-1 point filter process end value, and X (N) is a N point wave filter input value, and X (N-1) is a N-1 point wave filter input value, to reach the purpose that operand is few, efficient is high.
For the 3rd high pass filter, N point filter process end value is the bioelectrical signals that N is ordered, and N point wave filter input value is the bio electricity sampled signal that N is ordered.The processing costs of first high pass filter and second high pass filter directly is not used for output, but is used to transmit parameter, and this also is one of bright spot of the present invention.
Preferred first high pass filter of present embodiment, second high pass filter and the 3rd high pass filter use together; Concrete use face is in detail as follows described; So that the bioelectrical signals that obtains after handling shows and is more stable with that minimizing simultaneously is wrong to be shown, reduces probability of miscarriage of justice more clear.
In certain embodiments, can not need first high pass filter and second high pass filter, effect can be poorer slightly like this, and at this moment, X (N-1), Y (N-1) are the input and output the last with current process points the 3rd high pass filter.
C1, the c2 of main initialization first high pass filter, second high pass filter and the 3rd high pass filter in this step.Present embodiment is the following parameter of example initialization with the processing cardioelectric signals: the c1 of said first high pass filter is 0.8878, c2 is 0.7757; The c1 of said second high pass filter is 0.9408, c2 is 0.8816; The c1 of said the 3rd high pass filter is 0.9998, c2 is 0.9997; Can more remove polarizing voltage with putting in place, reflect desired data more truly.
In this step, also initialization detects the endpoint value that whether has polarizing voltage, and is more accurate in order to make detection.
In this step, also make other parameters return to initial value, for example, Y (0), X (0) that the 3rd high pass filter or first high pass filter are initial, generally this Y (0), X (0) they are zero, can certainly make other numerical value as required into, conveniently to begin this processing.
S10, reception bio electricity sampled signal.
Receive bio electricity sampled signal (primary signal), generally have a buffer to preserve, so that follow-up use.Digitized processing for ease, this bio electricity sampled signal is generally digital signal.
Whether S20, detection current sampling point exist polarizing voltage.If not, execution in step S30; If, execution in step S40;
See also Fig. 4, whether this detection current sampling point exists the method for polarizing voltage following:
S21, judge in the bio electricity sampled signal with the current sampling point be starting point back relate T in the time slope greater than first quantity of the sampled point of first threshold whether greater than M; If not, execution in step S24; If, execution in step S22;
This step is at first calculated the slope of sampled point in this T time, adds up slope then greater than i.e. first quantity of the quantity of the sampled point of first threshold, and this first quantity is judged greater than M in the back whether again, and is last, according to this judged result, selects to go on foot down treatment step.
The slope calculating formula of this current sampled point does | d [i]-d [i-1] |, d [i] is the sampled value of current sampling point, d [i-1] is the sampled value of a sampled point before the current sampling point; Therefore, for first sampled point, during slope calculations, just need the value of initialization d [0], generally the value of this d [0] is 0, certainly, also can make other value as required into, otherwise error message can occur.
The span of T be 5ms to 21ms, the value of M is 4 or 3 or 2, the span of said first threshold is 60 to 168.Preferred this first threshold is 166.7 in the present embodiment, and this T is 10ms, and this M value is 2, can reduce operand, saves time.
If the time span between current sampling point and the sampled signal starting point during less than 10ms, is handled as object with the sampled point between current sampling point and the starting point.
S22, judge sampled value in this T time greater than second quantity of second threshold value whether greater than N; If not, execution in step S24; If, execution in step S23;
At first statistic sampling value of this step slope is second quantity greater than the quantity of the sampled point of second threshold value, whether judges this second quantity then greater than N, at last according to this judged result, selects step treatment step down.
This second threshold value is the half the of first threshold, and the value of this N is 4 or 3 or 2.Present embodiment is preferred, and this second threshold value is 83.35, and this N value is the same with the M value to be 2.
S23, provide the information that there is polarizing voltage in current sampling point;
S24, provide the information that there is not polarizing voltage in current sampling point.
To whether there be the information output of polarizing voltage through step S23, S24.
S30, when receiving current sampling point when not having the information of polarizing voltage; It is that the 3rd high pass filter of PHz carries out Filtering Processing that the bio electricity sampled signal of current sampling point is adopted cut-off frequency; Obtain the bioelectrical signals and the output of this current sampled point, then to next sampled point execution in step S20.
The 3rd high pass filter is to be used for other interference of filtering, and preferably the span 0.04Hz of the cut-off frequency PHz of the 3rd high pass filter is to 0.06Hz.The formula of the 3rd high pass filter is Y (N)=0.9998*Y (N-1)+0.9997* (X (N)-X (N-1)), and this moment, this cut-off frequency PHz was 0.05Hz, had better effect.
S40, current sampling point are starting point T1 in the time backward, and the bioelectrical signals of all sampled points all is treated to " 0 " and output.
When if there is polarizing voltage in current sampling point; Generally can think from moment of current sampling point sternward the bio electricity sampled signal that receives in the time of T1 all have the polarizing voltage signal; Therefore; These sampled points are composed the processing of " 0 " value and should the output of " 0 " value be become these sampled point bioelectrical signals, eliminate polarizing voltage and eliminated the interference of polarizing voltage follow-up electrocardiosignal.The scope of this T1 time be 160ms to 240ms, the preferred 200ms of present embodiment reaches output bioelectrical signals fast and stable and display waveform effect clearly.
The processing of bioelectric signals method of present embodiment all needs certain hour from detecting processing, and therefore have when having beginning for polarizing voltage and handle untimely phenomenon, the very high black region of amplitude the during beginning of Fig. 7 the inside for example, this allows.Fig. 7 is the bioelectrical signals oscillogram after handling through embodiment of the invention processing of bioelectric signals method.
S50, to the preceding T2 of said T1 time in the time sampled point to adopt cut-off frequency successively be that first high pass filter filters of RHz is handled, and send last processing costs to second high pass filter, be used to dispose second high pass filter; Then to said T1 in remaining time time sampled point to adopt cut-off frequency successively be that second high pass filter filters of SHz is handled, and send last processing costs to said the 3rd high pass filter, be used to dispose the 3rd high pass filter.
This step is the step that present embodiment preferably adopts, and can not have in certain embodiments.Adopt the advantage of this step to be; When if there is not polarizing voltage in first sampled point of this T1 after the time; Formula according to top digital filter can be known; Y that handles the 3rd high pass filter (N-1) and X (N-1) value to this first sampled point just can obtain through first high pass filter and second high pass filter, have guaranteed the continuity of waveform and the relatedness before and after the signal, improve processing accuracy.
The value size of T2 also is clearly to result in the present embodiment, and the span 78ms of T2 is to 129ms, and preferred T2 is 100ms.The span of general this R is 36 to 46, the span of S is 16 to 26, has reached better transmission parameter effect.
The formula of preferred first high pass filter is Y (N)=0.8878*Y (N-1)+0.7757* (X (N)-X (N-1)), and this moment, this cut-off frequency RHz was 40Hz.
The formula of preferred second high pass filter is Y (N)=0.9408*Y (N-1)+0.8816* (X (N)-X (N-1)), and this moment, this cut-off frequency SHz was 20Hz.
Choosing of this first high pass filter and second high pass filter is in order to obtain treatment effect preferably.
S60, to first the sampled point execution in step S20 of said T1 after the time.
Guaranteed the continuity of handling like this, can not occur being interrupted.
Fig. 5 is the processing of bioelectric signals equipment structure chart of the embodiment of the invention.Fig. 6 is the structure chart of the polarizing voltage detection module of the embodiment of the invention.With reference to Fig. 5, Fig. 6, a kind of processing of bioelectric signals equipment of the embodiment of the invention is proposed.This equipment comprises receiver module 100, polarizing voltage detection module 200, the 3rd high pass filter 300, polarization processing module 400, first high pass filter 500 and second high pass filter 600.
This receiver module 100 is used to receive the bio electricity sampled signal; The bio electricity sampled signal (primary signal) that receives generally has a buffer to preserve, so that follow-up use.Digitized processing for ease, this bio electricity sampled signal is generally digital signal.
This polarizing voltage detection module 200 is connected with receiver module 100, is used for detection of biological electricity sampled signal and whether has polarizing voltage;
The said polarizing voltage detection module 200 of present embodiment comprises computing unit 210, first judging unit 220, second judging unit 230, first output unit 240 and second output unit 250.
This computing unit 210 is connected with receiver module 100, is used to calculate the slope of bio electricity sampled signal.
The formula of the slope calculations of this computing unit 210 does | d [i]-d [i-1] |, d [i] is the sampled value of current sampling point, d [i-1] is the sampled value of a sampled point before the current sampling point; For first sampled point, during slope calculations, just need the value of initialization d [0]; The value of general this d [0] is 0; Certainly, also can make other value as required into, otherwise error message can occur; Therefore, the processing of bioelectric signals equipment of present embodiment need carry out initialization when bringing into use.
Because the high pass filter of the embodiment of the invention is digital filter; The formula of this digital filter is: Y (N)=c2*Y (N-1)+c1* (X (N)-X (N-1)), and Y (N) is a N point filter process end value, Y (N-1) is a N-1 point filter process end value; X (N) is a N point wave filter input value; X (N-1) is a N-1 point wave filter input value, and c1, c2 are parameter, and the span of c1, c2 is greater than 0 less than 1; So when initialization, need carry out initialization to parameters such as the c1 of each high pass filter, c2.
This first judging unit 220 is connected with computing unit 210, be used to judge slope in the continuous T time greater than first quantity of the sampled point of first threshold whether greater than M.
This successive T time present embodiment is meant with the current sampling point to be the T time that starting point is back related.
It is first quantity greater than the quantity of the sampled point of first threshold that this first judging unit 220 needs elder generation's statistics slope, and the back judges that whether this first quantity is greater than M again.The span of T be 5ms to 21ms, the value of M is 4 or 3 or 2, the span of said first threshold is 60 to 168.Preferred this first threshold is 166.7 in the present embodiment, and this T is 10ms, and this M value is 2, can reduce operand, saves time.If the time span between current sampling point and the sampled signal starting point is during less than 10ms, the computing unit 210 and first judging unit 220 are handled as object with the sampled point between current sampling point and the starting point.
This second judging unit 230 is connected with first judging unit 220, is used for when first judging unit 220 output " being ", judge sampled value in the said T time greater than second quantity of the sampled point of second threshold value whether greater than N;
It is second quantity greater than the quantity of the sampled point of second threshold value that this second judging unit 230 needs at first statistic sampling value slope, judges that then whether this second quantity is greater than N.
This second threshold value is the half the of first threshold, and the value of this N is 4 or 3 or 2.Present embodiment is preferred, and this second threshold value is 83.35, and this N value is the same with the M value to be 2.
This first output unit 240 is connected with second judging unit 230 with first judging unit 220, is used for when first judging unit 220 or 230 outputs " denying " of second judging unit, providing the information that there is not polarizing voltage in current sampling point;
Second output unit 250 is connected with second judging unit 230, is used for when 230 outputs " being " of second judging unit, providing the information that there is polarizing voltage in the bio electricity sampled signal.
This polarizing voltage detection module 200 is exported testing result through first output unit 240, second output unit 250.
The 3rd high pass filter 300; Cut-off frequency is PHz; Be connected with polarizing voltage detection module 200 with receiver module 100; Be used for when there is not polarizing voltage in detection of biological electricity sampled signal, the bio electricity sampled signal of said detection being carried out Filtering Processing, and export the bioelectrical signals after this sampled point is handled;
The 3rd high pass filter 300 is to be used for other interference of filtering, and preferably the span 0.04Hz of the cut-off frequency PHz of the 3rd high pass filter 300 is to 0.06Hz.The formula of the 3rd high pass filter 300 is Y (N)=0.9998*Y (N-1)+0.9997* (X (N)-X (N-1)), and this moment, this cut-off frequency PHz was 0.05Hz, had better effect.
This processing module 400 that polarizes; Be connected with polarizing voltage detection module 200 with receiver module 100; Be used for when there is polarizing voltage in detection of biological electricity sampled signal; There to be the polarizing voltage sampled point is starting point T1 in the time backward, and the bioelectrical signals of all sampled points all is treated to " 0 " and output;
When if there is polarizing voltage in current sampling point; Generally can think from moment of current sampling point sternward the bio electricity sampled signal that receives in the time of T1 all have the polarizing voltage signal; Therefore; These sampled points are composed the processing of " 0 " value and should the output of " 0 " value be become these sampled point bioelectrical signals, eliminate polarizing voltage and eliminated the interference of polarizing voltage follow-up electrocardiosignal.The scope of this T1 time be 160ms to 240ms, the preferred 200ms of present embodiment reaches output bioelectrical signals fast and stable and display waveform effect clearly.
This first high pass filter 500; Cut-off frequency is RHz; Be connected with second high pass filter 600 with polarization processing module 200; Be used for preceding T2 to the said T1 time in the time sampled point carry out Filtering Processing successively, and send last processing costs to second high pass filter, be used to dispose second high pass filter;
This second high pass filter 600; Cut-off frequency is SHz; Be connected with the 3rd high pass filter 300 with first high pass filter 500; Be used for to said T1 in remaining time time sampled point carry out Filtering Processing successively, and send said last processing costs of second high pass filter to said the 3rd high pass filter 300, be used to dispose the 3rd high pass filter 300.
This first high pass filter 500 and second high pass filter 600 are modules that present embodiment preferably adopts; Adopt the advantage of these two high pass filters to be; When if there is not polarizing voltage in first sampled point of this T1 after the time; Formula according to top digital filter can be known; Y that handles the 3rd high pass filter (N-1) and X (N-1) value to this first sampled point just can obtain through first high pass filter and second high pass filter, have guaranteed the continuity of waveform and the relatedness before and after the signal, improve processing accuracy.
Can not have this two high pass filters in certain embodiments, effect can be poorer slightly like this, and at this moment, X (N-1), Y (N-1) are the input and output the last with current process points the 3rd high pass filter.
The value size of T2 also is clearly to result in the present embodiment, and the span 78ms of T2 is to 129ms, and preferred T2 is 100ms.The span of general this R is 36 to 46, the span of S is 16 to 26, has reached better transmission parameter effect.
The formula of preferred first high pass filter 500 is Y (N)=0.8878*Y (N-1)+0.7757* (X (N)-X (N-1)), and this moment, this cut-off frequency RHz was 40Hz.
The formula of preferred second high pass filter 600 is Y (N)=0.9408*Y (N-1)+0.8816* (X (N)-X (N-1)), and this moment, this cut-off frequency SHz was 20Hz.
Choosing of this first high pass filter and second high pass filter is in order to obtain treatment effect preferably.
Fig. 7 is the bioelectrical signals oscillogram after the processing of bioelectric signals method and apparatus of present embodiment is handled, and this figure can obtain through the MATLAB simulation.From Fig. 7, can obtain, this bioelectrical signals waveform is just stable in the time less than 2S, has shortened much than 10S in the prior art.Simultaneously, baseline drift does not take place and does not have compression amplitude in this bioelectrical signals waveform, can the normal bioelectrical signals of clear reflection.Therefore, the present invention makes output bioelectrical signals clear display and fast and stable through detecting automatically and handling polarizing voltage, has solved the prior art problem.
More than processing of bioelectric signals method and apparatus provided by the invention has been carried out detailed introduction; Used concrete example among this paper principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand core concept of the present invention; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that on the specific embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.