The invention pertains to a method for detecting respiratory cycles in a stethoscope signal. In medicine, it is conventional to practice pulmonary auscultation using a stethoscope in order to obtain information on the physiology and pathologies of a patient's lungs and air passages. A physician seeks out particular sounds called markers, particularly sounds known as sibilant rales, crepitant rales, etc., in order to diagnose pathologies such as asthma or chronic obstructive pulmonary disease. Although conventional auscultation using a stethoscope is subjective and difficult to share, an electronic respiratory sound capture-and-analysis system should make it possible to assist the physician in performing an objective, timely diagnosis, thanks to its greater sensitivity and superior results reproducibility.
Creating such a system presents a problem in detecting respiratory cycles; more precisely, it is necessary to detect an interval of time corresponding to an inhalation phase, and another interval of time corresponding to an exhalation phase, said two intervals being separated by an non-breathing (apnea) interval. The inhalation and exhalation phases are both further subdivided into three parts: protophase (first third of the phase), mesophase (middle third of the phase, and telephase (last third of the phase). Automatic respiratory cycle detection is particularly useful for determining the number and position of the crepitant rales with respect to the respiratory cycle, and for monitoring sleep apnea.
The respiratory sounds may be detected by means of a sound sensor comprising a membrane (such as a stethoscope) and a microphone, said sensor being placed on the patient's mouth, or trachea, or lungs. The respiratory sounds detected in this manner shall hereafter be known as stethoscope sounds or the stethoscope signal. A distinction shall be made between pulmonary sounds, which are detected at the lungs, and tracheal sounds, which are detected at the trachea.
Stethoscope sounds are characterized by a broad spectrum with a mean frequency that depends on the sound detection point. The frequency of pulmonary sounds is generally assumed to fall within the 50-2500 Hz band, and that of tracheal sounds may reach as high as 4000 Hz. It is therefore possible to use a sampling frequency of 8 KHz. It is assumed that tracheal sounds have a spectrum of 60-600 Hz for inhalation and 60-700 Hz for exhalation.
Many noises overlap with the markers in which the physician is interested. In particular, the heart creates noise: The spectrum of cardiac sounds is from 20 to 100 Hz for basic signals, but it also includes higher frequencies (500 Hz and above) for sounds known as whistles. At the trachea, the normal respiratory sound is affected by a noise that contains high-frequency components, which are audible during both the inhalation phase and the exhalation phase. At the thorax, a normal respiratory sound is affected by a quiet noise during inspiration, and a very audible noise during the exhalation phase.
The respiratory signals are not stationary, because the volume of the lungs is constantly changing, and they vary based on the patient's age, body mass, and health condition. All of these factors make it difficult to automatically detect respiratory cycles. Various respiratory cycle detection systems have been tested, and most of these systems simultaneously make use of:
These known systems are experimental systems, which are too complex to be in common use among physicians, because they simultaneously use multiple sound sensors and a spirometer. Moreover, they may not be used by a patient alone for the purposes of home telemedicine. Furthermore, the respiratory cycle detection performed by these known systems is often disrupted by noise affecting the captured signals.
The document DE 10.2006.017.279 A1 describes a method for detecting respiratory cycles in a stethoscope signal, in order to distinguish between a breathing phase and a non-breathing phase, comprising the steps consisting, for each stethoscope signal sample, of:
This method only makes it possible to distinguish between a breathing phase and a non-breathing phase. It does not distinguish between inhalation and exhalation. Its purpose is to study sleep apnea. It is sufficient for detecting apnea. It could conceivably be used to conduct a first step of detecting breathing phases, before distinguishing between inhalation and exhalation. However, it has been observed that this first step of detecting breathing phases is insufficiently reliable at achieving reliable discrimination between inhalation and exhalation.
The purpose of the invention is to disclose a method and a system for automatically detecting respiratory cycles, achieving more reliable and robust detection with respect to spurious signals such as heart noises, noises from the sensor rubbing against the skin or clothes, ambient noises, the doctor's voice, etc.
The object of the invention is a method for detecting respiratory cycles in a stethoscope signal, in order to distinguish between a breathing phase and a non-breathing phase, comprising the steps consisting, for each stethoscope signal sample, of:
characterized in that it consists of filtering the stethoscope signal using a high-pass filter, before calculating an energy value Eh for each sample of the stethoscope signal, and calculating the mean energy Eh_moy of that signal;
and in that the cutoff frequency is between 400 and 500 Hz.
Experiments show that the method characterized in this manner achieves more reliable breathing/non-breathing discrimination, because it eliminates disruptive noises (and part of the respiratory sounds) while allowing enough of the respiratory sounds through to enable reliable discrimination between breathing/non-breathing, and to enable, in a later step, reliable distinguishing between inhalation/exhalation.
In preferred embodiments, the inventive method comprises one or more of the following characteristics.
To calculate the mean energy Eh_moy of the filtered signal, it consists of considering all of the energy values Eh from the start of the filtered signal.
To make a smoothed decision for a sample Ei, it consists of:
According to one preferential embodiment, the method further comprises a step of smoothing the uncertain phases the duration of which is non-negligible with respect to the typical duration of a breathing phase or non-breathing phase, characterized in that, in order to smoothing a given uncertain phase, it consists of:
According to one embodiment, in order to verify an assumption, the method further consists of measuring the duration of the uncertain phase and comparing it to a typical value corresponding to said assumption.
According to one embodiment, in order to verify an assumption, the method further consists of measuring the duration of the uncertain phase and comparing it to the mean value of the durations of other phases of the same type as the one defined by said assumption.
According to one embodiment, to distinguish between Inhalation/Exhalation within a breathing phase, it further consists of:
According to another embodiment, to distinguish between Inhalation/Exhalation within a breathing phase, it further consists of:
The invention will be better understood, and other characteristics will become apparent, with the help of the description below and the figures accompanying it:
The phases of a respiratory cycle are detected in two successive steps, for each sound sample:
1) Distinguishing between a breathing phase (either inhalation or exhalation) and a non-breathing phase (just noise).
2) Distinguishing between inhalation and exhalation, for each breathing phase determined by the first distinguishing step.
If (Eh−Eh_moy)>0, then it is a breathing phase.
Otherwise, it is a non-breathing phase.
The cutoff frequency of the high-pass filter 71 is between 400 Hz and 550 Hz, because it has been observed that with a low value, the rate of incorrect determinations increases rapidly. For example, this filtering may be achieved by a second-order Butterworth filter. To achieve a cutoff frequency of 500 Hz, the algorithm is as follows:
y[i]=b[0]*x[i]+b[1]*x[i−1]+b[2]*x[i−2]+a[1]*y[i−1]+a[2]*y[i−2]
where a(i) and b(i) are Butterworth filter coefficients.
In this embodiment:
b(0)=0.7571
b(1)=−1.5142
b(2)=0.7571
a(1)=−1.4542
a(2)=0.5741
Calculating 72 the energy Eh associated with each sample of the filtered stethoscope signal is using a conventional method. It is calculated for a given sample, taking into consideration a window containing the 240 samples that precede it. The calculation period is thus equal to the sampling period.
The energy E of a signal in the discrete domain is calculated using the formula:
We take into consideration a 240-sample window (i.e. 30 ms for a signal with a sampling frequency of 8 kHz).
where x(i) is encoded using 16 bits, and these values vary between −215 and 215. The energy E therefore takes on values between 0 and 240*231.
In order to achieve results independent of the size of the window in question, we will divide the obtained value of E by the number of samples in the window, N=240.
Additionally, in order to simplify the implementation, we make a switch to logarithmic plotting. This reduces the dynamics, but has no effect on the results achieved. Finally, the formula of the energy Eh for each sample is:
The mean energy Eh_moy of the filtered stethoscope signal is calculated, in step 73, over an interval of time that preferentially begins at its start, in order to eliminate patient-dependent variations and to eliminate the effect of spurious noises. When the doctor begins auscultation, he applies the stethoscope's bell onto the patient's skin, and moves it. The movement produces a rubbing noise. At the same time, he speaks, such as to say “breathe in deeply”. Next, he focuses on what he hears, and waits for a period of time in one spot, then moves the stethoscope's bell again over the patient's skin.
Calculating the mean energy Eh_moy over a fixed period, no matter how long, does not guarantee that the calculation is not conducted over a bad period, when the bell is being moved. Calculating the mean from the beginning of the signal makes it possible to benefit from the fact that the total duration of the movement is much less than the total duration of non-movement. Thus, the mean value calculated is much closer to the ideal mean, which would only take into account periods when there is no spurious noise due to the bell moving, and to the doctor's voice.
If (Eh−Eh_moy)>0, then it is a breathing phase.
Otherwise, it is a non-breathing phase.
Subtracting this sliding mean value Eh_moy as references makes it possible to constantly adapt the distinguishing conditions to variations in the noise level and to variations in the useful signal level, these levels being different, particularly from one patient to another.
Smoothing Brief Errors (Step 75)
For each sample, a provisional decision is made, in step 74:
Ideally, a series of decisions of the following form is obtained:
r r r r r r r r r r r r r r r r a a a a a a a a r r r r r r r r r r r r r a a a a a a a
However, incorrect decisions may occur, for one sample or several consecutive samples. To eliminate these incorrect decisions, the brief errors are smoothed. These decisions will hereafter be called “smoothed decisions”
A given sample Ei is considered, for which a provisional decision DPi has been made, and for which a smoothed decision DLi should be determined. The provisional decision DPi and the provisional decisions made for the n samples immediately preceding the given sample Ei will be used. Based on these n+1 provisional decisions, this smoothed decision DLi is determined by a calculation which is conducted some time after the calculation of the provisional decision DPi.
A sliding time window is considered, whose size corresponds to n samples, n being a fixed even number. The sampling period is called T. This time window is shifted by a sampling period T for each new sample, so that a series of windows F0, F1, F2, F3, . . . is obtained. The temporal shift between the provisional decision and the final decision, for a single sample, is equal to Tn or greater and is fixed. This makes it possible to have n+1 provisional decisions DPi−n, DPi−n+1 . . . DPi−1, Dpi, in order to make a smoothed decision DLi.
At a moment t0, a time window F0 corresponds to the given sample Ei and the n−1 samples that precede it:
Ei−n+1, . . . , Ei−1, Ei.
At the moment t1=t0+T, a new time window F1 corresponds to the samples:
Ei−n+2, . . . , Ei, Ei+1.
At the moment t2=t1+T, a new time window F3 corresponds to the samples:
Ei−n+3, . . . , Ei, Ei+1, Ei+2.
At the moment t3=t2+2T, a new time window F4 corresponds to the samples:
Ei−n+4 . . . Ei, Ei+1, Ei+2, Ei+3.
At the moment tj=t1+j.T, a new time window Fj corresponds to the samples:
Ei−n+j+1 . . . Ei+j.
At the moment tn=t1+n.T, a new time window Fn corresponds to the samples:
It should be noted that each sample is contained within a series of n windows shifted apart from one another. At the moment tn, it is possible to make a smoothed decision DLi for the sample Ei, as the provisional decisions made for the samples contained in all the windows containing that given sample Ej, i.e. windows F0 to Fn, are then known.
For each window Fj, within the window, the number of samples where the provisional decision is “Breathing” is counted. The number obtained, Rj, is between 0 and n inclusive. This number Rk is associated with each sample contained within the window Fj, particularly the sample Ei, because this number represents the likelihood of the Breathing decision in this window:
The value R0 is associated with all the samples in the window F0.
The value R1 is associated with all the samples in the window F1.
The value Rj is associated with all the samples in the window Fj.
The value Rn is associated with all the samples in the window Fn.
In order to determine the smoothed decision DLi for the sample Ei, the n windows Fj are considered, as are the corresponding values Rj, for j=1 to n. These values Rj are added up for j=1 to n, in order to obtain a value RT representative of the likelihood of the Breathing decision. Next, the following test is conducted:
Then it is a breathing sample.
Otherwise, it is a non-breathing sample.
It is assumed that the samples at the start of the signal are not important to the analysis that will follow; the provisional decision is therefore arbitrarily set to Non-Breathing for the first n samples, at the start of the signal.
Example where n=8.
Smoothing Uncertain Phases (Step 76)
As a reminder, an uncertain phase is an interval the duration of which is non-negligible when compared to the typical duration of a breathing phase or non-breathing phase, and which alternates between a low number of smoothed “Non-Breathing” decisions and a low number of smoothed “Breathing” decisions. This alternation, which is not smoothed by step 75, creates one or more discontinuities when detecting a breathing or a non-breathing phase.
Uncertain phases are a situation that we did not encounter during our experiments. However, we have nevertheless provided for the possibility that such a situation may occur.
In the pulmonary auscultatory signals that are to be analyzed, the respiratory cycles are “inhalation-non-breathing-exhalation-non-breathing”. A breathing phase should cause a continuous series of “r” decisions after the brief error smoothing step. A non-breathing phase should cause a continuous series of “a” decisions after the brief error smoothing step. A transition from “r” to “a” should make it possible to conclude that it is the end of a breathing phase and the start of a non-breathing phase. A transition from “a” to “r” should make it possible to conclude that it is the end of a non-breathing phase and the start of a breathing phase.
Ideally, the brief error smoothing step should therefore give as a result like this one:
. . . r . . . |_a_| . . . r . . . |_a_| . . . r . . . |_a_| . . . r . . . |
However, uncertain phases may appear. An uncertain phase will be denoted as “uncertain”. There are 4 possible situations:
Situation a: an uncertain phase appears between two breathing phases.
| . . . r . . . |_a_| . . . r . . . |uncertain| . . . r . . . |_a_| . . . r . . . |
Situation a1: an uncertain phase appears between two non-breathing phases.
| . . . r . . . |_a_| . . . r . . . |_a_|uncertain|_a_| . . . r . . . |
Situation b: an uncertain phase appears between a breathing phase and a non-breathing phase.
| . . . r . . . |_a_| . . . r . . . |uncertain|_a_| . . . r . . . |_a_| . . . r . . . |
Situation b1: an uncertain phase appears between a non-breathing phase and a breathing phase.
| . . . r . . . |_a_| . . . r . . . |_a_|uncertain| . . . r . . . |_a_| . . . r . . . |
Whatever the situation, the same method is used to determine whether it is a breathing phase or a non-breathing phase. To do so, the following two hypotheses are tested. If the first assumption is incorrect, the second one is checked.
Assumption 1: This is a breathing phase ri. This assumption is accurate if the following tests both give a positive result:
In ambiguous cases, it is also possible to calculate the mean duration of the inhalation phases, the mean duration of the exhalation phases, and the mean duration of the non-breathing phases, for the signal being considered, i.e. for a particular patient; and to compare the duration of the uncertain phase with the determined averages.
Assumption 2: The uncertain phase is a non-breathing phase aj. This assumption is accurate if the following tests both give a positive result:
When distinguishing between Breathing/Non-Breathing, the breathing phases were determined. This makes it possible to eliminate the samples of the signal corresponding to the non-breathing phases. The remaining signal samples correspond only to inhalation phases and exhalation phases. The remaining series of samples theoretically alternates between an inhalation phase and an exhalation phase. Two situations are possible:
It is known that the signal's energy calculated over the duration of an inhalation phase is generally greater than the energy of the signal calculated over the duration of an exhalation phase.
According to one preferential embodiment, the method for distinguishing between Inhalation/Exhalation consists of:
A second method for distinguishing between Inhalation/Exhalation may consist of:
According to an preferred embodiment of the inventive method, the first method for distinguishing between Inhalation/Exhalation is used for distinguishing between Inhalation and Exhalation, then the second method is used to check the accuracy of the distinguishing action performed by the first method.
Number | Date | Country | Kind |
---|---|---|---|
0759924 | Dec 2007 | FR | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/EP2008/010861 | 12/18/2008 | WO | 00 | 11/15/2010 |