# Enhanced Phase Retrieval Method Based on Random Phase Modulation
## 2 Methods  
In the beam-propagation-based random phase modulated methods, the variable random phase modulations are produced by an SLM which is inserted between the object plane and the recording plane, as displayed in Figure 1. The diffraction pattern \(I_{m}\), which is modulated by the random phase \(\varphi_{m}\), is collected by a charge-coupled device (CCD), where \(m~{}=~{}1,2,\ldots,M\), and \(M\) is the number of measurement intensities. The distance between the object and SLM plane is denoted as \(Z1\), and that between the SLM and CCD plane is \(Z2\). Figure 1: Schematic of the optical set-up. \(\varphi_{m}\) is the modulated random phase, and \(I_{m}\) is the corresponding recorded intensity. The algorithm architectures of the serial and parallel frameworks are outlined in Figure 2a,b, respectively. The iterations of the two algorithms begin with the plane before SLM, denoted by \(U_{n}\), which contains the diffraction information of the targeted object, where \(n\) is the iteration number. Additionally, \(U_{N}\) is the result after \(N\) iterations, and the reconstructed object field is calculated by propagation \(U_{N}\) back to the object plane, which is realized by the angular spectrum propagation operator \(\mathbf{D}_{Z1}^{-1}\), where the subscript is the diffractive distance. In every iteration of the serial framework, \(U_{n}\) is sequentially refined by \(M\) pairs of modulated random phases \(\varphi_{1},\varphi_{2},\ldots,\varphi_{M}\) and the corresponding decoded intensities \(I_{1},I_{2},\ldots,I_{M}\). As the numbers in yellow circles shown in Figure 2a, the updates of \(U_{n}\) from the first pair of data \(I_{1}\) and \(\varphi_{1}\) to the last pair of \(I_{M}\) and \(\varphi_{M}\) perform \(M\) times in one iteration. Accordingly, the serial framework holds the ability of rapid convergence. Nevertheless, the stability is affected since every update uses only one pair of data. In addition, the noise immunity of the serial method is poor, because there is no anti-noise action in the reconstruction process. More importantly, the introduction of SLM brings about random modulation noise, the use of a coherent light source generates speckle noise, and dark current noise exists in the CCD. As a result, the quality of the reconstructed results decreases in practical application. In the parallel framework, the average of the refined results obtained by all the pairs of the measurements and the corresponding random phases separately is used to update \(U_{n}\). Thus, the robustness and noise immunity are improved. The average operation has the ability to work as a low-pass filter to suppress noise. However, the convergence speed of the parallel framework is reduced since the \(U_{n}\) is updated only once in every iteration, as the number in the yellow circle shown in Figure 2b. The refinement procedure of \(U_{n}\) using the \(m\)-th pair of random phase \(\varphi_{m}\) and the corresponding intensity \(I_{m}\) is illustrated in Figure 3. The refinement procedure proceeds with the following steps:  
1. \(U_{n}\) is modulated by the random phase \(\varphi_{m}\), yielding a modulated field \(U_{n}\exp(j\varphi_{m})\);
2. The modulated field is numerically propagated into the recording plane by the angular spectrum propagation operator \(\mathbf{D}_{Z2}\);
3. The measurement intensity \(I_{m}\) is used to replace the magnitude of the calculated distribution of recording plane;
4. After the replacement, the field is propagated back to the SLM plane by \(\mathbf{D}_{Z2}^{-1}\);
5. The random phase modulation in step (1) is removed to generate a refined estimation of \(U_{n}\). The refinement procedure can be applied to both serial and parallel frameworks. Figure 2: Reconstruction framework of serial and parallel algorithms: (**a**) the serial framework; (**b**) the parallel framework. Numbers in the yellow circles indicate the update times of \(U_{n}\) in one iteration.