[f, obj, res, iter] = error_reduction(F_mag, g_init, dom, tol, max_iter)
reconstructs the signal f given the DFT magnitude F_mag.
F_mag is the magnitude of the discrete Fourier transform.
g_init is the initial guess of the signal.
dom is a binary matrix that equals 1 for all pixels in the non-zero support set.
tol is the cutoff for the normed difference between successive iterates. If the difference falls below tol, the algorithm terminates.
max_iter is the maximum number of iterations.
f is the reconstructed signal.
obj is the objective value at every iteration, i.e. the normed difference between the known and estimated Fourier magnitude.
res is the residual error at every iteration.
iter is the number of iterations the algorithm ran.