# Interaural Level Difference Optimization of Binaural Ambisonic Rendering
## 2 Methods
### Ambisonic ILD Optimization  
As shown in Figure 2, low orders of Ambisonics produce inaccurate ILDs. A brief explanation of the approach presented in this paper to optimize the ILD reproduction of binaural Ambisonic rendering is as follows. For each virtual loudspeaker in the Ambisonic loudspeaker configuration, the ILD of the HRIR is estimated. This is taken as the target ILD. An Ambisonic HRIR is then generated using the non-AIO processed HRIRs. The difference between the two ILD measurements is calculated, and the virtual loudspeaker HRIRs are augmented accordingly, such that where the Ambisonic rendered ILD was less than the target ILD, the difference in amplitude between the left and right signals of the virtual loudspeaker HRIR is increased, and where the Ambisonic rendered ILD was more than the target ILD, the difference in amplitude between the left and right signals of the virtual loudspeaker HRIR is decreased. Augmentation is only implemented for frequencies above \(f_{alias}\). This process is repeated iteratively until the difference between Ambisonic rendered ILDs and target ILDs is minimized. The technique of AIO has been designed such that it can be applied to both  
Figure 2: Estimated horizontal plane interaural level difference (ILDs) of head-related impulse responses (HRIRs) and binaural Ambisonic rendering for Ambisonic orders \(\{M=1,M=2,...,M=5\}\) and \(M=36\). non-individualized and individualized HRIRs, and can be used for any order of Ambisonics and any loudspeaker configuration. The complete method of Ambisonic ILD Optimization is as follows. For each loudspeaker in the configuration, an Ambisonic HRIR is generated as in Section 2.1 by setting \(S=1\) in (2) and \(\theta\) and \(\phi\) as the respective azimuth and elevation values of the loudspeaker. The ILD is estimated for both the Ambisonic HRIR and the original HRIR of each loudspeaker using (8), and the difference in ILD between the Ambisonically rendered HRIRs and the original HRIR, \(\Delta\)ILD, is calculated as  
\[\Delta\text{ILD}=|\text{ILD}(H)|-|\text{ILD}(\hat{H})| \tag{9}\]  
where \(H\) refers to the original HRIR (and thus \(\text{ILD}(H)\) is the target ILD) and \(\hat{H}\) refers to the Ambisonic rendered HRIR. As ILD is calculated in dB, \(\Delta\)ILD is then converted to a gain value by the inverse of the dB SPL calculation, such that  
\[g^{\Delta}=10^{\frac{\Delta\text{ILD}}{2\Delta}} \tag{10}\]  
where ILD augmentation is dependent on the loudspeaker being situated away from the median plane, thus  
\[g^{\Delta}=1,\text{ if }\theta_{l}=0^{\circ}\text{ or }\theta_{l}=180^{\circ} \tag{11}\]  
This process is repeated for all loudspeakers in the configuration, and an array of \(g^{\Delta}\) values is produced with \(L\) length as \(\mathbf{G^{\Delta}}=\{g^{\Delta}_{1},g^{\Delta}_{2},...,g^{\Delta}_{L}\}\). HRIRs with AIO (\(H^{AIO}\)) are obtained by applying the gain \(g^{\Delta}\) to the contralateral signal of the HRIR for each loudspeaker, where values of \(g^{\Delta}>1\) produce an increase in ILD of unprocessed HRIRs (obtained when \(\Delta\)ILD \(>0\) indicating the Ambisonic ILD is smaller than the HRIR ILD), and values of \(g^{\Delta}<1\) produce a reduction in ILD of the unprocessed HRIRs (obtained when \(\Delta\)ILD \(<0\) indicating the Ambisonic ILD is greater than the HRIR ILD) as follows:  
\[ \begin{array}{l}H^{AIO}_{left}=\frac{H_{left}}{g^{\Delta}},\text{if ILD}(H)>0\\ H^{AIO}_{right}=\frac{H_{right}}{g^{\Delta}},\text{if ILD}(H)<0\end{array}  \tag{12}\]  
The ipsilateral signal of each HRIR remains unchanged (\(H^{AIO}_{ips}=H_{ips}\)), as is the case for both signals of the HRIR if \(g^{\Delta}=1\). Each HRIR with AIO is then normalized to the same root-mean square (RMS) amplitude as the unprocessed HRIR. The RMS amplitude is calculated for both the left and right signals, and a single value for each HRIR is calculated as \(\overline{RMS}=\frac{RMS_{left}+RMS_{right}}{2}\).