## 3 Environmental Noise Database
### Automatic Contextual SNR Labelling of Anomalous Noise Events
Within this case study, four possibilities exist:
* if \(T_{R}\leq T_{ANE}/2\) and \(TL\leq T_{ANE}/2\), then \(T_{1}=T_{2}=T_{ANE}/2\) (half of the equivalent ANE duration samples can be found in both sides of the event for background or road traffic noise);
* if \(T_{R}\leq T_{ANE}/2\) and \(TL<T_{ANE}/2\) then \(T_{1}=T_{L}\) and \(T2=max(T_{ANE}-T_{1},T_{R})\) (less samples of background or road traffic noise are available before the anomalous event start point than after its end);
* if \(T_{R}<T_{ANE}/2\) and \(TL\leq T_{ANE}/2\) then \(T_{2}=T_{R}\) and \(T1=max(T_{ANE}-T_{2},T_{L})\) (less samples of background or road traffic noise are available after the anomalous noise event end point than before its start);
* if \(T_{R}<T_{ANE}/2\) and \(TL<T_{ANE}/2\), then \(T_{2}=T_{R}\) and \(T_{1}=T_{L}\) (there are less samples of background or road traffic noise than the half of the anomalous noise event duration at both sides). The automatic process searches for the closest time regions to the current anomalous noise event (ANE\({}_{i}\)) trying to obtain as many samples of background or road traffic noise as the number of samples contained in the anomalous noise event (\(T_{1}+T_{2}=T_{ANE}\)). Moreover, a time margin equal to the integration time used for the \(LA_{eq}\) computation is excluded from the ANE surrounding regions to avoid including transients caused by the start and end of the ANE, obtaining more accurate estimations (see \(T_{a}\) in Figures 4-6). In Figure 4, a theoretical example of a balanced set of regions is shown. Contrary to the previous example, in Figure 5 an example where the right region does not contain enough samples to obtain a balanced set of time regions of surrounding RTN is shown. As a consequence, more samples from the left region are considered here for the SNR computation. Figure 4: An anomalous noise event is surrounded by road traffic or background noise. In this case both regions of RTN are balanced. Figure 5: An anomalous noise event surrounded by road traffic or background noise. In this second case, left region contains more samples than right region. * **Other anomalous noise events occur just before and/or after the analyzed anomalous noise event:** In this less-frequent scenario, the selection of the time regions where the BCK or the RTN \(LA_{eq}\) is computed is a little more intricate. The calculation process looks for the closest time regions to the current ANE following a global idea of measuring the contextual SNR with a proximity criterion, and trying to obtain as many samples of background or road traffic noise as the samples contained in the anomalous noise event duration (\(T_{ANE}\)). In this case, the closest BCK or RTN region to the analyzed ANE is firstly considered. If the duration of this region is greater than \(T_{ANE}\) and all its samples are closer to the analyzed ANE than any other sample from the opposite side, then the interval of duration is considered as \(min(T_{ANE},T)\) closest to the analyzed ANE (being \(T\) the duration of this time region). Otherwise, when it is possible to obtain samples of BCK and/or RTN from both sides of the analyzed ANE with the general criterion that none of these two time regions are strictly closer to the ANE than the other due to the presence of other ANEs, then samples from both sides of the ANE are used to compute the BCK and/or RTN \(LA_{eq}\). In Figure 6, an example of this kind of contextual SNR computation where all the samples come from the left region is shown. This is because the RTN samples in the right region are further away than the farthest sample of the RTN left region (then, \(T_{2}=0\)). In Figure 7, three examples of the most usual ANE contextual SNR computation cases (i.e., an anomalous noise event surrounded by road traffic or background noise) are shown. The A-weighted \(L_{eq}\) curve is highlighted, representing the time region attributed to an anomalous noise event in red, and the background or road traffic noise in blue.