Code

General guidelines: The solvers here use TFOCS. After downloading and saving the TFOCS path, please replace TFOCS's tfocs_initialize.m which is located in the private folder of TFOCS with tfocs_initialize.m.

Complete Package

You can download all of the M-files provided on this webpage as a single zip file: PhaseRetrieval_CDP.zip.

Matlab solvers

Solves

 min frac{1}{2}|mathbf{y}-mathcal{A}(mathbf{X})|_{ell_2}^2+lambda tr(mathbf{X})quad s.t.quadmathbf{X}succeq mathbf{0},

with mathcal{A} denoting Gaussian measurements in phase retrieval.

Solves

 min frac{1}{2}|mathbf{y}-mathcal{A}(mathbf{X})|_{ell_2}^2+lambda tr(mathbf{X})quad s.t.quadmathbf{X}succeq mathbf{0},

with mathcal{A} denoting coded diffraction pattern measurements in phase retrieval.

Solves

 min sum_k[mu_k-y_klog mu_k]+lambda tr(mathbf{X})quad s.t.quad mathbf{mu}=mathcal{A}(mathbf{X})quad andquadmathbf{X}succeq mathbf{0},

with mathcal{A} denoting coded diffraction pattern measurements in phase retrieval.

Matlab functions

These functions build the linear operators needed for different kinds of measurements.

Matlab data generating scripts

These scripts generate different random signal models.

Matlab test scripts

Phase transitions

These scripts apply the solver above to derive phase transitions for various signal and measurement models.

  • random Gaussian signals

  1. binary masks: test_PRb.m

  2. ternary masks: test_PRt.m

  3. octanary masks: test_PRo.m

  4. Gaussian measurements: test_PRg.m

  • random low-pass signals

  1. binary masks: test_PRb_smooth.m

  2. ternary masks: test_PRt_smooth.m

  3. octanary masks: test_PRo_smooth.m

  4. Gaussian measurements: test_PRg_smooth.m

Noisy measurements

These scripts apply the solvers above to derive the noise performance for various signal and measurement models.

  • random Gaussian signals

  1. binary masks: test_Poisson_b.m

  2. ternary masks: test_Poisson_t.m

  3. octanary masks: test_Poisson_o.m

  • random low-pass signals

  1. binary masks: test_Poisson_smooth_b.m

  2. ternary masks: test_Poisson_smooth_t.m

  3. octanary masks: test_Poisson_smooth_o.m

Matlab display scripts

These scripts use the results of the test scripts above to derive the phase transitions and noise performance for various signal and measurement models. The resulting plots are the ones depicted in the paper.

  • Phase transitions

  1. random Gaussian signals: draw_PT.m

  2. random low-pass signals: draw_PTsmooth.m

  • Noisy measurements

  1. random Gaussian signals: draw_SNR.m

  2. random low-pass signals: draw_SNR_smooth.m