## 2 Methods
### Beamforming  
Beamforming describes the process of forming the directivity pattern of several microphones, which are arranged into an array, with signal processing techniques to obtain a specific, frequency-dependent directivity pattern. The directivity pattern \(b(f,\phi)\) of a linear discrete microphone array, consisting of \(N\) microphones, is calculated as follows [7]:  
\[b(f,\phi)=\sum_{n=-\frac{N-1}{2}}^{\frac{N-1}{2}}w_{n}(f)G_{n}(f,\phi) \tag{1}\]  
where \(\phi\) denotes the angle ranging from \(-\pi\) to \(\pi\), \(f\) the frequency, \(w_{n}(f)\) the frequency-dependent complex weighting filtering applied to microphone \(n\) and \(G_{n}(f,\phi)\) the steering vector denoting the direction and frequency-dependent transfer function from the sound source to microphone \(n\). Such a microphone array is illustrated in Figure 2.  
Figure 2: Microphone array receiving a signal with frequency \(f\) and angle of incidence \(\phi\). The incoming wavefront is captured with a microphone \(n\), modified with the respective filter \(w_{n}\) and, at the end, summed up to form the directivity pattern \(b(f,\phi)\).  
Assuming a far field condition with the microphones that have an omnidirectional directivity pattern, the transfer function states:  
\[G_{n}(f,\phi)=e^{-i\frac{2\pi f}{c}x_{n}\cos(\phi)} \tag{2}\]  
where \(c\) is the speed of sound and \(x_{n}\) represents the distance of the \(n\)-th microphone to the center of the array [7].  
The influence on the directivity patterns of the microphones in the array can be taken into account by changing the transfer function \(G_{n}\). The filter optimization used to match the directivity pattern of the array with a desired one is called beamforming. The look direction of the microphone array is defined as the angle of the main lobe of the desired directivity pattern, which is also called the steering angle.  
There are several beamforming algorithms based on an analytic solution for the optimal filter \(w_{n}(f)\) and some others on a numerical approximation. Analytic solutions allow us to set \(N\) constraints on the directivity pattern for a finite number of frequencies, as for example described in [8]. Since we have a higher number of constraints in our problem, we will use numerical methods that allow accommodating a higher number of constraints to control the directivity pattern.  
Equation (1) will be solved numerically, and for this purpose, the frequency range is discretized into \(P\) frequencies \(f_{p},p=0,\ldots,P-1\) and the angular range into \(M\) angles \(\phi_{m},m=0,\ldots,M-1\):  
\[b(f_{p},\phi_{m})=\sum_{n=-\frac{N-1}{2}}^{\sum\limits_{N=1}^{N-1}}w_{n}(f_{p })G_{n}(f_{p},\phi_{m}) \tag{3}\]  
Equation (3) is reformulated in matrix notation as:  
\[\mathbf{b}_{m}(f_{p})=\mathbf{G}_{mm}(f_{p})\mathbf{w}_{n}(f_{p}) \tag{4}\]  
where the directivity pattern is an \(M\times 1\) vector \(\mathbf{b}_{m}^{T}(f_{p})=[b(f_{p},\phi_{0}),b(f_{p},\phi_{1}),\ldots,b(f_{p},\phi_{M-1}]\), the transfer function an \(M\times N\) matrix \([\mathbf{G}(f_{p})]_{mn}=e^{-i\frac{2\pi f_{p}}{c}x_{n}\cos(\phi_{m})}\) and the filter a \(N\times 1\) vector \(\mathbf{w}_{n}(f_{p})=[w_{-\frac{N-1}{2}}(f_{p}),w_{-\frac{N-3}{2}}(f_{p}), \ldots,w_{\frac{N-1}{2}}(f_{p})]^{T}\)[7]. All bold variables are either vectors or matrices in the remainder of this manuscript.