# Closed-Loop Cognitive-Driven Gain Control of Competing Sounds Using Auditory Attention Decoding
## 2 Methods
### Correlation Coefficient Generation
The SIR in window \(i\) at the output of the AGC is equal to

\[\text{SIR}_{i}=10\log_{10}\left(\frac{\lambda_{a,i}^{2}\varphi_{a,i}}{\lambda_ {u,i}^{2}\varphi_{u,i}}\right), \tag{51}\]

with the energy of the attended and unattended speech vector in window \(i\) given by

\[\varphi_{a,i}=\mathbf{\hat{s}}_{a,i}^{T}\mathbf{\hat{s}}_{a,i},\ \ \varphi_{u,i}= \mathbf{\hat{s}}_{u,i}^{T}\mathbf{\hat{s}}_{u,i}. \tag{52}\]

By setting (51) equal to the desired SIR in (50) and constraining the overall energy at the output of the AGC to be equal to the overall input energy, i.e.,

\[\lambda_{a,i}^{2}\varphi_{a,i}+\lambda_{u,i}^{2}\varphi_{u,i}=\varphi_{a,i}+ \varphi_{u,i}, \tag{53}\]

the gains \(\lambda_{u,i}\) and \(\lambda_{a,i}\) can be computed as

\[\lambda_{u,i}^{2}=\frac{1+\frac{\varphi_{u,i}}{\varphi_{u,i}}}{1+10\frac{ \text{SIR}_{u,i}^{des}}{10}}, \tag{54}\]

\[\lambda_{a,i}^{2}=10\frac{\text{SIR}_{u,i}^{des}}{\varphi_{u,i}}\lambda_{u,i} ^{2}. \tag{55}\]

To avoid annoying artefacts due to highly time-varying gains, the gains \(\lambda_{u,i}\) in (54) and \(\lambda_{a,i}\) in (55) are averaged over four windows, i.e.,

\[\bar{\lambda}_{u,i}=\frac{1}{4}\sum_{n=i-3}^{i}\lambda_{u,n},\ \ \bar{\lambda}_{a,i}=\frac{1}{4}\sum_{n=i-3}^{i}\lambda_{a,n}. \tag{56}\]

The amplified attended speech vector \(\mathbf{\hat{s}}_{u,i}\) and the attenuated unattended speech vector \(\mathbf{\hat{s}}_{u,i}\) in window \(i\) are finally obtained as

\[\mathbf{\hat{s}}_{u,i}=\bar{\lambda}_{u,i}\mathbf{\hat{s}}_{u,i}, \tag{57}\]

\[\mathbf{\hat{s}}_{u,i}=\bar{\lambda}_{u,i}\mathbf{\hat{s}}_{u,i}. \tag{58}\]

These signals are then presented to the participant via two loudspeakers. The AGC was implemented and run using MATLAB (MATLAB 2 in Figure 2). The sampling frequency of the speech signals of both speakers was equal to 44,100 Hz. The maximum desired SIR in (50) was set to 7 dB. The speech enhancement performance of the AGC was evaluated in terms of the SIR improvement \(\Delta\text{SIR}\), i.e.,

\[\Delta\text{SIR}=\text{SIR}_{out}-\text{SIR}_{in}, \tag{59}\]with

\[\text{SIR}_{in}=10\log_{10}\left( \begin{array}{c}\sum\limits_{i=1}^{I}\mathbf{s}_ {a,i}^{T}\mathbf{s}_{a,i}\\ \sum\limits_{i=1}^{I}\mathbf{s}_{u,i}^{T}\mathbf{s}_{u,i}\end{array} \right), \tag{60}\]

\[\text{SIR}_{out}=10\log_{10}\left( \begin{array}{c}\sum\limits_{i=1}^{I} \mathbf{s}_{a,i}^{T}\mathbf{s}_{a,i}\\ \sum\limits_{i=1}^{I}\mathbf{s}_{u,i}^{T}\mathbf{s}_{u,i}\end{array} \right), \tag{61}\]

where \(\mathbf{s}_{a,i}\) and \(\mathbf{s}_{u,i}\) denote the (oracle) attended and unattended speech vectors, defined similarly as in (47). ## 3 Results

In this section, we evaluate the decoding performance and the speech enhancement performance of the proposed cognitive-driven gain controller system described in the previous section. In Section 3.1, we evaluate the decoding performance of the proposed AAD algorithms for the open-loop and the closed-loop AAD phase. In Section 3.2, we evaluate the speech enhancement performance of the AGC for the closed-loop AAD phase. Finally, in Section 3.3, we compare the subjective evaluation between the open-loop and the closed-loop AAD phase. ### Auditory Attention Decoding Performance

For all considered AAD algorithms (LW-GLM, LW-SSM, and SW-SSM), Figure 5 depicts the correlation coefficients \(\rho_{1,k}\) and \(\rho_{2,k}\) of speaker 1 and speaker 2 and the probability of attending to speaker 1, i.e., \(P\Big{(}\hat{d}_{i}=1\Big{)}\) or \(P\Big{(}\hat{d}_{i}=2\Big{)}\), for an exemplary session from the open-loop AAD phase. It can be observed that all AAD algorithms translate the fluctuating correlation coefficients into smooth probabilistic attention measures. When using the large correlation window, i.e., LW-GLM and LW-SSM, the correlation coefficients are more discriminative and the probabilistic attention measures are more reliable with a lower variability compared to using the small correlation window, i.e., SW-SSM.