auto_phase function

Perform zeroth-order phase correction based on the minimisation of the squared difference between the real and magnitude components of the spectrum.