# Upmix B-Format Ambisonic Room Impulse Responses Using a Generative Model
## 2 Review of Ambisonics  
The incident sound pressure measured on a spherical surface, denoted as \(p(kr,\Omega_{0})\), can be expressed as an infinite-order linear combination of the spherical harmonics (SH),which are orthogonal on a sphere. The SH expansion of the incident sound pressure is as follows,  
\[p(kr,\Omega_{0})=\sum_{n=0}^{\infty}\sum_{m=-n}^{n}\alpha_{nm}(kr)Y_{n}^{m}( \Omega_{0}). \tag{1}\]  
Here, \(\Omega_{0}\equiv(\theta,\phi)\) represents the incident direction, where \(\theta\) and \(\phi\) denote the elevation and azimuth angles measured from the x-positive and z-positive axes, respectively. The wave number is defined as \(k=\omega/c\), where \(c\) is the speed of sound, \(\omega\) is the angular frequency, and \(r\) is the distance from the origin. The terms \(\alpha_{nm}\) are the \(n\)-order \(m\)-degree SH coefficients, which represent the Ambisonics signals. \(Y_{n}^{m}(\Omega_{0})\) denotes the \(n\)-order \(m\)-degree SH function at \(\Omega_{0}\). The SH functions are defined as follows,  
\[Y_{n}^{m}(\theta,\phi)=(-1)^{m}\sqrt{\frac{2n+1}{4\pi}\frac{(n-|m|)!}{(n+|m|)! }}P_{n}^{|m|}(\cos\theta)e^{im\phi}, \tag{2}\]  
where \((\cdot)!\) is the factorial function, and \(P_{n}^{m}(\cdot)\) denotes the Legendre function. In practical applications, the signals recorded by spherical microphone arrays can only be decomposed into a set of finite-order spherical harmonics. The finite linear combination can be represented by a matrix equation as  
\[\mathbf{p}=\mathbf{Y}\cdot\mathbf{A}. \tag{3}\]  
Here, the sound pressure \(\mathbf{p}\) is a column vector that represents the sound field measured at each discrete microphone position \((\theta_{\ell},\phi_{\ell})\), \(\ell=1,...,L\). The number of microphones on the surface of the spherical array satisfies \(L\geq(N+1)^{2}\), and \(N\) is the truncated order of the SH expansion. The Ambisonic signals \(\mathbf{A}\) are put in a column vector representing the SH coefficients of the sound field. The vectors \(\mathbf{p}\) and \(\mathbf{A}\) are defined as follows,  
\[\mathbf{p} =[p(kr,\theta_{1},\phi_{1}),p(kr,\theta_{2},\phi_{2}),...,p(kr, \theta_{L},\phi_{L})]^{T} \tag{4}\] \[\mathbf{A} =[\alpha_{00}(kr),...,\alpha_{NN}(kr)]^{T}. \tag{5}\]  
The transfer matrix \(\mathbf{T}\) consists of \(N\)-th order SH functions. Each row represents spherical harmonics at a direction \((\theta_{\ell},\phi_{\ell})\) and is given by  
\[\mathbf{T}=\mathbf{Y}=\left[ \begin{array}{cc}Y_{0}^{0}(\theta_{0},\phi_{0}),&...,&Y_{0}^{N}(\theta_{0},\phi_{0})\\ Y_{0}^{0}(\theta_{L},\phi_{L}),&...,&Y_{N}^{N}(\theta_{L},\phi_{L})\end{array}  \right]. \tag{6}\]  
As the transfer matrix \(\mathbf{T}\) is overdetermined, the \(N\)-th order Ambisonics can be obtained through the least squares (LS) method as  
\[\mathbf{A}_{LS}=\mathbf{Y}^{\dagger}\mathbf{p}. \tag{7}\]  
Here, \(\mathbf{Y}^{\dagger}\) is the pseudo inverse of the matrix \(\mathbf{Y}\). When \(N=1\), the SH basis functions \(\mathbf{Y}\) consist of an omnidirectional pattern and three figure-of-eight directional patterns. In this case, the SH coefficients \(\mathbf{A}\) represent the first-order Ambisonics (FOA) signals. When \(N>1\), the SH coefficients \(\mathbf{A}\) represent the higher-order Ambisonics (HOA) signals. For the purpose of capturing FOA signals, the FOA microphone array (Figure 1a) serves as a widely adopted solution. This microphone array comprises four cardioid microphones meticulously arranged in a tetrahedron configuration. The signal acquired from the FOA microphone array is commonly referred to as the B-format. When it comes to capturing HOA, multi-channel spherical microphone arrays are typically employed. One popular choice for HOA recording is the Eigenmike (Figure 1b), which is a fourth-order rigid spherical microphone array. The recorded time-domain signals are processed using spherical harmonic decomposition to obtain the HOA signals.