The algorithm starts with an initial guess for the phase of the signal. It then alternates between the spatial domain and the Fourier domain, updating the phase information in each iteration. The key steps are:
1. Fourier Transform: Compute the Fourier transform of the initial guess. 2. Magnitude Update: Replace the magnitude of the Fourier transform with the known magnitude while keeping the phase unchanged. 3. Inverse Fourier Transform: Compute the inverse Fourier transform. 4. Spatial Domain Update: Update the phase in the spatial domain, keeping the known amplitude constant.
This process is repeated until the algorithm converges, yielding an accurate phase map.