# A Bayesian Modeling Approach to Situated Design of Personalized Soundscaping Algorithms
## 2 Methods
### Problem Statement and Proposed Solution Framework  
The goal of this work is to present an automated design methodology for monaural (single microphone-based) situated soundscaping algorithms for and by hearing aid users. With this methodology noise reduction algorithms can be tailored to an individual without the need of an intervening team of engineers. Our approach automates the design process by specifying the underlying signal processing algorithm design tasks as automatable inference tasks on a generative model. Because we do not have any specific information about observed signals in situated settings, we choose for a general modeling approach in which we assume that the received signal comprises a mixture of desired and undesired signals. These constituent source signals are modeled on the spot during the source modeling stage. For this purpose we use probabilistic sub-models that can be designed for stationary or non-stationary acoustic signals. These estimated sub-models are subsequently used in the source separation stage to extract the underlying source signals, which are then individually amplified or suppressed during the soundscaping stage according to the preferences of the user. In this section, we first introduce a minimal generative model for the observed mixture signal. Then, each task in the soundscaping framework (source modeling, source separation and soundscaping) is formally described as an automatable probabilistic inference procedure on this minimal generative model. Consider an observed mixture signal \(x_{n}\) at time steps \(n=1,2,\ldots,N\), which is composed of latent source signals \(s_{n}^{k}\), with \(k=1,2,\ldots,K\) denoting the source index. These latent source signals are modeled by latent states \(z_{n}^{k}\), which are controlled by the time invariant model parameters \(\theta^{k}\). The generated output signal of the soundscaping system \(y_{n}\) is a mixture of re-weighted source signals, controlled by user preferences \(w^{k}\), which we assume to be static in this work. Specifically, we define a generative model \(p(y,\ w,\ x,\ s,\ z,\ \theta)\), where the variables with omitted indices refer to the sets of those variables over the omitted variables, e.g., \(y=\{y_{n}\}_{n=1}^{N}\) and \(s=\{s^{k}\}_{k=1}^{K}\), as  
\[p(y,\ w,\ x,\ s,\ z,\ \theta)=\underbrace{p(w)\ p(\theta)\ p(z_{0})}_{\text{ priors}}\ \prod_{s=1}^{N}\underbrace{p(y_{n}\mid w,\ s_{n})}_{\text{sousdcaping}} \underbrace{ \begin{subarray}{c}p(x_{n}\mid s_{n})\\ \text{mixture}\end{subarray} }_{\text{mixing}}\ \prod_{k=1}^{K}\ \underbrace{p(s_{n}^{k},\ z_{n}^{k}\mid z_{n-1}^{k},\ \theta^{k})}_{\text{moving}}. \tag{1}\]  
Equation (1) factorizes the full generative model into three main factors: soundscaping \(p(y_{n}\mid w,\ s_{n})\), source mixing \(p(x_{n}\mid s_{n})\) and source modeling \(p(s_{n}^{k},\ z_{n}^{k}\mid z_{n-1}^{k},\ \theta^{k})\). In this particular model, the \(K\) constituent source signals are assumed to be statistically independent. The source mixing term \(p(x_{n}\mid s_{n})\) describes how the observed signal \(x_{n}\) is formed by its constituent source signals \(s_{n}\). The soundscaping factor \(p(y_{n}\mid w,\ s_{n})\) models the processed output signal \(y_{n}\) based on the user preferences \(w^{k}\) and individual source signals \(s_{n}^{k}\). For modeling the source signals \(s_{n}^{k}\) we use the source modeling factor \(p(s_{n}^{k},\ z_{n}^{k}\mid z_{n-1}^{k},\ \theta^{k})\). This term describes how the source signal \(s_{n}^{k}\) and its latent state \(z_{n}\) are modeled as a dynamical system with previous latent state \(z_{n-1}^{k}\) and transition parameters \(\theta^{k}\). Note that the source modeling term \(p(s_{n}^{k},\ z_{n}^{k}\mid z_{n-1}^{k},\ \theta^{k})\) can be expanded or constrained according to the complexity of the signal that we wish to model. A further specification of the generative model will be given in Section 2.2.