# Improvement of Fresnel Diffraction Convolution Algorithm
## 2 Methods  
Practical numerical calculation of Fresnel diffraction integrals with the help of Fourier transforms proceeds as follows:  
\[\mathrm{U}(\mathrm{x},\mathrm{y})=\mathcal{F}^{-1}\{\mathcal{F}\{\mathrm{U}_{ \mathrm{o}}(\mathrm{x},\mathrm{y})\}\mathrm{H}(\mathrm{u},\mathrm{v})\}, \tag{1}\]  
where \(\mathcal{F}\{\}\) stands for the Fourier transform, \(\mathcal{F}^{-1}\{\}\) stands for the inverse Fourier transform, and \(\mathrm{u}\) and \(\mathrm{v}\) are the spatial-spectral coordinates. The Fourier transform and its inverse are usually accomplished with FFT and IFFT (inverse fast Fourier transform). When the T-FFT algorithm is used, the transfer function \(\mathrm{H}(\mathrm{u},\mathrm{v})\) is calculated using the following equation:  
\[\mathrm{H}(\mathrm{u},\mathrm{v})=\mathcal{F}\bigg{\{}\frac{\exp(\mathrm{j} \mathrm{k}\mathrm{d})}{\mathrm{j}\mathrm{d}}\mathrm{exp}\bigg{[}\frac{\mathrm{ j}\mathrm{k}}{2\mathrm{d}}\big{(}\mathrm{x}^{2}+\mathrm{y}^{2}\big{)}\bigg{]} \bigg{\}}, \tag{2}\]  
Since \(\mathrm{H}(\mathrm{u},\mathrm{v})\) has analytic solutions:  
\[\mathrm{H}(\mathrm{u},\mathrm{v})=\exp\Big{\{}\mathrm{j}\mathrm{k}\mathrm{d} \Big{[}1-\lambda^{2}\Big{(}\mathrm{u}^{2}+\mathrm{v}^{2}\Big{)}/2\Big{]} \bigg{\}}, \tag{3}\]  
The corresponding diffraction algorithm is referred to as the D-FFT algorithm. In order to ensure the accuracy of the calculation results, both the D-FFT algorithm and the T-FFT algorithm must satisfy the Nyquist sampling theorem. Assuming that the optical field \(\mathrm{U}_{\mathrm{o}}(\mathrm{x},\mathrm{y})\) satisfies the sampling theorem, to obtain the correct calculation results, it is required that the maximum phase difference between two neighboring sampling points in Equations (2) and (3) is no greater than \(\pi\). Based on this condition, it is easy to infer that the diffraction distance d must be satisfied as follows:  
\[\text{d}\leq{\text{L}_{\text{o}}}^{2}/(\text{N}\text{N}),\text{ for D-FFT} \tag{4}\]  
\[\text{d}\geq{\text{L}_{\text{o}}}^{2}/(\text{N}\text{N}),\text{ for T-FFT} \tag{5}\]  
where \({\text{L}_{\text{o}}}\) is the physical size of the diffraction surface, and N is the number of sampling points. The criterion of the two algorithms is \({\text{d}_{\text{t}}}={\text{L}_{\text{o}}}^{2}/(\text{N}\text{N})\)[16]. The T-FFT algorithm is applicable for a problem of diffraction distance more than \({\text{d}_{\text{t}}}\), but the calculation error cannot be ignored since there is no analytical solution for the transfer function of T-FFT. The transfer function of the D-FFT algorithm has an analytical solution; however, it is not suitable for the issue of \({\text{d}}\geq{\text{L}_{\text{o}}}^{2}/(\text{N}\text{N})\). According to ref. [21], forcing the part of phase distortion in the transfer function of the D-FFT algorithm to be zero can engineer the D-FFT algorithm to be applicable to a problem of diffraction distance more than \({\text{d}_{\text{t}}}\), but it will introduce a ringing noise. To eliminate the under-sampling effect of the transfer function without inducing the ringing effect, a two-dimensional Tukey window with smooth edges is selected to filter the transfer function of D-FFT:  
\[\text{P}(\text{u},\text{v})=\left\{ \begin{array}{ll}0\text{ if }|\frac{\partial(\text{ phase})}{\partial(\text{u})}|>\pi\text{ or }|\frac{\partial(\text{ phase})}{\partial(\text{v})}|>\pi\\ \text{tukwin}(\text{u},\text{v},\beta)\text{ \ \ otherwise}\end{array} \right., \tag{6}\]  
where phase is the phase of the transfer function of D-FFT, \(\text{tukwin}(\text{u},\text{v},\beta)\) is a two-dimensional Tukey window in the frequency domain, the edge smoothing factor \(\beta\) is the coefficient of the value interval at \((0,1)\), and \(\text{u}\), \(\text{v}\) are the frequency domain coordinates.