# Detection of Respiratory Phases in a Breath Sound and Their Subsequent Utilization in a Diagnosis
## 3 Results  
The data processing approach eliminated the high amplitudes sounds so the recording contains mainly the breath sounds. The alternations of inspiratory and expiratory phases are better pronounced and occur when the amplitude of acoustic pressure is minimal (Figure 5). When these minima become visible, the algorithm needs to locate the low amplitude level. The envelope smoothing approach successfully unified the signal and eliminated the local minima that normally trigger a false positive response (Figure 6). Figure 5: Respiratory sound filtered using high-pass (500 Hz) and low-pass filter (1600 Hz)-for the same healthy person as in the Figure 3 (Patient No. 1). The changes of the respiratory phases are expected at the regions with the minimum amplitude of acoustic pressure. An example of the noise caused by the equipment manipulation is well demonstrated at the time of 13 s.  
Figure 6: (**a**) Detail of modified envelope line with the elimination of the noise at the time of 13 s; (**b**) detail of smoothed modified envelope line. When the envelope was properly adjusted and the respiratory rate falls into defined boundary, the changes of the respiratory phases are revealed automatically (Figure 7). The accuracy of the changes detection depends mainly on the respiratory rate and the quality of the recording. When the rate is considerably low, a transition part between the phases becomes marginal and the accuracy decreases. In order to maximize the accuracy of respiratory phase detection, it is necessary in some cases to change the settings of certain parameters in the software (see Tables 2 and 3). The algorithm was tested on a number of recordings and the results strongly depended on the recordings' quality and the noise level (Table 1). The third group, classified as very poor, contained the recordings in which the respiratory phases were not correctly identified by the algorithm. The algorithm always detected the changes of the respiratory phases in the recordings of the first and the second quality group--Tables 2 and 3. \begin{table}
\begin{tabular}{c c} \hline \hline
**Quality of Recording** & **Number of Recordings** \\ \hline very good/with minimal undesirable noise—2 artefacts/sec or without artefacts & 22 \\ with significant noise—1 artefact/3 s & 10 \\ very poor—2 artefacts/sec constantly & 9 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Dividing of recordings. \begin{table}
\begin{tabular}{c c} \hline \hline Deviation of the detected boundary & 21 recordings \\ up to 0.4 s & 1 recording \\ \hline The need of the software modifications & \\ none & 13 recordings \\ modification of \(f_{rp/2}\) & 5 recordings \\ mod. of low-pass filter value & 1 recording \\ mod. of \(f_{rp/2}\) and values of low-pass and high-pass filter & 3 recordings \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Success of detection of boundaries of respiratory phases–very good recordings/recordings with minimal undesirable noise. Figure 7: Sound signal with border lines-the individual respiratory phases (inspirations and expirations) are highlighted by the red vertical lines. The successfully detected respiratory phases were highlighted in the frequency spectrum graph and helped the physician to identify whether the participant does not suffer from bronchial obstruction (Figure 8) or whether there is a potential problem such as pronounced bronchial obstruction (Figure 9). The frequency spectra are visualized from 100 to 2000 Hz to avoid the noise arising from the cardiac activity. Besides using the respiratory phases to improve the orientation in the frequency spectrum, the average curves of inhalation and exhalation phases can be plotted as a dimensionless ratio relating the amplitudes and frequencies. Such a graph provides a unique piece of inter-individual information on the quality of respiration, and moreover, it is comparable among the patients.