# Phase retrieval

Phase retrieval is the process of algorithmically finding solutions to the phase problem. Given a complex signal ${\displaystyle F(k)}$, of amplitude ${\displaystyle |F(k)|}$, and phase ${\displaystyle \psi (k)}$:

${\displaystyle F(k)=|F(k)|e^{i\psi (k)}=\int _{-\infty }^{\infty }f(x)\ e^{-2\pi ik\cdot x}\,dx}$

where x is an M-dimensional spatial coordinate and k is an M-dimensional spatial frequency coordinate, phase retrieval consists in finding the phase that for a measured amplitude satisfies a set of constraints. Important applications of phase retrieval include X-ray crystallography, transmission electron microscopy and coherent diffractive imaging, for which ${\displaystyle M=2}$. (Fienup 1982:2759) Uniqueness theorems for both 1-D and 2-D cases of the phase retrieval problem, including the phaseless 1-D inverse scattering problem, were proved by Klibanov and his collaborators (see References).

## Methods

### Error reduction algorithm

Schematic view of the error reduction algorithm for phase retrieval

The error reduction is a generalisation of the Gerchberg–Saxton algorithm. It solves for ${\displaystyle f(x)}$ from measurements of ${\displaystyle |F(x)|}$. It uses iteration of a four-step process. For the ${\displaystyle k}$'th iteration the steps are as follows:

Step (1): ${\displaystyle G_{k}(u)}$, ${\displaystyle \phi _{k}}$, and ${\displaystyle g_{k}(x)}$ are estimates of, respectively, ${\displaystyle F(u)}$, ${\displaystyle \psi }$ and ${\displaystyle f(x)}$. In the first step ${\displaystyle g_{k}(x)}$ undergoes Fourier transformation:

${\displaystyle G_{k}(u)=|G_{k}(u)|e^{i\phi _{k}(u)}={\mathcal {F}}(g_{k}(x))}$

Step (2): The experimental value of ${\displaystyle |F(u)|}$, calculated from the diffraction pattern via the signal equation, is then substituted for ${\displaystyle |G_{k}(u)|}$, giving an estimate of the Fourier transformation:

${\displaystyle G'_{k}(u)=|F(u)|e^{i\phi _{k}(u)}}$

where the ' denotes that the object is temporary, for further calculations.

Step (3): the estimate of the Fourier transformation ${\displaystyle G'_{k}(u)}$ is inverse Fourier transformed:

${\displaystyle g'_{k}(x)=|g'_{k}(x)|e^{i\theta '_{k}(x)}={\mathcal {F}}^{-1}(G'_{k}(u))}$

Step (4): ${\displaystyle g'_{k}(x)}$ then must be changed so that the new estimate of the object, ${\displaystyle g_{k+1}(x)}$ satisfies the object constraints. ${\displaystyle g_{k+1}(x)}$ is therefore defined piecewise as:

${\displaystyle g_{k+1}(x)\equiv {\begin{cases}g'_{k}(x)&x\notin \gamma \\0&x\in \gamma \end{cases}}}$

where ${\displaystyle \gamma }$ is the domain in which ${\displaystyle g'_{k}(x)}$ does not satisfy the object constraints. A new estimate ${\displaystyle g_{k+1}(x)}$ is obtained and the four step process can be repeated iteratively.

This process is continued until both the Fourier constraint and object constraint are satisfied. Theoretically, the process will always lead to a convergence (Fienup 1982:2761), but the large number of iterations needed to produce a satisfactory image (generally >2000) results in the error-reduction algorithm being unsuitably inefficient for sole use in practical applications.

### Hybrid input-output algorithm

The hybrid input-output algorithm is a modification of the error-reduction algorithm - the first three stages are identical. However, ${\displaystyle g_{k}(x)}$ no longer acts as an estimate of ${\displaystyle f(x)}$, but the input function corresponding to the output function ${\displaystyle g'_{k}(x)}$, which is an estimate of ${\displaystyle f(x)}$ (Fienup 1982:2762). In the fourth step, when the function ${\displaystyle g'_{k}(x)}$ violates the object constraints, the value of ${\displaystyle g_{k+1}(x)}$ is forced towards zero, but optimally not to zero. The chief advantage of the hybrid input-output algorithm is that the function ${\displaystyle g_{k}(x)}$ contains feedback information concerning previous iterations, reducing the probability of stagnation.

${\displaystyle g_{k+1}(x)\equiv {\begin{cases}g'_{k}(x)&x\notin \gamma \\g_{k}(x)-\beta {g'_{k}(x)}&x\in \gamma \end{cases}}}$

Here ${\displaystyle \beta }$ is a feedback parameter which can take a value between 0 and 1. For most applications, ${\displaystyle \beta \approx 0.9}$ gives optimal results.

### Shrinkwrap

For a two dimensional phase retrieval problem, there is a degeneracy of solutions as ${\displaystyle f(x)}$ and its conjugate ${\displaystyle f^{*}(-x)}$ have the same Fourier modulus. This leads to "image twinning" in which the phase retrieval algorithm stagnates producing an image with features of both the object and its conjugate (Fienup and Wackerman, 1986:1900). The shrinkwrap technique periodically updates the estimate of the support by low-pass ﬁltering the current estimate of the object amplitude (by convolution with a Gaussian) and applying a threshold, leading to a reduction in the image ambiguity (Marchesini et al., 2003).