after success of peak detection
editing calc_phase