## 2 Mathematical Formulation of Object Localization and Tracking Algorithms
### TOF Estimation
#### 2.3.2 NRLM Algorithm for TOF Estimation  
To estimate the unknown parameters \(\mathbf{z_{g}}\) in (7) and \(\mathbf{z_{d}}\) in (8), the nonlinear curve-fitting algorithm using NRLM is applied on the GN model and the DE model in this study. First, the algorithm to estimate \(\mathbf{z_{g}}\) in the GN model is developed. Suppose \(y_{i}\), \(i=1\sim m\) is the measurement value of the envelope data in each frame. To formulate the curve-fitting problem with the GN model (7), the object function can be constructed as follows:  
\[\sum_{i=1}^{m}(y_{i}-h_{g}\big{(}\mathbf{z_{g}},t_{i})\big{)}^{2} \tag{9}\]  
Furthermore, the nonlinear LS problem can be obtained such that:  
\[\operatorname*{argmin}_{\mathbf{z}}\sum_{i=1}^{m}(y_{i}-h_{g}\big{(}\mathbf{z _{g}},t_{i})\big{)}^{2} \tag{10}\]  
which represents the minimum summation of the squared errors between measurement values and model values at the corresponding points in time. An argument vector can be constructed as: \(\mathbf{r}(\mathbf{z}_{g})=[r_{1}(\mathbf{z}_{g})\dots r_{m}(\mathbf{z}_{g})]^{\intercal}\) where \(r_{i}(\mathbf{z}_{g})=y_{i}-h_{g}(\mathbf{z}_{g},t_{i})\), and the object function (9) can be rewritten as follows:  
\[f(\mathbf{z}_{g})=\mathbf{r}(\mathbf{z}_{g})^{\intercal}\mathbf{r}(\mathbf{z }_{g}) \tag{11}\]  
To apply the NR algorithm for a nonlinear LS problem, the Jacobian matrix \(\mathbf{J}_{g}(\mathbf{z}_{g})\) of \(\mathbf{z}_{g}\), the gradient \(\mathbf{\
abla}_{\mathbf{z}_{g}}f(\mathbf{z}_{g})\), and Hessian matrix \(\mathbf{H}(\mathbf{z}_{g})\) of \(f(\mathbf{z}_{g})\) are needed to be calculated first. The Jacobian matrix \(\mathbf{J}_{g}(\mathbf{z}_{g})\) is as follows:  
\[\mathbf{J}_{g}(\mathbf{z}_{g})= \begin{bmatrix}\dfrac{\partial r_{1}(\mathbf{z }_{g})}{\partial z_{g1}}&\dots&\dfrac{\partial r_{1}(\mathbf{z}_{g})}{ \partial z_{gn}}\\ \vdots&\ddots&\vdots\\ \dfrac{\partial r_{m}(\mathbf{z}_{g})}{\partial z_{g1}}&\dots&\dfrac{ \partial r_{m}(\mathbf{z}_{g})}{\partial z_{gn}}\end{bmatrix} = \begin{bmatrix} \dfrac{\partial r_{1}(\mathbf{z}_{g})}{\partial t_{0}}&\dfrac{\partial r_{ 1}(\mathbf{z}_{g})}{\partial a_{g}}&\dfrac{\partial r_{1}(\mathbf{z}_{g})}{ \partial a}&\dfrac{\partial r_{1}(\mathbf{z}_{g})}{\partial p}\\ \vdots&\vdots&\vdots&\vdots\\ \dfrac{\partial r_{m}(\mathbf{z}_{g})}{\partial t_{0}}&\dfrac{\partial r_{m} (\mathbf{z}_{g})}{\partial a_{g}}&\dfrac{\partial r_{m}(\mathbf{z}_{g})}{ \partial\alpha}&\dfrac{\partial r_{m}(\mathbf{z}_{g})}{\partial p}\end{bmatrix}  \tag{12}\]  
where \(n=4\) in this study, and \(z_{g1}=t_{0}\), \(z_{g2}=a_{g}\), \(z_{g3}=\alpha\), and \(z_{g4}=p\), respectively. Therefore, the Jacobian matrix \(\mathbf{J}_{g}(\mathbf{z}_{g})\) of this problem is a \(m\times 4\) matrix with elements as follows:  
\[\mathbf{J}_{g}(\mathbf{z}_{g})_{i,1}= \dfrac{a_{g}}{p}\Big{(}\alpha+\dfrac{t_{i}-t_{0}}{p}\Big{)}\Big{(} \dfrac{t_{i}-t_{0}}{p}\Big{)}^{\alpha-1}e^{\big{(}\frac{t_{i}-t_{0}}{p}\big{)}} \tag{13}\] \[\mathbf{J}_{g}(\mathbf{z}_{g})_{i,2}= -\Big{(}\dfrac{t_{i}-t_{0}}{p}\Big{)}^{\alpha}e^{\big{(}\frac{t_{ i}-t_{0}}{p}\big{)}}\] (14) \[\mathbf{J}_{g}(\mathbf{z}_{g})_{i,3}= -a_{g}\Big{(}\dfrac{t_{i}-t_{0}}{p}\Big{)}^{\alpha}e^{\big{(} \frac{t_{i}-t_{0}}{p}\big{)}}\ln\Big{(}\dfrac{t_{i}-t_{0}}{p}\Big{)}\] (15) \[\mathbf{J}_{g}(\mathbf{z}_{g})_{i,A}= \dfrac{a_{g}}{p}\Big{(}\dfrac{t_{i}-t_{0}}{p}\Big{)}^{\alpha}e^{ \big{(}\frac{t_{i}-t_{0}}{p}\big{)}}\Big{(}\alpha+\dfrac{t_{i}-t_{0}}{p}\Big{)} \tag{16}\]  
where \(\mathbf{J}_{g}(\mathbf{z}_{g})_{i,j}\) is the \((i,j)\)th element of the Jacobian matrix \(\mathbf{J}_{g}(\mathbf{z}_{g})\), and \(i=1\sim m\).