# Locating Image Sources from Multiple Spatial Room Impulse Responses
## 2 Methods
### Extract Features  
Although the SDM analysis provides DoA estimates for all RIR samples, it does not reveal which estimates are reliable or belong to either the direct sound or early reflections. Both of these properties are hard to determine from the RIR and DoAs directly. For this reason, it is easier to first extract features from the SDM data and then identify the reliable sound events. The potential early reflections are identified based on the sound level peaks in the RIR. To do this, one extracts two features at each peak, namely peak prominence and DoA stability. Then the peaks are separated to direct sound and early reflection peaks. Finally, the early reflection peaks are filtered according to a certain prominence and stability level. Only the peaks fulfilling both criteria are passed on to the later processing stages. Note that the number and the type of features predicting stability could easily be modified, for example to match a modified directional estimation algorithm. Naturally, one needs to determine the sound level peaks first in order to extract features at their locations. The peaks are determined from sound level \(L\) of the RIR, calculated as  
\[L[n]=10\lg\left(\sum_{k=1}^{N}h[k+n-(N/2)-1]^{2}\mathbf{g}_{N}[k]\right), \tag{2}\]  
where \(n\) is the sample index, \(h\) is the selected omnidirectional RIR and \(\mathbf{g}_{N}\) is a Gaussian window of length \(N\). \(\mathbf{g}_{N}\) is normalized so that the sum of its samples is equal to 1. The signal peaks are then defined as the samples that have higher value than their neighbors. Next, the noise is discriminated from the signal by applying an onset threshold, dropping any peaks from the beginning of the response that do not exceed a set sound level value. In this paper, the applied onset thresholds range between \(-16\) and \(-10\) dB w.r.t. the maximum sound level depending on the room. The remaining peaks are then passed to the actual feature extraction. The first feature that is extracted is peak prominence (a.k.a. topographic prominence). It indicates how distinct the sound level peak is from the rest of the response. A prominent peak is either higher than any other peak or is separated from other prominent peaks by low signal values. In turn, peaks with low prominence either do not raise from the signal baseline much or are located at the slopes of more prominent peaks. In practice, peak prominence (in dB) is determined with the following procedure:  
1. Denote the current peak as **A**. 2. Search for peaks preceding or following **A** that have higher sound level than **A** has. Select the closest two and denote those as **B** and **C**. In case there is no higher peak in either direction, select the start or end of the signal. 3. Get the signal minima of intervals [**B**, **A**] and [**A**, **C**] denoted as \(\textbf{B}_{min}\) and \(\textbf{C}_{min}\), respectively. 4. Peak prominence of **A** is \(\max(\textbf{B}_{min},\textbf{C}_{min})\). The second feature, DoA stability, represents how static the direction estimate is around the sound level peak. The DoA sample is considered stable if it stays within a certain angular range compared to the DoA at the peak. In other words, it indicates that the peak likely belongs to a single plane wave, that is, one specular reflection. On the contrary, unstable estimate hints that the DoA is affected by multiple sound events at the same time. The DoA stability is calculated by first comparing the central angle between the DoA estimate of the sound level peak \(\textbf{u}[k]\) and the DoAs right before and after it. Next, the angle is compared to a pre-defined angle threshold in order to get a binary result. In short, these two steps can be presented together as follows:  
\[\textbf{p}_{k}[n]=\left\{ \begin{array}{ll}1,&\text{arccos}\,\textbf{u}^{ \intercal}[k]\textbf{u}[n]<\alpha_{t}\\ 0&\text{otherwise},\end{array} \right.