Modulator refinement algorithm for coherent modulation imaging.