Expand description
Coded Diffraction Patterns (CDP) and Wirtinger-Flow phase retrieval (Candès, Li & Soltanolkotabi 2015).
In ptychography / coherent diffraction imaging one measures squared magnitudes of a
modulated Fourier transform of the unknown (complex) signal x ∈ ℂⁿ:
y_{l} = | F (d_l ⊙ x) |² , l = 1, …, Lwhere d_l ∈ ℂⁿ is a random coded diffraction mask (a per-pixel modulation) and
F is the unnormalised DFT. Stacking the L patterns gives m = L·n real,
phaseless measurements — enough (for L ≳ 4) to recover x up to a global phase.
This module provides:
CodedDiffraction— a set of random complex masks defining the forward operator.CodedDiffraction::forward— the phaseless measurementy = |F(d_l ⊙ x)|².CodedDiffraction::wirtinger_flow— recovery by Wirtinger Flow: spectral initialisation followed by gradient descent on the intensity-domain loss½ Σ_l ‖ |A_l x|² − y_l ‖²using the Wirtinger gradient.
Signals are stored as interleaved real/imaginary f64 pairs: x[2k] is Re(x_k),
x[2k+1] is Im(x_k). All transforms are implemented from scratch (an O(n²) DFT),
so the module depends only on std.
§References
- E. J. Candès, X. Li & M. Soltanolkotabi (2015), “Phase Retrieval from Coded Diffraction Patterns”, Applied and Computational Harmonic Analysis 39(2):277-299.
- E. J. Candès, X. Li & M. Soltanolkotabi (2015), “Phase Retrieval via Wirtinger Flow: Theory and Algorithms”, IEEE Trans. Information Theory 61(4):1985-2007.
Structs§
- Coded
Diffraction - A coded-diffraction forward operator:
Lrandom complex masks of lengthn. - Wirtinger
Config - Configuration for Wirtinger Flow recovery.
Enums§
- Mask
Kind - Distribution from which coded-diffraction mask entries are drawn.
Functions§
- phase_
aligned_ error - Align two interleaved-complex vectors up to a global phase and return the relative
reconstruction error
‖x̂ e^{iφ} − x‖ / ‖x‖minimised over the global phaseφ.