Summary of the invention
The purpose of this invention is to provide a kind of apparatus for testing gastric electricity of body surface, this instrument can carry out normal slow wave time-energy conjoint analysis to the electro-gastric signals that collects, and draws normal slow wave time-energy Joint Distribution figure, for the doctor provides more diagnosis reference informations.
For reaching above-mentioned purpose, apparatus for testing gastric electricity of body surface of the present invention comprises: the external electrode that is used to gather electro-gastric signals, the pre-process unit that the multi channel signals of gathering is carried out filtering, amplification, and the computer system that the EGG signal after pre-process is handled, wherein, described computer system comprises:
Be used for extracting the pretreatment and the signal extracting device of stomach electricity slow wave signal from the signal that collects computer system;
The power spectrum accountant, this power spectrum accountant divides frame with the stomach electricity slow wave signal that extracts, and adopts the power spectrum of estimating every frame data based on the chirp z transform method respectively, and storage;
Normal slow wave percentage of time accountant, this normal slow wave percentage of time accountant is found out the main frequency composition from the power spectrum of every frame data, calculate the energy of the main lobe energy of each main frequency composition as this frequency content, and with the energy percentage of each frequency content in frame as its percentage of time in this frame, calculate normal slow wave (0.04~0.06Hz) percentage of time in every frame data respectively with the method, and then will calculate normal slow wave percentage of time in the whole section stomach electricity slow wave signal divided by totalframes after the normal slow wave percentage of time summation of all frames, and storage;
Normal slow wave relative energy percentage calculation device, after this normal slow wave relative energy percentage calculation device is rejected cacorhythmic Frame earlier, calculate in the remainder data frame normal slow wave energy and account for the percentage ratio of gross energy, convert back again at the shared energy percentage of all Frames, as the relative energy percentage ratio of normal slow wave in the whole section stomach electricity slow wave signal;
Time-energy conjoint analysis device, this time-energy conjoint analysis device is that coordinate axes is set up two-dimensional coordinate system with normal slow wave percentage of time and normal slow wave relative energy percentage ratio, percentage of time and relative energy percentage ratio according to normal slow wave in the described stomach electricity slow wave signal are drawn a little in this coordinate system, determine according to this position in described coordinate system whether the stomach electricity rhythm and pace of moving things is normal;
Be used to export the display and/or the printer of testing result.
Above-mentioned pretreatment and signal extracting device can adopt following design, comprise the signal extraction device, WTMM (wavelet transformation modulus maximum) rebuilds and removes the motion artifacts device, by breathing first extraction element that artefact is removed the unit and adopted the signal extraction unit formation of traditional IC A (independent component analysis) method, adopt second extraction element of traditional IC A method, adopt the 3rd extraction element of ICA-r (independent component analysis of band reference signal) method, the signal that collects computer system through the signal extraction device extract to sample frequency be 4Hz, after WTMM rebuilds removal motion artifacts device removal motion artifacts, select first extraction element again according to breathing the interferential size of artefact and electrocardio in the signal, second extraction element or the 3rd extraction element extract stomach electricity slow wave signal.
Further, when above-mentioned power spectrum accountant is estimated the power spectrum of every frame data in employing respectively based on the chirp z transform method, introduced the Welch method power spectrum is carried out smoothly, this power spectrum accountant specifically calculates the power spectrum of every frame data by the following method:
Every frame data are divided into the K section of equal length, estimate the power spectrum of every segment data by formula (3),
In the formula (3), L is every section a length, and d (n) is a window function, and x (n) is a signal, and U is a normalization factor, and U through type (4) calculates,
At last, by formula (5)
To own
Be averaged, just obtain the power spectrum behind this frame data level and smooth
Further, the computer system of apparatus for testing gastric electricity of body surface of the present invention can also comprise dominant frequency accountant and/or the unstable coefficient calculation means of dominant frequency, so that provide more reference informations to diagnosis.Wherein, the dominant frequency accountant is estimated by the stomach electricity slow wave signal that extracts is done spectrum, obtains the dominant frequency of this stomach electricity slow wave signal, and storage.The unstable coefficient calculation means of dominant frequency is by being divided into the stomach electricity slow wave signal that extracts some frames of equal in length, respectively every frame data are done the dominant frequency that spectrum estimates to obtain every frame data, calculate the standard deviation and the average of all Frame dominant frequency, with the ratio of described standard deviation and average the unstable coefficient of dominant frequency as this section stomach electricity slow wave signal, and storage.
This body surface apparatus for testing gastric electricity has been used the notion of the normal slow wave energy percentage of stomach electricity, and combine with traditional normal slow wave percentage ratio (also being normal slow wave percentage of time), the normal slow wave time one energy conjoint analysis method of stomach electricity is proposed, instrument of the present invention utilizes this conjoint analysis method to analyze distribution situation on normal slow wave time of stomach electricity and the energy in two-dimensional coordinate system, draw the normal slow wave of stomach electricity time-energy conjoint analysis figure, for diagnosis provides reference information intuitively.
This body surface apparatus for testing gastric electricity can also analyze the dominant frequency of stomach electricity slow wave signal, normal slow wave percentage ratio, the unstable coefficient of dominant frequency etc., for diagnosis provides more reference informations.
Its power spectrum accountant adopts the method power estimator signal spectrum based on chirp z transform, and introduces the Welch method power spectrum is carried out smoothly, can satisfy high frequency resolution and the accurately requirement of estimated energy simultaneously.
Its signal extracting device adopts classification extraction method, when near the quality of the piezoelectric signal that records breathing the serious and umbilical part of artefact in the signal is also undesirable, adopts the ICA-r method that iterative process is complicated, convergence rate is slower to extract stomach electricity composition; When breathing artefact in the signal does not have serious disturbance than near piezoelectric signal serious but that record the umbilical part, can adopt the adaptive noise cancellation method to remove earlier and breathe artefact, the electric composition of reuse traditional IC A method extraction stomach; Disturb when not serious when breathing artefact and electrocardio in the signal, promptly can find out the rhythm and pace of moving things of stomach electricity slow wave from the waveform, then directly adopt traditional IC A method to extract stomach electricity composition, make and to extract stomach electricity composition more exactly, can reduce requirement again, raising speed to processor and internal memory.
The specific embodiment
With reference to Fig. 1, this body surface apparatus for testing gastric electricity comprises the external electrode that is used to gather electro-gastric signals, the multi channel signals of gathering is carried out filtering, the pre-process unit that amplifies, and the computer system that the EGG signal after pre-process is handled, wherein, described computer system comprises pretreatment and signal extracting device, the power spectrum accountant, normal slow wave percentage of time accountant, normal slow wave relative energy percentage calculation device, time-energy conjoint analysis device, the dominant frequency accountant, the unstable coefficient calculation means of dominant frequency and the display and/or the printer that are used to export testing result.
One, pretreatment and signal extracting device: digital signal filter and electro-gastric signals extract.
This body surface apparatus for testing gastric electricity is gathered 4 passage EGG signals, and the sample frequency of acquired signal is 20Hz.
Pretreatment and signal extracting device comprise the signal extraction device, WTMM motion artifacts removal device, remove first extraction element that the signal extraction unit of unit and employing traditional IC A method constitutes by breathing artefact, adopt second extraction element of traditional IC A method, adopt the 3rd extraction element of ICA-r method, the input computer system the EGG signal through the signal extraction device extract to sample frequency be 4Hz, after WTMM rebuilds removal motion artifacts device removal motion artifacts, select first extraction element again according to breathing the interferential size of artefact and electrocardio in the signal, second extraction element or the 3rd extraction element extract stomach electricity slow wave signal.Referring to Fig. 2, pretreatment and signal extracting device are as follows to the concrete handling process of the EGG signal of input:
1) carries out signal extraction earlier.For avoiding frequency alias, elder generation by behind the low pass filter of cut-off frequency 2Hz, extracts it to sample frequency 4Hz again.
2) motion artifacts in the acquired signal is a jump signal, can influence the result of adaptive noise cancellation, independent component analysis (ICA) scheduling algorithm, thereby will remove in advance, and the method that adopts wavelet transformation modulus maximum (WTMM) to rebuild is removed.
3) ensuing problem is to extract stomach electricity composition from the EGG signal of 4 passages.Can finish by 3 approach in this course, its selection scheme is as follows:
A) if breathing artefact and electrocardio in the original signal disturbs not seriously, promptly can find out the rhythm and pace of moving things of stomach electricity slow wave from the waveform, can directly adopt the method for traditional IC A.
B) if breathe artefact serious (the degree breathing different with the experimenter of breathing artefact is accustomed to relevant) in the original signal, if do not have serious disturbance in the piezoelectric signal that record this moment near umbilical part, can adopt the adaptive noise cancellation method to remove earlier and breathe artefact (a part of sometimes electrocardio disturbs and also can remove) in this step.But this method often can not be removed the breathing artefact fully, and has just weakened the breathing artefact composition in the signal.So when the signal after this process is ICA, select the port number of ICA output according to practical situation.
C) more serious if breathe artefact in the original signal, if near the quality of the piezoelectric signal that records the umbilical part this moment is also undesirable, will adopt independent component analysis (ICA-r) method of band reference signal, directly obtain stomach electricity composition.Why whole data all not being adopted the ICA-r method, is that convergence rate is slower because this algorithm iteration process is complicated.
4) the stomach electricity composition that is obtained by top process sometimes also can contain slight High-frequency Interference, thereby needs to obtain the signal that needs at last by a simple low pass filter.
Two, power spectrum accountant: adopt method power estimator signal spectrum, introduce the Welch method power spectrum is carried out smoothly based on chirp z transform.
Briefly, usually the discrete Fourier transform (DFT) that adopts (Discrete Fourier Transform is DFT) to N0When the signal of point was done transform, change point was the N that is positioned on the z-plane unit circle0Individual equidistant point, its frequency resolution is fs/ 2N0(fsBe sample frequency).And CZT (chirp z transform) is when doing transform to signal, and transform path can be any helix on the z-plane; And conversion is counted and not limited by data length.If the CZT transform path is limited on one section circular arc of unit circle, select the suitable conversion M that counts, just can obtain higher frequency resolution.The present invention is exactly these characteristics of utilizing CZT, reaches the purpose of careful observation stomach electricity slow wave dominant frequency slight change.
Reference is based on the period map method in the Classical Spectrum method of estimation of FFT, by the M point chirp z transform CZT of signal x (n)MThe power spectrum that [x (n)] estimates x (n) is
Same with reference to classical power Spectral Estimation, introduce the level and smooth power spectrum of Welch method, smoothly the power spectrum after is designated as
(1) the power spectrum variance characteristic that estimates of formula is relatively poor, thereby introduces the level and smooth power spectrum of Welch method.With the data segmentation, every segment length L if adjacent two segment datas overlap half, can be divided into the K section
After every segment data windowing,, be designated as by (1) formula estimated power spectrum
Wherein d (n) is a window function, and this paper selects Gaussian window for use; U is a normalization factor, guarantees that the spectrum that obtains is that progressive nothing is estimated partially
At last, will own
Be averaged, just obtain the power spectrum after level and smooth
Selection L is half of data length, i.e. L=N/2, then K=3 among the present invention.The frequency range of CZT be chosen as 0~0.4Hz (0~24cpm), the CZT M=1024 point of counting, frequency resolution can reach in theory
Simultaneously, compare with parameter spectrum method of estimation, the CZT and the FFT that are limited on the unit circle equally are the Energy distribution of direct expression signal in frequency domain, thereby CZT also has the accurately advantage of estimated signal energy.Like this, the spectrum method of estimation based on CZT just satisfies high frequency resolution and accurately 2 requirements of estimated energy simultaneously.Fig. 3 a is depicted as the stomach electricity data of a frame length 120s, and Fig. 3 b is the power spectrum that application formula (5) obtains.
Three, normal slow wave percentage of time accountant: calculate the normal slow wave percentage of time of stomach electricity according to power spectrum.
Calculating for slow wave rhythm and pace of moving things percentage of time, in traditional method, frame data can only be defined as normal slow wave or certain unusual slow wave according to its power spectrum, and do not have intermediateness, be the system of selection of a kind of " all or none ", this will cause losing of some information.
The present invention is when calculating normal slow wave percentage of time, with the ratio of their time of ratio replacement of the energy of each main frequency composition in every frame.The prerequisite of this method is that the amplitude of slow wave is close, and the big multipotency of stomach electricity of body surface detection signal satisfies this condition.Concrete grammar is as follows:
1) behind the data framing, estimates the power spectrum of every frame data;
2) find out main frequency composition in the power spectrum, calculate the energy of the main lobe energy of each composition as this composition;
3) with the energy percentage of each frequency content in this frame as its percentage of time in this Frame.Promptly make denominator with the energy summation of all main frequency compositions, then the energy percentage of each frequency content is exactly the ratio of its main lobe energy and denominator, with the approximate percentage of time that replaces of this energy percentage;
4) the normal slow wave percentage of time summation back with all frames calculates normal slow wave percentage of time in the whole section stomach electricity slow wave signal divided by totalframes.
With data instance shown in Fig. 3 a, at first adopt formula (5) estimated power spectrum, shown in Fig. 3 b; Two high peaks are arranged in the power spectrum, and the corresponding normal respectively slow wave and the slow wave of overrunning, their main lobe energy are respectively the area of area I and II among Fig. 3 c, are designated as P respectively1And P2The percentage of time tp of the normal slow wave of these frame data thenNormalPercentage of time tp with tachygastriaTachyEnergy percentage with them replaces respectively, is exactly
With
For whole segment data, hypothetical data is divided into N frame, wherein NaThe power spectrum of frame does not have obvious peak value, is the irregularity of pulse slow wave; Use PI, jRepresent the energy of j frequency content of i frame data.The normal slow wave percentage ratio that then normal slow wave percentage of time should be each frame is sued for peace the back divided by N
(P whereinI, j)NormalRefer to PI, jMiddle respective frequencies drops on the part in normal range.(7) the formula bracket is inner divides expression i the percentage ratio of normal slow wave on energy of frame data, is used for being similar to the percentage of time that replaces normal slow wave.
In like manner can obtain the percentage of time of whole segment data bradygastria and tachygastria, repeat no more.Putting in order the cacorhythmic percentage of time of segment data is, the percentage ratio of cacorhythmic frame number in the total data frame number, promptly
Four, normal slow wave relative energy percentage calculation device; After this device is rejected cacorhythmic Frame earlier, calculate in the remainder data frame normal slow wave energy and account for the percentage ratio of gross energy, convert back again at the shared energy percentage of all Frames, as the relative energy percentage ratio of normal slow wave in the whole section stomach electricity slow wave signal.Concrete grammar is as follows:
The present invention proposes the notion of slow wave energy percentage, is exactly that normal (or unusual) slow wave energy is at the whole shared percentage ratio of segment data.Because there is interference of noise, thus the gross energy of the energy of whole segment data can not be used as slow wave, and with all PI, jSum is as slow wave gross energy, PI, jMeaning identical with a last trifle.(power percentage PP) is the energy percentage of normal slow wave
But because the frequency spectrum of irregularity of pulse slow wave does not have obvious peak value, the denominator of following formula part has just been ignored the energy of irregularity of pulse slow wave, also can't calculate the energy percentage of irregularity of pulse slow wave.That is to say, if whole segment data is divided into N frame, wherein NaFrame is the irregularity of pulse slow wave; The PP that obtains of (9) formula soNormalOnly be that normal slow wave is at N-NaEnergy percentage in the frame, improved method is exactly again with PPNormalBe converted to percentage ratio, even PP at all N framesNomalMultiply by (N-Na)/N is modified to relative energy percentage ratio, obtain normal slow wave relative energy percentage ratio (reletive power percentage R-PP) is:
Wherein, TPArrhyIt is the irregularity of pulse slow wave percentage of time that obtains by (8) formula.(10a) formula is just ignored the irregularity of pulse part earlier, calculates the energy percentage of normal slow wave in remaining Frame, this percentage ratio is converted to the ratio in all Frames again.
By above-mentioned discussion, the normal slow wave relative energy percentage ratio (R-PP) of stomach electricity can be defined as:
After stomach electricity slow wave being carried out the branch frame when analyzing, rejecting cacorhythmic Frame earlier, calculate the percentage ratio that normal slow wave energy in the remainder data frame accounts for gross energy, convert back again at the shared energy percentage of all Frames, be relative energy percentage ratio.Make a comment or criticism normal slow wave energy, bradygastria slow wave energy and tachygastria slow wave energy sum of gross energy wherein.
The computing formula of normal slow wave relative energy percentage ratio is:
In like manner can define bradygastria relative energy percentage ratio and tachygastria relative energy percentage ratio.
The percentage of time (TP) of normal slow wave and relative energy percentage ratio (R-PP) representative be respectively in the whole segment data normally slow wave in time with energy on ratio.Relatively both as can be seen, if the amplitude of all kinds of slow wave rhythm and pace of moving things (normal, cross and delay, overrun) is identical, TP thenNormalWith R-PPNormalShould equate, if TPNormalGreater than R-PPNormal, normal in other words slow wave ratio in time is higher than the ratio on the energy, illustrates that the unit interval energy (amplitude) of normal slow wave is less than the unit interval energy (amplitude) of unusual slow wave, and vice versa.This result can help to examine or check stomach electricity slow wave amplitude distribution situation.
Five, the normal slow wave percentage of time of calibration
When stomach electricity slow wave amplitude differed big, deviation can appear in TP computational methods set forth above, and R-PP still can obtain result more accurately, thereby can utilize a simulate signal model that TP is simply calibrated.Through simulation calculation, adopt following formula to correct
x=(5.55x0-y0)/4.55 (11)
X wherein0Be the TP before correcting, y0Be R-PP, x is the TP after correcting.
Six, time-energy conjoint analysis device: this device is that coordinate axes is set up two-dimensional coordinate system with normal slow wave percentage of time (TP) and normal slow wave relative energy percentage ratio (R-PP), percentage of time and relative energy percentage ratio according to normal slow wave in the described stomach electricity slow wave signal are drawn a little in this coordinate system, determine according to this position in described coordinate system whether the stomach electricity rhythm and pace of moving things is normal.Specific as follows:
TP and R-PP are combined, draw the normal slow wave of stomach electricity time-energy conjoint analysis figure, can be to the electro-gastric signals time of doing-energy conjoint analysis.Fig. 4 be about 33 routine length 20min stomach electricity data time-energy conjoint analysis figure.Referring to Fig. 5, normal slow wave percentage of time is a transverse axis, and normal slow wave relative energy percentage ratio is the longitudinal axis.Usually the variation of the amplitude of slow wave can be very not greatly, near the band that data point can be distributed in the diagonal is interior (as Fig. 5 a), suppose according to clinical empirical summary, the normality threshold that TP and R-PP are set is Th1 and Th2 (as Fig. 5 b), so in Fig. 5 c, the TP in I district and R-PP are lower than normality threshold, have represented stomach electricity allorhythmia; The TP in III district and R-PP are higher than normality threshold, and are distributed near the diagonal, have represented the stomach electricity rhythm and pace of moving things normal; And for the data that drop on the II district, though there is one to be higher than normality threshold among TP and the R-PP, it is far away excessively to depart from diagonal, have the need for further discussion, might be that slow wave itself is unusual, also might be the too much interference of having mixed in gathering body surface stomach electric process, needs to gather again.
Seven, dominant frequency accountant, this device are estimated by the stomach electricity slow wave signal that extracts is done spectrum, obtain the dominant frequency of this stomach electricity slow wave signal, and storage.
Eight, the unstable coefficient calculation means of dominant frequency, this device is divided into the stomach electricity slow wave signal that extracts some frames of equal in length, respectively every frame data are done the dominant frequency that spectrum estimates to obtain every frame data, calculate the standard deviation and the average of all Frame dominant frequency, with the ratio of described standard deviation and average the unstable coefficient of dominant frequency as this section stomach electricity slow wave signal, and storage.
This instrument is except that adopting conventional slow wave dominant frequency and normally parameters such as slow wave percentage ratio, dominant frequency instability factor are estimated the stomach function, the new ideas of normal slow wave energy percentage have also been used, draw normal slow wave time-energy Joint Distribution figure, more diagnosis reference informations are provided.