# A Progressively Expanded Database for Automated Lung Sound Analysis: An Update
## 2 Materials and Methods
### Data Preparation and Labeling  
The length of audio files recorded with the Littmann 3200 device was originally set at 15.8 s; as such, the terminal 0.8-s segment was deleted to obtain 15-s audio files (red blocks in Figure 1b). A standard round of continuous recordings of lung sound generated by the HF-Type-1 device was longer than 30 min; therefore, we truncated the first 15-s segment of every 2-min signal in the continuous recordings for subsequent analysis (red blocks in Figure 1b).  
Figure 1: Lung sound auscultation locations and protocol. (**a**) Predefined auscultation locations (L1–L8). (**b**) Littmann 3200 recording protocol. (**c**) HF-Type-1 recording protocol. In (**b**,**c**), white right arrows and red blocks represent original continuous recordings and truncated 15-s recordings, respectively. This figure is adapted from our previous study under a Creative Commons Attribution (CC BY) license [18].  
Two licensed respiratory therapists with 8 and 4 years of clinical experience, respectively, and one registered nurse with 13 years of clinical experience performed the labeling. The labelers' licenses were granted by the Ministry of Examination, Taiwan, and they gained their clinical experience in Taiwan. Each lung sound file was labeled by only one individual, but regular consensus meetings were held to evaluate the labeling and reach a consensus among all labelers. A self-developed software [31] was used to do the labeling. During labeling, the labelers first used the software to load a 15-s lung sound recording (raw signal displayed in Figure 2a), and the corresponding spectrogram (green square in Figure 2b) would be displayed subsequently. The labelers were asked to listen to the sound and observe its corresponding temporal-spectral patterns on the spectrogram once or twice first. Then, they must label all the inhalations and exhalations in the 15-s recording. The labeler can move the yellow lines (indicated by white arrows in Figure 2b) to define a region of interest (ROI) (transparent yellow patch in Figure 2b). By clicking the area of which start and end times were bounded by the ROI on specific label tracks (red arrows in Figure 2b), the labelers can generate corresponding labels. After having the labels of inhalations (I) and exhalations (E), they can proceed to label wheezes, stridor, rhonchi, and DASs. When labeling DASs, they were asked to label the start and end times of a series of crackle sounds but not label each explosive sound; additionally, the sounds of pleural friction rubs were not included in the DAS labels (D) in this study. During the labeling process, they can replay the sound and make a modification to the labels as many times as they wanted. They were instructed not to label if a sound was inaudible. If a sound was cut off at the very beginning or end of a recording which made them have less confidence in labeling, they can skip the labeling of it. After labeling, the software automatically created a label file. The output of the label started with the type of label (I, E, Wheeze, Stridor, Rhonchi, or D), and it was followed by the start and end times of the event, shown in Figure 2c.  
Figure 2: Labeling process. (**a**) Raw signal of a lung sound recording. (**b**) Labeling software. (**c**) Output in a label file. In (**b**), the green square represents the spectrogram, the yellow lines indicated by the white arrows represent the boundaries of an ROI (the transparent yellow patch), and the red arrows indicate areas on different label tracks of which start and end times bounded by the ROI; when a labeler clicks on one of them, a corresponding label is generated.  
Note that during deep-learning processing, labels of wheezes (W), stridor (S), and rhomchi (R) were combined to obtain CAS labels (C).