# Diffuse Optical Tomography Using Bayesian Filtering in the Human Brain
## 2 Material and Methods
### Physiological Signal Modeling  
The Kalman filter [14] can be used to extract the Bayesian distribution of the state in the Gaussian state space model, and it is defined as:  
\[\overrightarrow{x}(t_{k+1})=A_{k}\overrightarrow{x}(t_{k})+\overrightarrow{w}( t_{k});\ \overrightarrow{z}(t_{k})=H_{k}\overrightarrow{x}(t_{k})+\overrightarrow{v}(t_ {k}) \tag{1}\]  
where \(\overrightarrow{x}(t_{k})\in\mathbb{R}^{n}\) is the state at time \(t_{k},\ k(k=0,1,2\ \dots\ ), \(\overrightarrow{z}(t_{k})\in\mathbb{R}^{d}\) is the measurement at time \(t_{k},\ A_{k}\) is the state transition matrix, \(H_{k}\) is the observation model, \(\overrightarrow{w}(t_{k})\sim N(0,Q_{k})\) is the Gaussian process noise, \(\overrightarrow{v}(t_{k})\sim N(0,R_{k})\) is the gaussian measurement noise, \(Q_{k}\) is the covariance of process noise, and \(R_{k}\) is the covariance of measurement noise. However, Kalman filters are based on linear dynamical systems discretized in the time domain. Therefore, at each discrete time increment, a linear operator is applied to the state to generate the new state, including some noise. Physiological signals, such as the respiration rate, contain periodicity and are time-varying; therefore, the Equation (1) must be expressed in a continuous dynamic model following the Wiener process [15]:  
\[\frac{d\overrightarrow{x}(t)}{dt}=F\overrightarrow{x}(t)+L\overrightarrow{ \xi}(t) \tag{2}\]  
where \(F\) models the dynamics of the state and \(L\) the state-dependent noise; \(\overrightarrow{\xi}(t)\) is a white noise process with a given spectral density matrix \(W\). If \(\Delta t_{k}=t_{k+1}-t_{k}\), the weak solution for continuous-time stochastic differential equation [16] can be expressed as:  
\[\overrightarrow{x}(t_{k+1})=exp\ (F\Delta t_{k})\overrightarrow{x}(t_{k})+\int_{t_ {k}}^{t_{k+1}}exp\ ((t_{k+1})F)\overrightarrow{L\xi}(s)ds \tag{3}\]  
Figure 1: Representation of the optical fibers on the boundary of the frontal cortex in a real space. Definition of nearest neighbor measurements (**a**): The photon trajectory follows a banana path (arrows); therefore, detections at a 10–20 mm distance from the source (S) provide information from extracerebral layers, while detections 30–40 mm from the source also provide information from intracerebral layers. Source-detector pairs are separated by 1 cm in frontal and sagittal views. A total of 64 optical fiber forms the matrix, providing 2048 optical channels thanks to colocalization. Note the rigid structure holding the tip of the optical fibers in place in order to ensure the optical fiber-scal coupling (**b**). Here, if we define \(A_{k}=exp\ (F\Delta t_{k})\), we arrive at an equivalent model to the one expressed in Equation (1). When assuming that there is a reference sensor to measure the respiratory rate \(S(t)\), the signal can be modeled as a zero-mean periodic signal with period frequency \(f\), which can be approximated to expanded Fourier series:  
\[S(t)\approx\sum_{n=1}^{N}a_{n}\cos(2\pi nft)+b_{n}\sin(2\pi nft) \tag{4}\]  
As our interest is periodic signal modeling \(S(t)\), where the frequency \(f_{t}\) is a function of time, then the Equation (5) can be written as:  
\[S(t)\approx\sum_{n=1}^{N}a_{n}\cos(2\pi n(f_{t})t)+b_{n}\sin(2\pi n(f_{t})t) \tag{5}\]  
where \(n\) refers to the physiological signals in terms of the frequency in time \(t\). Neither coefficients \(a\) nor \(b\) are considered time-varying, but simply amplitude constants. Equation (5) can be described as a differential equation, where the constant frequency is replaced by a time-varying one in order to avoid the problem of both \(a\) and \(b\) being constant coefficients, and to maintain the continuity property in the frequency domain.