1 Introduction

Retrieving phase information is a vital part in various imaging systems and plays an important role on many technical and scientific applications such as biological tissue imaging [1,2,3], X-ray crystallography [4,5,6,7], microwave holography [8], fringe pattern analysis [9], astronomy imaging [10,11,12], antenna detection [13], and adaptive optics [14,15,16]. In these fields, the object phase is significant but unmeasurable. There are various methods that can be divided in two groups: one using a reference beam (interferometry), and the other without using a reference beam (phase retrieval). The former methods with some forms of reference beam like holography and speckle interferometry have been extensively utilized in 3D imaging and in nondestructive testing [17, 18]. These interferometry methods may be the most appropriate methods to retrieve phase quantitatively, but they require an ideal reference. Therefore, for some imaging systems, these interferometry methods may not be applicable. Phase retrieval requires no reference beam but involves a difficult question as how to retrieve phase from measured diffraction patterns. Depending on the method used, various constraints and approximations are required and some constraints are to be given as a priori knowledge. In most practical manifestations of the technique, the measured diffraction pattern is the squared modulus of the first constrains set [19]. An additional support constraint requires the reconstructed image to be zero-valued outside a given region, corresponding to a finite support bounding the sample in the physical experiment [20]. Expect for two common constraints mentioned above, the gradient descent algorithm, simulated annealing algorithm, or genetic algorithm can also provide strong constraints for phase retrieval [21,22,23]. In addition, combining multiple diffraction data sets with overlapping illuminations (PIE or ePIE) [24, 25], rotating a single cylindrical lens perpendicular to the optical axis (RSCL) [26], and recording multiple intensity patterns of the object at different positions (SBMIR) [27, 28] give more constraints for retrieving phase. However, these methods (PIE and SBMIR) need two-dimensional or one-dimensional scanning to obtain multiple intensity patterns. During the scanning process, the displacement error and the optical path tilt error will affect the retrieval accuracy [29,30,31].

In this paper, a new phase retrieval method using sequential phase modulations (PRSPM) is proposed in which different modulation phase plates with known distribution is used to get different diffraction intensity patterns. Multiple diffraction intensity patterns give stronger constraints in phase retrieval. Compared with PIE or SBMIR, there is no displacement error and optical path tilt error and an algorithm with fast convergence is obtained. The more complex spectrum information of unknown object is, the more difficult the retrieval is. Therefore, the complexity parameter is defined to guide the choice of modulation phases.

There are three requirements for modulation phases: (1) the complexity of unknown object should be contained between the maximum and minimum complexities of modulation phases. (2) The modulation phases with known distributions are continuous in this paper. Because multiple diffraction intensities are obtained using random phase modulations, there is the effect of the pixel crosstalk of spatial light modulation (SLM) in the experiment [32,33,34,35]. To reduce the effect of pixel crosstalk of SLM, the SLM patterns should be locally smooth [35]. (3) The modulation phases should cover different frequency bands. In addition, there is no limit on what kind of modulation phase distribution to choose. In addition, what kind of relationship between different modulation phases is also no requirement. Through rigorous derivations and digital simulations, the feasibility of this method is confirmed.

2 Theoretical model

2.1 The principle of PRSPM

Figure 1 shows the schematic diagram of PRSPM. The unknown wavefront on the object plane (OP) is \(O\left( {x_{o} ,y_{o} } \right)\). Then, \(O\left( {x_{o} ,y_{o} } \right)\) propagates over the distance of \(z_{1}\) to the modulation plane (MP). The incident wavefront of modulation plane is

$$P_{j} \left( {x_{m} ,y_{m} } \right) = \rho_{\text{WWAS}} \left[ {O\left( {x_{o} ,y_{o} } \right)} \right],$$
(1)
Fig. 1
figure 1

Schematic of the recording arrangement of PRSPM

After modulated by the jth modulation phase \(\phi_{j} \left( {x_{m} ,y_{m} } \right)\), the modulated wavefront is

$$S_{j} \left( {x_{m} ,y_{m} } \right) = P_{j} \left( {x_{m} ,y_{m} } \right)\exp \left[ {i\phi_{j} \left( {x_{m} ,y_{m} } \right)} \right],$$
(2)

Then \(S_{j} \left( {x_{m} ,y_{m} } \right)\) propagates distance \(z_{2}\) to the diffraction plane (DP) and the diffraction wavefront is

$$\begin{aligned} D_{j} \left( {x_{d} ,y_{d} } \right) & = \rho_{\text{WWAS}} \left[ {S_{j} \left( {x_{m} ,y_{m} } \right)} \right] \\ & = \sqrt {I_{j} \left( {x_{d} ,y_{d} } \right)} \frac{{D_{j} \left( {x_{d} ,y_{d} } \right)}}{{\left| {D_{j} \left( {x_{d} ,y_{d} } \right)} \right|}} \\ \end{aligned} ,$$
(3)

where \(I_{j} \left( {x_{d} ,y_{d} } \right)\) is

$$I_{j} \left( {x_{d} ,y_{d} } \right) = \left| {D_{j} \left( {x_{d} ,y_{d} } \right)} \right|^{2} ,$$
(4)

In the above propagation processes, the symbol \(\rho_{\text{WWAS}}\) stands for Wide-window Angular Spectrum (WWAS) propagation [36].

Generally, Angular Spectrum (AS) propagation is equivalent to the Rayleigh–Sommerfeld formula which is the accurate diffraction formula in the scalar diffraction theory [37, 38]. However, AS propagation is calculated under short distance, and the sampling interval of input plane is the same as that of output plane which is generally limited by pixel size of the image sensor. Therefore, WWAS propagation is adopted instead of AS propagation in this method. WWAS propagation expands the object plane with zero-padding to satisfy arbitrary distances calculation. Meanwhile, variable sampling interval in input plane can be used by introducing a scale factor.

The WWAS calculation between object plane and modulation plane is explained in detail as an example. Figure 2 shows the geometry of the propagation model between object plane and modulation plane. Q is sampling point in object plane and modulation plane, and R is the sampling point after zero-padding of the calculation window in object plane. R is determined by Eq. (5) as

$$R = \left\lceil {\frac{{2\sqrt 2 z_{1} \lambda }}{{\sqrt { - Q^{2} \lambda^{2} + \sqrt {Q^{4} \lambda^{4} + 64z_{1}^{2} Q^{2} \lambda^{2} } } }}} \right\rceil ,$$
(5)

\(\lambda\) is the wavelength. The sample interval in object plane and modulation plane is \(\Delta x_{1}\) and \(\Delta x_{2}\), respectively. Then the discrete Fourier transform of \(O\left( {x_{o} ,y_{o} } \right)\) can be written as

$$\begin{aligned} A\left( {u_{q} ,v_{q} ,0} \right) & = \sum\limits_{{q = {{ - Q} \mathord{\left/ {\vphantom {{ - Q} 2}} \right. \kern-0pt} 2}}}^{{{Q \mathord{\left/ {\vphantom {Q 2}} \right. \kern-0pt} 2}}} {\sum\limits_{{q = {{ - Q} \mathord{\left/ {\vphantom {{ - Q} 2}} \right. \kern-0pt} 2}}}^{{{Q \mathord{\left/ {\vphantom {Q 2}} \right. \kern-0pt} 2}}} {O\left( {x_{oq} ,y_{oq} } \right)} } \\ & \quad {\kern 1pt} \times \exp \left[ { - i\frac{2\pi }{\alpha }\left( {\alpha u_{q} x_{oq} + \alpha v_{q} y_{oq} } \right)} \right]\Delta x_{1} \Delta x_{1} {\kern 1pt} \\ & = \exp \left[ { - i\frac{\pi }{\alpha }\left( {u_{q}^{2} + v_{q}^{2} } \right)} \right]\Delta x_{1} \Delta x_{1} \left[ {f_{1} \left( {x_{o}^{'} ,y_{o}^{'} } \right) * f_{2} \left( {x_{o}^{'} ,y_{o}^{'} } \right)} \right], \\ \end{aligned}$$
(6)

where \(x_{o}^{'} = \alpha x_{o}\), \(y_{o}^{'} = \alpha y_{o}\), \(f_{1} \left( {x_{o}^{'} ,y_{o}^{'} } \right) = O\left( {{{x_{o}^{'} } \mathord{\left/ {\vphantom {{x_{o}^{'} } \alpha }} \right. \kern-0pt} \alpha },{{y_{o}^{'} } \mathord{\left/ {\vphantom {{y_{o}^{'} } \alpha }} \right. \kern-0pt} \alpha }} \right)\exp\)\(\left\{ { - i\pi {{\left[ {\left( {x_{o}^{'} } \right)^{2} + \left( {y_{o}^{'} } \right)^{2} } \right]} \mathord{\left/ {\vphantom {{\left[ {\left( {x_{o}^{'} } \right)^{2} + \left( {y_{o}^{'} } \right)^{2} } \right]} \alpha }} \right. \kern-0pt} \alpha }} \right\}\), \(f_{2} \left( {x_{m}^{'} ,y_{m}^{'} } \right) = \exp \left\{ {i\pi {{\left[ {\left( {x_{o}^{'} } \right)^{2} + \left( {y_{o}^{'} } \right)^{2} } \right]} \mathord{\left/ {\vphantom {{\left[ {\left( {x_{o}^{'} } \right)^{2} + \left( {y_{o}^{'} } \right)^{2} } \right]} \alpha }} \right. \kern-0pt} \alpha }} \right\}\), the scale factor is \(\alpha = {{\Delta u_{q} } \mathord{\left/ {\vphantom {{\Delta u_{q} } {\Delta x_{1} }}} \right. \kern-0pt} {\Delta x_{1} }} = {1 \mathord{\left/ {\vphantom {1 {\left( {Q\Delta x_{1} \Delta x_{2} } \right)}}} \right. \kern-0pt} {\left( {Q\Delta x_{1} \Delta x_{2} } \right)}}\) and \(*\) denotes the discrete convolution operation. Then \(P_{j} \left( {x_{m} ,y_{m} } \right)\) at the modulation plane is

$$P_{j} \left( {x_{m} ,y_{m} } \right) = \mathcal{F}^{ - 1} \left\{ {A\left( {u_{q} ,v_{q} ,0} \right)\exp \left[ {i2\pi z_{1} \left( {\lambda^{ - 2} - u_{q}^{2} - v_{q}^{2} } \right)^{{{1 \mathord{\left/ {\vphantom {1 2}} \right. \kern-0pt} 2}}} } \right]} \right\},$$
(7)

where \(\mathcal{F}^{ - 1}\) is the inverse Fourier transform (IFFT).

Fig. 2
figure 2

Geometry of the propagation model between OP and MP

In the modulation plane, using different modulation phases receives different diffraction intensities. When the number of phase modulation is n, then n modulation phases constitute a collection \(\phi \left( {x_{m} ,y_{m} } \right) = k{\kern 1pt} [\phi_{1} (x_{m} ,y_{m} ),\phi_{2} (x_{m} ,y_{m} ) \ldots ,\phi_{j} (x_{m} ,y_{m} ), \ldots ,\phi_{n} (x_{m} ,y_{m} )]\), where \(k\) is a constant coefficient. Each time the modulation phase changes, the diffraction intensity also changes. The method using multiple diffraction intensities can enhance the constraint of phase retrieval.

Subsequently, the calculated intensity obtained by Eq. (4) is replaced by the measured intensity to retrieve the unknown complex amplitude of object plane. The iterative algorithm is shown in detail on Sect. 3.

2.2 The requirements of PRSPM

To evaluate the complexity of the complex-valued function \(g\left( {x,y} \right)\), the total variation (TV) is defined as [39]

$${\text{TV}} = \sum\limits_{{{\text{all}}\,{\text{pixels}}}} {\left( {\left| {\nabla_{x} g} \right|^{2} + \left| {\nabla_{y} g} \right|^{2} } \right)} ,$$
(8)

where \(\nabla_{x}\) and \(\nabla_{y}\) are the gradient operators of x and y, respectively. If \(g\left( {x,y} \right)\) is known, that may be implemented numerically by a central differencing scheme

$$\nabla_{x} g\left( {x,y} \right) = \frac{{g\left( {x + \Delta x,y} \right) - g\left( {x - \Delta x,y} \right)}}{2\Delta x},$$
(9)

However, for unknown complex-valued function \(g\left( {x,y} \right)\), we have access to the Fourier intensity \(\left| {G\left( {f_{x} ,f_{y} } \right)} \right|^{2}\). Taking the Fourier transform on the both sides of Eq. (9) and employing the shift property of the Fourier transform, getting

$$\begin{aligned} \mathcal{F}\left\{ {\nabla_{x} g\left( {x,y} \right)} \right\} & = G\left( {f_{x} ,f_{y} } \right)\frac{{\exp \left( {i2\pi f_{x} \Delta x} \right) - \exp \left( { - i2\pi f_{x} \Delta x} \right)}}{2\Delta x} \\ & = i\frac{{\sin \left( {2\pi f_{x} \Delta x} \right)}}{\Delta x}G\left( {f_{x} ,f_{y} } \right){\kern 1pt} {\kern 1pt} , \\ \end{aligned}$$
(10)

A similar relation holds for the y derivative. To get an equivalent numerical value for \(TV\) from the Fourier magnitude data, we defined complex parameter \(\zeta\) and use the equation given below [40]:

$$\zeta = \sum\limits_{{p = {\kern 1pt} all{\kern 1pt} {\kern 1pt} pixels}} {\left[ {\frac{{\sin^{2} \left( {2\pi f_{xp} \Delta x} \right)}}{{\Delta x^{2} }} + \frac{{\sin^{2} \left( {2\pi f_{yp} \Delta y} \right)}}{{\Delta y^{2} }}} \right] \times \left| {G\left( {f_{xp} ,f_{yp} } \right){\kern 1pt} {\kern 1pt} } \right|^{2} } ,$$
(11)

where \(\Delta x\) and \(\Delta y\) are the sampling intervals in the x and y direction of image space, respectively. In addition, \(\left( {f_{xp} ,f_{yp} } \right)\) denote spatial frequencies associated with the pth pixel in the Fourier domain. It is easy to verify that the computed numerical value \(\zeta\) using Eq. (11) is equal to the TV. In this paper, the complexity parameters are all logarithmic values with a base of 10.

The complexity parameter \(\zeta\) is proportional to Fourier intensity \(\left| {G\left( {f_{x} ,f_{y} } \right)} \right|^{2}\). The higher the complexity is, the richer the spectrum information is. It is apparent that a random image will have very high fluctuations and thus has a high numerical value of \(\zeta\). Therefore, to retrieve the unknown object effectively, the spectral information contained in the modulation phases should cover the spectral information of unknown object. For convenience, Zernike polynomials are chosen as a set of modulation phases in the method. Because the different orders of Zernike polynomials represent low-, medium-, and high-frequency information, respectively.

3 The algorithm of PRSPM

The algorithm of PRSPM has two crucial parts: the diffraction transmission calculation and the iterative calculation based on sequential phase modulations. The former can make the sampling interval of object plane not limited to the sensor using WWAS propagation; the latter adds strong constraints to the iterative calculation through sequential phase modulations and accelerates convergence. The specific iterative process of PRSPM is following, whose operation is illustrated in Fig. 3:

Fig. 3
figure 3

Flowchart of the phase retrieval algorithm for PRSPM

  • Step 1 A constant or random phase \(\phi_{o} \left( {x_{o} ,y_{o} } \right)\) is given as the initiation of object plane,and its complex amplitude is

    $$O\left( {x_{o} ,y_{o} } \right) = \exp \left[ {i\phi_{o} \left( {x_{o} ,y_{o} } \right)} \right],$$
    (12)
  • Step 2 Keeping propagating to the phase modulation plane, \(P_{j} \left( {x_{m} ,y_{m} } \right)\) before phase modulation plane is calculated by Eq. (1).

  • Step 3 Modulated by the jth phase modulation \(\phi_{j} \left( {x_{m} ,y_{m} } \right)\), \(S_{j} \left( {x_{m} ,y_{m} } \right)\) is calculated by Eq. (2).

  • Step 4\(S_{j} \left( {x_{m} ,y_{m} } \right)\) propagates to the diffraction plane, giving detecting wave \(D_{j} \left( {x_{d} ,y_{d} } \right)\) calculated by Eq. (3).

  • Step 5\(I_{j} \left( {x_{d} ,y_{d} } \right)\) is next replaced with the square root of the jth measured diffraction intensity \(I_{cj} \left( {x_{d} ,y_{d} } \right)\) recorded by sensor so that

    $$D_{j}^{'} \left( {x_{d} ,y_{d} } \right) = \sqrt {I_{cj} \left( {x_{d} ,y_{d} } \right)} \frac{{D_{j} \left( {x_{d} ,y_{d} } \right)}}{{\left| {D_{j} \left( {x_{d} ,y_{d} } \right)} \right|}},$$
    (13)
  • Step 6 An updated modulated wave is then calculated via an inverse WWAS propagation

    $$S_{j}^{'} \left( {x_{m} ,y_{m} } \right) = \rho_{\text{WWAS}}^{ - 1} \left[ {D_{j}^{'} \left( {x_{d} ,y_{d} } \right)} \right],$$
    (14)
  • Step 7 Removing the effect of jth phase modulation, a new complex amplitude before phase modulation plane is gotten

    $$P_{j}^{'} \left( {x_{m} ,y_{m} } \right) = {{S_{j}^{'} \left( {x_{m} ,y_{m} } \right)} \mathord{\left/ {\vphantom {{S_{j}^{'} \left( {x_{m} ,y_{m} } \right)} {\exp \left[ {i\phi_{j} \left( {x_{m} ,y_{m} } \right)} \right]}}} \right. \kern-0pt} {\exp \left[ {i\phi_{j} \left( {x_{m} ,y_{m} } \right)} \right]}},$$
    (15)
  • Step 8 An updated object complex amplitude is calculated by inverse WWAS propagation

    $$O^{'} \left( {x_{o} ,y_{o} } \right) = \rho_{\text{WWAS}}^{ - 1} \left[ {P_{j}^{'} \left( {x_{m} ,y_{m} } \right)} \right],$$
    (16)
  • Step 9 Keep \(j = j + 1\) and repeat Steps 3–8 until \(j = n\). That all modulation phases are used. A round trip iterative has done.

  • Step 10 Check the convergence of the reconstruction. If iterations reach defined number, continue with Step 11. Otherwise, jump back to Step 2.

  • Step 11 Obtain the complex amplitude \(O^{'} \left( {x_{o} ,y_{o} } \right)\) in object plane.

4 Simulation and analysis

4.1 Sequential Zernike phase modulation

To verify the effectiveness of this proposed method, the following simulation is performed. Figure 4 shows a schematic diagram of the simulation of PRSPM. The wavefront of unknown object propagates the modulation plane. After modulated by the modulation phase, the modulated wavefront keeps propagating to the sensor. Finally, the diffracted intensity patterns are recorded by sensor. The simulation parameters are as follows.

Fig. 4
figure 4

Schematic diagram of the simulation of PRSPM

The sampling pixels are \(Q \times Q = 256 \times 256\), wavelength is \(\lambda = 635\;{\text{nm}}\), the sensor with the pixel pitch is \(\Delta x = 7.4\;\upmu{\text{m}}\), the pixel pitches of object plane and modulation plane are \(\Delta x_{1} = 2.4\;\upmu{\text{m}}\), \(\Delta x_{2} = 2.4\;\upmu{\text{m}}\), respectively. The distance between modulation plane and object plane is \(z_{1} = 2\;{\text{mm}}\), The distance between modulation plane and sensor is \(z_{2} = 80\;{\text{mm}}\). The sampling pixels after zero-padding are \(R \times R = 487 \times 487\) calculated by Eq. (5).

The amplitude and phase of unknown object wavefront are shown in Fig. 5a, b, respectively. The intensity is normalized within the range \(\left[ {0,1} \right]\) and the phase is normalized within the range \(\left[ {0,\pi } \right]\). Their Fourier magnitude is shown as \(\left| {G\left( {f_{x} ,f_{y} } \right)} \right|^{0.25}\) to suit the display in Fig. 5c, d, respectively. According to Eq. (11), the complexity parameters of amplitude and phase are \(\zeta_{\text{a}} = 6.8749\), \(\zeta_{b} = 8.0309\), respectively.

Fig. 5
figure 5

Theoretical object. a Theoretical amplitude, b theoretical phase, c Fourier transform magnitude corresponding to theoretical amplitude, d Fourier transform magnitude corresponding to theoretical phase. The Fourier magnitude is shown as \(\left| {G\left( {f_{x} ,f_{y} } \right)} \right|^{0.25}\) to suit display

The total number of phase modulations is n = 10. Their expressions are the top ten of Zernike polynomials, as follows: \(\phi_{1} \left( {x_{m} ,y_{m} } \right) = x_{m}\), \(\phi_{2} \left( {x_{m} ,y_{m} } \right) = y_{m}\), \(\phi_{3} \left( {x_{m} ,y_{m} } \right) = 2\left( {x_{m}^{2} + y_{m}^{2} } \right) - 1\), \(\phi_{4} \left( {x_{m} ,y_{m} } \right) = x_{m}^{2} - y_{m}^{2}\), \(\phi_{5} \left( {x_{m} ,y_{m} } \right) = 2x_{m} y_{m}\), \(\phi_{6} \left( {x_{m} ,y_{m} } \right) = x_{m}\)\(\left( {x_{m}^{2} + y_{m}^{2} } \right)^{2} - 6\left( {x_{m}^{2} + y_{m}^{2} } \right) + 1\), \(\phi_{9} \left( {x_{m} ,y_{m} } \right) = x_{m}^{3} - 3x_{m} y_{m}^{2}\) and \(\phi_{10} \left( {x_{m} ,y_{m} } \right) = 3x_{m}^{2} y_{m} - y_{m}^{3}\). The modulation phases are normalized within \(\left[ { - \pi ,\pi } \right]\) and \(k = 1\). Their complexity parameters are \(\zeta_{m} = [8.7150,8.7150,6.2423,6.5945,8.2412,\)\(8.1631,8.1631,6.0089,7.7303,7.7303]{\kern 1pt} {\kern 1pt} .\) The complexity parameters of unknown object satisfy \(\left[ {\zeta_{m} } \right]_{\hbox{min} } < \zeta_{\text{a}} < \left[ {\zeta_{m} } \right]_{\hbox{max} }\) and \(\left[ {\zeta_{m} } \right]_{\hbox{min} } < \zeta_{b} < \left[ {\zeta_{m} } \right]_{\hbox{max} }\). In addition, their distributions are shown in Fig. 6. Their consistent intensity distributions obtained by sensor are shown in Fig. 7.

Fig. 6
figure 6

Distributions of modulation phases. Top row: 15 represent 1–5 modulation phases distributions; Bottom row: 610 represent 6–10 modulation phases

Fig. 7
figure 7

Diffraction intensities. Top row: 15 represent consistent diffraction intensities modulated by 1–5 modulation phases. Bottom row: 610 represent consistent diffraction intensities modulated by 6–10 modulation phases

We assume the number of iterations is \({\text{num}} = 200\). The algorithm stops with time spending 80 s. Figure 8a, b shows the retrieval of object amplitude and phase, respectively. Figure 8c, d shows the difference between theoretical and retrieval intensity and phase, respectively. To examine the convergence of the reconstruction, The Root Mean Square (RMS) can be calculated as the following expression:

$${\text{RMS}} = \frac{{\sqrt {\sum\nolimits_{M,N} {\left[ {\left| {X\left( {M,N} \right)} \right| - \left| {\bar{X}\left( {M,N} \right)} \right|} \right]^{2} } } }}{Q \times Q},$$
(17)

where \(X\) is retrieval value and \(\overline{X}\) is theoretical value.

Fig. 8
figure 8

Retrieved object. a Retrieval amplitude, b retrieval phase. c The difference between theoretical and retrieval amplitude, d the difference between theoretical and retrieval phase

The RMS of amplitude reduces from \(1.3 \times 10^{ - 3}\) to \(1.24 \times 10^{ - 4}\) and the RMS of phase reduces from \(8.7 \times 10^{ - 3}\) to \(2.82 \times 10^{ - 4}\). Both the initial values of RMS of amplitude and phase are small, indicating that this method converges fast and retrieves the contour of object even in one iteration. From Fig. 8c, the amplitude has been effectively retrieved, there is very small “burr” on the retrieval amplitude. From Fig. 8d, the error of phase is uniform and stable except for a few unique points on the edge.

4.2 Different phase modulation coefficients k

To explore the relationship between different coefficient k of modulation phases and the unknown object. In the following simulation, the coefficient is set \(k = 0.5\), 1, 1.5 and 2, respectively. The resulting changes in complexity parameters \(\zeta\) of different modulation phases are shown in Fig. 9. The complexity parameter of phase is greater than the complexity parameter of the amplitude, so the phase is more difficult to converge than amplitude. Under different coefficients k, the RMS of amplitude and phase are shown in Fig. 10. To show the changes clearly, their ordinates are taken the logarithm.

Fig. 9
figure 9

Variations of complexity parameters corresponding to the order of modulation n at different coefficient k. From top row to bottom row, ad represent \(k = 0.5\), 1, 1.5, and 2, respectively. The dashed lines and solid lines represent the complexity parameters of amplitude and phase, respectively

Fig. 10
figure 10

RMS changes with iterations under different k.a Log (RMS) of amplitude; b Log (RMS) of phase, the inset shows Log (RMS) of phase when iterations from 0 to 20 and Log (RMS) of phase when iterations from 50 to 200, respectively

As k increases, the magnitude of modulation phases increases and the complexity parameters also increase. From Fig. 10, the larger k is and the smaller of amplitude’s RMS is. However, the RMS of phase does not strictly decrease as k increases. Figure 11 shows the retrieval phase and the difference between theoretical and retrieval phase under different k. Although the RMS of phase is the smallest when \(k = 0.5\), the noise is strong in the retrieved phase, as shown in Fig. 11a, b. Figure 11a, c, e are shown in grayscale for obvious display. That is because the complexity of the modulation phases is basically lower than the complexity of the unknown phase, and it is not enough to retrieved the high frequency information of object.

Fig. 11
figure 11

Retrieval phase and the difference between theoretical and retrieval phase under different k. The left column is the retrieval phase, and the right column is the difference between theoretical and retrieval phase. The first to last lines are \(k = 0.5\), \(k = 1.5\) and \(k = 2\), respectively

As iterations increases, the RMS of phase does not exhibit a strict reduction relationship. At the beginning of the iteration, there is a tendency for the oscillation to converge. Meanwhile, Different k have different iterations of stable convergence. However, overall, the larger k is, the smaller the number of iterations is when converge stably. Meanwhile, the RMS of phase gradually approaches as k increases. Figures 10 and 11 can also prove this.

It is worth noting that \(k = 1\) is not the best convergence of amplitude, while its RMS= \(1.24 \times 10^{ - 4}\) is small enough within the range can be accepted. Meanwhile, the complexity of modulation phases is enough to retrieve the phase of object with RMS= \(2.82 \times 10^{ - 4}\). Therefore, in the next simulation, the coefficient is \(k = 1\).

4.3 Different phase modulation numbers n

From above simulation, retrieving phase is more difficult than amplitude, so we take the phase retrieval result to study on the effect of number of phase modulations. Under the above discussion, the coefficient is \(k = 1\) and other simulation parameters do not change. In principle, phase modulations should improve the reconstruction, this may lead to a reduction of the number of iterations. Figure 12 shows a matrix of representative reconstruction between the number of phase modulations and iterations on the quality of reconstruction.

Fig. 12
figure 12

Effects of number of phase modulations and iterations on the quality of reconstruction. Moving down a column, the number of phase modulations is increased from 4, 5, 6, 8 to 10; moving from left to right, iterations is increased from 10, 20, 30, 40 to 50

Moving down a column, the number of phase modulations used to reconstruct the object is increased (reconstructions using 4, 5, 6, 8, 10 phase modulations are shown). Moving from left to right, the number of iterations is increased (from 10, 20, 30 and 40 to 50). Note that the first row, the reconstruction using 4 measurements only, it does not result in acceptable image quality after 50 iterations. However, the contour of retrieval phase can be distinguished. When the number of modulations is 5, the quality of phase improves a lot after 50 iterations and the algorithm will gradually converge with more iterations. When the number of phase modulation is 6, 8, and 10, the quality of phase improves a lot after 30, 20, and 10 iterations, respectively. Under 50 iterations, we can also get accurate results. The algorithm converges quickly.

In Fig. 13, we plot RMS of phase changes with iterations under different numbers of phase modulation. We can know the number of phase modulations is 5 at least, the algorithm begins to converge stably. As the number of phase modulations increases, the method requires fewer iterations and converges faster. From Figs. 12 and 13, there is the same results.

Fig. 13
figure 13

Log (RMS) changes with iterations under different numbers of phase modulations n

4.4 Comparison with different modulation phases

As mentioned earlier, there are three requirements for modulation phases. To prove the universality of these requirements, we add an additional set of modulation phases whose distribution is Gauss–Laguerre polynomials. When Any integer is \(t \ge 0\), the Laguerre polynomials expression is as follows:

$$L_{t + 1} \left( x \right) = \left( {2t + 1 - x} \right)L_{t} \left( x \right) - t^{2} L_{t - 1} \left( x \right),$$
(18)

where \(L_{0} \left( x \right) = 1\) and \(L_{1} \left( x \right) = - x + 1\). We construct the orthogonal two-dimensional Laguerre polynomials:

$$P_{t} \left( {x,y} \right) = L_{i} \left( x \right) \cdot L_{j} \left( y \right),$$
(19)

where \(i\) and j are integers starting from 0. \(L_{i} \left( x \right)\) and \(L_{j} \left( y \right)\) are Laguerre polynomials with x and y as variables, respectively.

According to Eq. (19), the top ten of Laguerre polynomials is chose as modulation phases. Their complexity parameters are \(\zeta_{m} = [7.5109,7.5109,7.6269,7.2773,7.6269,9.4668,8.9403,8.9403,9.4668,7.5720]{\kern 1pt} {\kern 1pt} .\) As such, the above requirements are satisfied. Figure 14a, b shows the retrieval of object amplitude and phase, respectively. Figure 14c, d shows the difference between theoretical and retrieval amplitude and phase, respectively. From Fig. 14, the complex amplitude of the object can be effectively retrieved.

Fig. 14
figure 14

Retrieved object under Laguerre polynomials modulation. a Retrieval amplitude, b retrieval phase. c The difference between theoretical and retrieval amplitude, d the difference between theoretical and retrieval phase

In addition, ten random modulation phases are selected with a uniform distribution of 0–1 for comparing with Zernike polynomials modulations under \(k = 1\). Other simulation parameters are unchanged. Figure 15a, b shows the retrieval of object amplitude and phase, respectively. Figure 15c, d shows the difference between theoretical and retrieval amplitude and phase, respectively. From Fig. 15, the complex amplitude of the object can be effectively retrieved.

Fig. 15
figure 15

Retrieved object under random modulation. a Retrieval amplitude, b retrieval phase. c The difference between theoretical and retrieval amplitude, d the difference between theoretical and retrieval phase

The RMS values of amplitude and phase under the three types modulations are shown in Fig. 16. To show the changes clearly, their ordinates are taken the logarithm. From Fig. 16a, the RMS of amplitude under random phase modulations is much smaller than Zernike and Laguerre phase modulations. However, the RMS values of phases under the three modulations gradually approach the same value as the number of iterations increases. Zernike polynomials and Gauss–Laguerre polynomials are chosen because of their orthogonality. This choice can reduce redundancy, but it is not a requirement. Zernike polynomials and Gauss–Laguerre polynomials are continuous, so the effect of the pixel crosstalk of spatial light modulation (SLM) in the experiment becomes smaller as mentioned earlier.

Fig. 16
figure 16

The RMS changes with iterations under random and Zernike polynomials modulation phases. a Log (RMS) of amplitude; b Log (RMS) of phase

5 Conclusion

In this paper, we have proposed a new phase retrieval method using sequential phase modulations. The unknown complex amplitude of object is modulated by a sequential of known phases to change the diffraction intensity received by sensor. By doing this, the difficulty of phase retrieval is reduced and the convergence speed is extremely fast. Meanwhile, the modulation phases just need to satisfy three conditions, continuous distribution, covering different frequency bands and the complexity of unknown object should be contained between the maximum and minimum complexities of modulation phases. There is also no limit on what kind of modulation phase distribution to choose. In addition, what kind of relationship between different modulation phases is also no requirements. As increasing in the number of phase modulations results in a reduction of iterations. From those above simulations and discussions, we have proved the feasibility of this new method. Our next work will be focus on the experimental validation of this new method.