---
title: "Phase Retrieval Challenge Interactive Lab | Sandbox Physics"
description: "Can you recover the phase of light from brightness measurements alone? Only with extra constraints, and never completely."
canonical_url: "https://sandboxphysics.com/labs/phase-retrieval-challenge/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/phase-retrieval-challenge/"
last_modified: "2026-10-27"
---

Optics 068 · Diffraction, Fourier optics, and computational imaging

# Phase Retrieval Challenge

**Can you recover the phase of light from brightness measurements alone?** Only with extra constraints, and never completely. Knowing where the object can be nonzero, or measuring at several planes, is enough to recover the phase. A single focal-plane pattern still cannot tell the object from its conjugate twin, the same object rotated half a turn with its phase reversed. And no intensity data can fix an overall constant phase.

Recover an invisible phase plate from simulated intensity records. Move one CCD through defocus positions, run into the twin-image ambiguity, replay iterations that start without the answer and test what a wrong support assumption does.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

The specimen is a synthetic pure-phase object with known unit amplitude, the lens is ideal and paraxial, and fields are point-sampled on a finite grid. Noise is additive Gaussian read noise; photon statistics are not modeled. The true phase is used only for scoring. Neither uniqueness nor global convergence is guaranteed.

Physics tutorial

## Audit the physics of Phase Retrieval Challenge

**Background** The CCD records the squared amplitude, and the optical phase is lost: $I_j=|\mathcal F_u\{d_j U\}|^2$. Each known defocus position changes the same object field in a known way before the Fourier transform.

**Why it matters** Can you recover the phase of light from brightness measurements alone?

Start with the essentials

- **Focus question**: Can you recover the phase of light from brightness measurements alone?
- **One-sentence intuition**: At focus, the object and its conjugated, point-inverted twin give identical data: $|\mathcal F_u U|^2=|\mathcal F_u\{U^*(-\mathbf r)\}|^2$. An exact alternative answer is not the same as a reconstruction that stalled in a mixture of the two. Several known planes can rule out the twin, but they never fix the global piston.

### Core mathematical model

#### Moving the camera adds a known defocus phase

$$
\begin{aligned}M_j&=\begin{pmatrix}-\delta_j/f&f\\-1/f&0\end{pmatrix}\\d_j(\mathbf r)&=e^{-i\pi\delta_j r^2/(\lambda f^2)}\\\Delta x_D&=\frac{\lambda f}{N\Delta x_O}\end{aligned}
$$

The object sits one focal length in front of the lens, and the camera sits one focal length plus a signed defocus behind it. No extra phase plate is inserted. Coordinates are in millimetres, and positive defocus means the camera is farther from the lens.

#### Projecting onto the measured amplitudes

$$
\begin{aligned}g_j&=\mathcal F_u(d_j U_k)\\h_j&=\sqrt{I_j}e^{i\arg g_j}\\U_{k+1}&=\mathcal P_S\!\left[\frac1{N_z}\sum_j d_j^*\mathcal F_u^{-1}h_j\right]\end{aligned}
$$

The measured magnitudes replace the predicted ones. Each plane is propagated back to the object and the results are averaged. Then the amplitude is set to one inside the assumed circular support and to zero outside. This is a GS-like parallel projection; it is not HIO and does not guarantee a global optimum.

#### Fit and truth are different tests

$$
\begin{aligned}\varepsilon_A^2&=\frac{\sum_j\|\,|g_j|-\sqrt{I_j}\,\|^2}{\sum_j\|\sqrt{I_j}\|^2}\\\sigma_\phi^2&=\langle\operatorname{wrap}(\phi_k-\phi_{\rm true}-c)^2\rangle\end{aligned}
$$

The residual uses only the acquired data. The phase score exists only in simulation: it removes the best-fitting global piston and uses the pixels where the supports overlap. The part of the true object that falls outside the support is reported separately, and a twin is never quietly counted as correct.

#### Additive read noise, clipped at zero

$$
\begin{aligned}I_j^{\rm rec}&=\max(0,I_j^{\rm ideal}+n_j)\\n_j&\sim\mathcal N(0,\eta^2 I_{\rm clear}^2)\end{aligned}
$$

The read noise is additive, uses a fixed seed and is scaled to one shared reference: the peak of the clear-aperture pattern. Clipping at zero pushes dark pixels upward. The model does not treat shot noise or photon numbers. The fixed logarithmic display does not rescale each picture separately.

### Common difficulties

#### Does a small data error mean the phase is right?

**Typical misconception** Run enough iterations and the algorithm always finds the one physical phase.

**Better mental model** No. With nonconvex constraints the iteration can stall, and the Fourier twin fits the data exactly. A wrong support throws away real object pixels. The synthetic true object is kept from the algorithm and used only to evaluate the result.

### Run the experiment

1. 01

   #### Scene 1: One image, two valid phases

   Compare a single in-focus record with three defocused records, keeping the specimen, seed, aperture and iteration count the same.

   **What to observe:** In this example, the defocused planes rule out the twin that fits at focus. The global piston still cannot be observed.

2. 02

   #### Scene 2: Scan three planes, recover phase

   Replay the error curve. Change the blind seed and compare the fit error with the phase score, which is labelled separately.

   **What to observe:** The support is a constraint inside the software, not a physical stop in the light path. Only the camera moves, and the detector records stay the same when you change the reconstruction seed.

3. 03

   #### Scene 3: Wrong prior and noisy data

   Drag the assumed support circle inward and add noise. Then watch the CCD move in the overview, side and detail views.

   **What to observe:** A small residual does not prove the phase is right. A wrong support, or read noise clipped at zero, can bias the reconstruction.

Physical conclusion

A plausible phase is not necessarily the unique answer. Collect data that carry enough information, say what prior you assumed, and check the fit, the missing support and the ambiguity one at a time.

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
