# Interpolating the Directional Room Impulse Response for Dynamic Spatial Audio Reproduction
## 2 DRIR Interpolation Framework
### Separating FOA Signals into Specular and Diffuse Components
Thus, based on the two conditions, a series of tests on different values indicate that the elected \(\tau_{fast}\) and \(\tau_{slow}\) present the most salient power difference between \(P_{w}^{fast}(n)\) and \(P_{w}^{slow}(n)\), which is used to find the direct sound and specular reflections:  
\[R_{dB}(n)=10\cdot log_{10}\frac{P_{w}^{fast}(n)}{P_{w}^{slow}(n)} \tag{8}\]  
where the peak of the \(i\)th specular reflection (with the 1 st peak being the direct sound) is detected at time \(n=n_{peak}i^{i}\) when the followings are met:  
1. \(R_{dB}(n)\) is greater than a pre-defined threshold \(\alpha\) (in this work \(\alpha=4\) dB was chosen, under which \(\frac{P_{w}^{fast}(n)}{P_{w}^{slow}(n)}\approx 2.5\)). Informal experiments found that \(\alpha\) should be in the range from 4 dB to 6 dB to avoid sensitivity of the approach to this threshold. For an \(\alpha\) smaller than 4 dB, this can lead to a few false peaks being extracted and if \(\alpha\) is greater than 6 dB it can lead to some clear peaks not being detected. This was initially verified by analyzing results from a sub-set of DRIR recordings, whilst the TOA results in Section 4 analyze this more thoroughly. 2. \(R_{dB}(n)\) is a local maximum. 3. \(P_{w}(n)\) is greater than a pre-defined threshold \(\beta\), which distinguishes the peak from background noise, so the selection of \(\beta\) depends on the noise floor level of specific DRIR recordings (in this work \(\beta=-50\) dB was chosen to match the noise floor of the chosen recordings [21], but in practice this could be adjusted to match the estimated noise floor level for recordings in another room). Considering the \(W\) channel as an example, the \(i\)th specular reflection signal for source \(j\) recorded at location \(L_{m}\), \(W_{spec,j}^{i}(n,L_{m})\), can be extracted from the samples of \(W_{j}(n,\ L_{m})\) corresponding to where \(R_{dB}(n)\) is larger than \(\alpha\) around each position of the specular reflection peaks. Note that \(\alpha\) decides the length of specific specular reflections in the time domain and, according to our informal experiments, a range of \(\alpha\) from 3 dB to 4 dB was found to maintain good decomposition of specular reflections. If \(\alpha\) is outside this range, it may lead to combining two specular reflections into a single component. We found that an \(\alpha\) of 4 dB, chosen for peak detection in (8), leads to specular reflections of around 0.002 s duration. For convenience, we utilize a time constant of 0.002 s for the resultant specular reflections. Thus, \(W_{spec,j}^{i}(n,L_{m})\) is found as  
\[W_{spec,j}^{i}(n,L_{m})=W_{j}\Big{(}n_{s}^{i},L_{m}\Big{)} \tag{9}\]  
where \(n_{s}^{i}=[n_{peak}^{i}-n_{spec}^{i},\ n_{peak}^{i}+n_{spec}^{i}]\ (i=1,\ 2,\ \dots,\ M)\). \(n_{peak}^{i}\) is the time corresponding to the detected peak of the \(i\)th specular reflection \(W_{spec,j}^{i}(n,L_{m})\), \(M\) corresponds to the chosen number of specular reflections to extract, and \(n_{spec}^{i}\) is a pre-defined time duration (0.002 s) that decides the length of this specular reflection in the time domain. In this way, the specular reflections are obtained as segments of DRIR recordings of the \(j\)th source. The whole diffuse signal, \(W_{diff,\ j}(n,L_{m})\), can be derived by removing all specular components \(W_{spec,j}(n,L_{m})\):  
\[W_{diff,\ j}(n,L_{m})=W_{j}(n,L_{m})-W_{spec,j}(n,L_{m}) \tag{10}\]  
where \(W_{spec,j}(n,L_{m})=W_{spec,j}^{i}(n,L_{m})\) for \(n=n_{s}^{i}\), and \(W_{spec,j}(n,L_{m})=0\) for \(n\
eq n_{s}^{i}\) for all \(i\). Note that if \(n_{peak}^{i+1}-n_{peak}^{i}<\sigma\), then we assume the extracted segments would be perceived as diffuse components rather than individual specular reflections. This would require appropriate choice of the threshold \(\sigma\) based on perception, which will be considered as part of future work. Here, we focus on extracting less than 10 specular reflections, which are dominant components in DRIRs and are generally sufficiently separated in time for the DRIR databases considered.