## 3 Algorithm Development
The amplitudes \(\theta_{s,c}\) are calculated as \[\theta_{s,c}=\dfrac{|\tilde{u}_{s,c}|+\sqrt{|\tilde{u}_{s,c}|^{2}+4z_{s,c} \gamma_{1}(1+\gamma_{1}\chi)}}{2(1+\gamma_{1}\chi)}\] (17) for Poissonian noise and as the non-negative solution of the cubic Cardan equation \[\theta_{s,c}^{3}+C\theta_{s,c}+D=0,\] (18) \[C=\dfrac{\sigma^{2}}{2\gamma_{1}}-z_{s,c},\;D=-\dfrac{\sigma^{2}}{2 \gamma_{1}}|\tilde{u}_{s,c}|.\] for the Gaussian noise [32]. The input-ouput model of this filtering we denote as \(u_{s,c}=\Phi_{1}(\tilde{u}_{s,c},z_{s,c})\), where the operator \(\Phi_{1}\) is defined by the Equations (15)-(18). Let us clarify meaning of the operations in Equation (15). Say \(c=R\), then for all sensor pixels with the red filter, \(x\in\Omega_{R}\), the amplitudes are updated using the corresponding \(R\) measurements, the first line in Equation (15). For all other pixels \(u_{s,R}=\tilde{u}_{s,R}\), i.e., the amplitude of the \(\tilde{u}_{s,R}\) is not changed, the second line in Equation (15). In similar way, it works for all colors. This preserving the signal value if the sensor is not able to provide the relevant observation is proposed and used in [32] for subsampled or undersampled observations. This rule can be interpreted as a complex domain interpolation of the wavefront at the sensor plane as well as a demosaicing algorithm for diffraction pattern observations. It is important to note that this observation processing is derived as an optimal solution for noisy data. 2. Minimization of \(\mathcal{L}\) with respect to \(u_{o,\lambda}\). The last two summands in \(\mathcal{L}\) can be rewritten as \[\dfrac{1}{\gamma_{1}}\sum_{s}\sum_{\lambda}||u_{s,\lambda}-\mathcal{P}_{s, \lambda}u_{o,\lambda}||_{2}^{2}+\dfrac{1}{\gamma_{2}}\sum_{\lambda}||b_{o, \lambda}\exp(j(\mu_{\lambda}\cdot\varphi+\delta_{\lambda}))-u_{o,\lambda}||_{ 2}^{2}.\] Then, we obtain as an optimal estimate for \(u_{o,\lambda}\) \[u_{o,\lambda}=(\sum_{s}\mathcal{P}_{s,\lambda}^{*}\mathcal{P}_{s,\lambda}+I \gamma_{1}/\gamma_{2})^{-1}\times(\sum_{s}\mathcal{P}_{s,\lambda}^{*}\tilde{u} _{s,\lambda}+\gamma_{1}/\gamma_{2}b_{o,\lambda}\exp(j\mu_{\lambda}\varphi)).\] (19) If \(\mathcal{P}_{s,\lambda}\) are orthonormal such that \(\sum_{s}\mathcal{P}_{s,\lambda}^{*}\mathcal{P}_{s,\lambda}\) is the identity operator, \(\sum_{s}\mathcal{P}_{s,\lambda}^{*}\mathcal{P}_{s,\lambda}=I\), the solution takes the form \[u_{o,\lambda}=\dfrac{\sum_{s}\mathcal{P}_{s}^{*}\tilde{u}_{s,\lambda}+\gamma_{ 1}/\gamma_{2}b_{o,\lambda}\exp(j\mu_{\lambda}\varphi_{o})}{1+\gamma_{1}/\gamma_ {2}}.\] (20)
3. Minimization of \(\mathcal{L}\) on \(b_{o,\lambda}\), \(\varphi_{o}\) and \(\delta_{\lambda}\) (the last summand in the criterion Equation (14)) is the non-linear least square fitting of \(u_{o,\lambda}\) by the parameters \(b_{o,\lambda}\), \(\varphi_{o}\) and \(\delta_{\lambda}\). We simplify this problem assuming that \(b_{o,\lambda}\simeq|u_{o,\lambda}|\). Then, the criterion for this non-linear least square fitting takes the form: \[\mathcal{L}_{1}(\varphi\,,\;\delta_{\lambda})=\sum_{\lambda}||u_{o,\lambda}| \cdot[\exp(j(\mu_{\lambda}\cdot\varphi_{o}))-\exp(j(\psi_{o,\lambda}-\delta_ {\lambda}))]||_{2}^{2},\] (21) where \(\psi_{o,\lambda}=angle(u_{o,\lambda})\), i.e., the wrapped phase of \(u_{o,\lambda}\). In this representation, the phase shifts \(\delta_{\lambda}\) are addressed to the wrapped phases \(\psi_{o,\lambda}\) in order to stress that the complex exponent \(\exp(j(\psi_{o,\lambda}))\) can be not in-phase with \(\exp(j(\mu_{\lambda}\cdot\varphi_{o}))\) and the variables \(\delta_{\lambda}\) serve in order to compensation this phase difference and make the phase modeling of the object by \(\exp(j(\mu_{\lambda}\cdot\varphi_{o}))\) corresponding to the complex exponent \(\exp(j(\psi_{o\lambda}))\). The assumption \(b_{o,\lambda}\simeq|u_{o,\lambda}|\) is supported in our algorithm implementation by the initialization procedure enabling the high accuracy estimation of the amplitudes \(|u_{o,\lambda}|\) in processing of separate wavelength observations.