## 2 Methods
### Filter Design
#### 2.5.6 Loop Design  
Choosing the correct upper bound for the beam area is difficult: on the one hand, a low upper bound for the beam area leads to a good fit in this area (low \(\mathbf{error}_{beam}\) values), but to undesired side lobes in the stop area (high \(\mathbf{error}_{stop}\) values). Consequential, the direct sound will be recorded correctly, but is mixed with the undesired reverberant sound field, which should be ideally suppressed. On the other hand, a high upper bound for the beam area leads to the opposite, a bad fit in the beam area (high \(\mathbf{error}_{beam}\) values), but low undesired side lobes (low \(\mathbf{error}_{stop}\) values). The following loop design finds a frequency-dependent optimal upper bound for the beam area, which is a compromise between a good fit in the beam area and only small side-lobes in the stop area. As a first step in the loop design, the upper bound of the beam area is initialized in matrix notation:  
\[ \begin{array}{ccccc}k=1&k=2&\ldots&k=K\\ \epsilon_{beam}^{k}=\begin{array}{c}\phi_{steer}-\phi_{b}\\ \vdots\\ \phi_{steer}+\phi_{b}\end{array}\left(\begin{array}{ccccc}0&\alpha&\ldots& \hat{b}_{steer}-\hat{b}(\phi_{steer}-\phi_{b})\\ \vdots&\vdots&\ddots&\vdots\\ 0&\alpha&\ldots&\hat{b}_{steer}-\hat{b}(\phi_{steer}+\phi_{b})\end{array} \right)\\ \text{with }K\in\mathbb{N}^{>1},\;k\in\mathbb{N}^{\leq K}\text{ and }\alpha=\left[\hat{b}_{steer}-\hat{b}(\phi_{steer}\pm\phi_{b})\right]/K \end{array}  \tag{23}\]  
The rows cover the beam area, whereas the columns cover the different iterations of the following loops with \(k\) as the counter, where \(k=K\) indicates the last iteration. The upper bound starts in the first iteration with \(\epsilon_{beam}^{k=1}=0\) and continues linearly spaced with step size \(\alpha\). The step size is designed in such a way that the maximum value of the upper bound of the beam area \(\hat{b}_{steer}-\hat{b}(\phi_{steer}\pm\phi_{b})\) is reached in overall \(K\) steps. Either \(\hat{b}(\phi_{steer}-\phi_{b})\) or \(\hat{b}(\phi_{steer}+\phi_{b})\) can be chosen to calculate \(\alpha\), since they are equal according to the symmetry of the desired directivity pattern. The upper bound then ends with the difference between \(\hat{b}_{steer}\) and \(\hat{b}_{beam}\) at the row specific angle. If this difference is reached before the last iteration (\(k<K\)), this value will stay till this iteration is reached. This will be the case for every row, except the first and the last one. This procedure ensures that \(\hat{b}_{steer}\) stays the maximum value of the directivity pattern. In contrast to the upper bound of the beam area, the bound of the stop area is initialized as a vector, since there is no angle dependency:  
\[ \begin{array}{ccccc}l=1&\ldots&l=L\\ \epsilon_{stop}^{l}=\begin{array}{c}\left(\hat{b}_{steer}\cdot b_{stop}^{first }&\ldots&\hat{b}_{steer}\end{array}\right)\\ \text{with }L\in\mathbb{N}^{>1},\;l\in\mathbb{N}^{\leq L}\text{ and }b_{stop}^{first}\in\mathbb{R}^{\geq 0,\leq 1} \end{array}  \tag{24}\]  
The entries with the counter \(l\), where \(l=L\) indicates the last iteration, correspond to the iterations of the following loops and are linearly spaced. The constant \(b_{stop}^{first}\) controls the maximum allowed value of the directivity pattern in the stop area for the first iteration. The loop design itself can be seen in Figure 5 and is repeated for every frequency \(f_{p}\), where the constants \(K_{temp}\) and \(K_{step}\) can be chosen freely so that \(K/K_{temp}\in\mathbb{N}\) and \(K_{temp}/K_{step}\in\mathbb{N}\), respectively. These two constants regulate the part of the upper bound of the beam area, which is used in the looped optimization process. Figure 5: Loop design to determine the optimal filter, as well as the optimal upper bound for the beam and the stop area. The first loop repeats the optimization with the first part of the upper bound of the beam area (from \(\epsilon_{beam}^{k=1}\) to \(\epsilon_{beam}^{k=K_{temp}\leq K}\)) till Equation (22) with \(\epsilon_{stop}^{1}\) is true.