What you are trying to do is called phase retrieval, i.e. retrieve the complex scalar field from its spectrum (aka the Fourier transform amplitudes). There have been many algorithms around for more than 40 years. To my knowledge, this is still an open question. The algorithm convergence is, very few, promised.
Starting from your question. The prior you have, are:
- The support area is a circle. Outside area is all-zero.
- The aperture is binary, i.e. your desired signal is either 1 or 0. However this will somehow constraint your solver and worsen the performance.
You can try the error-reduction algorithm, or Fienup's hybrid-input-output method.
I am using the error-reduction algorithm, here is a MATLAB demo for your data:
clc;clear;close all; % for reproducible rng(0); % load data and normalize p_true = imread('aperture.jpg'); p_true = double(rgb2gray(p_true))/255; % generate the diffraction pattern h = abs(fft2(p_true)); % get prior area_ind = p_true ~= 0; % set algorithm parameter iter = 1e3; % set initialization p = rand(size(h)); p(~area_ind) = 0; % the algorithm for k = 1:iter % error reduction temp = fft2(p); p = ifft2( h .* temp ./ abs(temp) ); % impose prior p(~area_ind) = 0; % record disp(['k = ' num2str(k) ', err = ' num2str(norm(p-p_true,'fro'),'%e')]); end % show the result figure; imshow([p_true p], []); title('Left: true. Right: our reconstruction');
