Algorithms of phase and group correlation