## 3 Stable Source Identification Algorithm
### Stable Algorithm for the Inverse Source Problem  
For the inverse problem, we consider that the exact (ideal) measurement \(V(\theta)=\sum_{k=1}^{\infty}V_{k}^{1}\cos k\theta+V_{k}^{2}\sin k\theta\) is known, where \(V_{k}^{1}\) and \(V_{k}^{2}\) are the Fourier coefficients of \(V\). Using Equation (8), we obtain the Fourier coefficients of the source, \(g\).  
\[\begin{split} g_{k}^{i}=&\frac{V_{k}^{i}}{a_{k}}= \frac{k(\sigma_{1}-\sigma_{2})}{2R_{1}}\bigg{(}\frac{R_{1}}{R_{2}}\bigg{)}^{k} V_{k}^{i}+\\ &\frac{k(\sigma_{1}+\sigma_{2})}{2R_{1}}\bigg{(}\frac{R_{2}}{R_{ 1}}\bigg{)}^{k}V_{k}^{i},\ \ i=1,2.\end{split} \tag{10}\]  
In practice, the measurement has errors for various reasons, such as errors from the measurement device, truncation errors, and the application of filters to eliminate unwanted signals (signal contamination). The error in the measurement is reflected in its Fouriercoefficients, which must be considered carefully since the inverse source problem is numerically unstable. More specifically, the error in the coefficients is reflected in the term \(\left(\frac{R_{2}}{R_{1}}\right)^{k}\), \(k=1,2,...\) of the coefficients in Equation (10). Note that as these terms grow with increasing \(k\), even a small error in the measurement \(V\) can result in significant changes to the location of the source. More precisely, if we know \(V_{\delta}\) instead of \(V\) and consider measurement \(V_{\delta}(\theta)=\sum\limits_{k=1}^{\infty}V_{k,\delta}^{1}\cos k\theta+V_{ k,\delta}^{2}\sin k\theta\), with \(\left\|V-V_{\delta}\right\|_{L_{2}(S_{2})}\leq\delta\), the Fourier coefficients of the recovered sources are given by Equation (11):  
\[\begin{split} g_{k,\delta}^{i}=&\frac{V_{k,\delta}^ {i}}{a_{k}}=\frac{k(\sigma_{1}-\sigma_{2})}{2R_{1}}\left(\frac{R_{1}}{R_{2}} \right)^{k}V_{k,\delta}^{i}+\\ &\frac{k(\sigma_{1}+\sigma_{2})}{2R_{1}}\bigg{(}\frac{R_{2}}{R_{1 }}\bigg{)}^{k}V_{k,\delta}^{i},\ \ i=1,2.\end{split} \tag{11}\]  
However, the terms \(\left(\frac{R_{2}}{R_{1}}\right)^{k}V_{k,\delta}^{i}\) amplify the errors, and the series of the recovered source may not converge. To address this numerical instability, the Tikhonov functional is used [5]:  
\[J_{\alpha(\delta)}(g)=\frac{1}{2}\|A(g)-V\|_{L_{2}(S_{1})}^{2}+\frac{\alpha( \delta)}{2}\|g\|_{L_{2}(S_{2})}^{2}, \tag{12}\]  
where \(\alpha(\delta)>0\) is the Tikhonov regularization parameter, which can be chosen using the L-curve criterion [22], and \(\|\cdot\|_{L_{2}(S_{i})}^{2}\) denotes the norm of \(L_{2}(S_{i})\), for \(i=1,2\). To find the unique minimum of \(J_{\alpha(\delta)}\), we must solve the normal equations [5] given by:  
\[[A^{*}A+\alpha(\delta)I](g)=A^{*}V, \tag{13}\]  
where \(A^{*}:L_{2,\perp}(S_{2})\to L_{2,\perp}(S_{1})\) is the adjoint operator of \(A\), which is given by [7]:  
\[A^{*}(h)(\theta)=\frac{R_{2}}{R_{1}}\sum\limits_{k=1}^{\infty}a_{k}h_{k}^{1} \cos k\theta+a_{k}h_{k}^{2}\sin k\theta, \tag{14}\]  
where \(h(\theta)=\sum\limits_{k=1}^{\infty}h_{k}^{1}\cos k\theta+h_{k}^{2}\sin k\theta\), and \(a_{k}\) is given by Equation (9).  
After substituting into the normal Equations (13), we obtain the regularized solution:  
\[g_{\alpha(\delta)}(\theta)=\sum\limits_{k=1}^{\infty}A_{k}(\alpha)\Big{[}V_{ k,\delta}^{1}\cos k\theta+V_{k,\delta}^{2}\sin k\theta\Big{]}, \tag{15}\]  
where  
\[A_{k}(\alpha)=\frac{a_{k}R_{2}}{(a_{k})^{2}R_{2}+\alpha(\delta)R_{1}}. \tag{16}\]  
**Remark 1**.: _When \(\alpha=0\) in (15), the Fourier coefficients of the recovered source coincide with the coefficients given in Equation (11). Equation (15), obtained from the Tikhonov functional (12), provides us with a stable algorithm for recovering the regularized source \(g_{\alpha(\delta)}\) from the measurement \(V_{\delta}\). This algorithm will be implemented on the FPGA, and in the next section, we will illustrate algorithm (15) by implementing examples in MATLAB as a first step._