The problem of retrieving a complex function from the modulus of its Fourier transform has non-unique solutions in one dimension. Therefore iterative phase retrieval methods cannot in general be confidently applied to one-dimensional problems, due to the presence of ambiguities. We present a method for a posteriori reduction of the ambiguities based on the correlation analysis of the solution of a large number of runs of an iterative phase retrieval algorithm with different random starting phases. The method is applied to experimentally measured diffraction patterns from an x ray waveguide illuminated by hard x rays. We demonstrate the possibility of retrieving the complex wave field at the exit face of the waveguide and compare the result with theoretical prediction.