DM_phase maximizes the coherent power of a radio signal instead of its intensity to calculate the best dispersion measure (DM) for a burst such as those emitted by pulsars and fast radio bursts (FRBs). It is robust to complex burst structures and interference, thus mitigating the limitations of traditional methods that search for the best DM value of a source by maximizing the signal-to-noise ratio (S/N) of the detected signal.