I released a new version of my delay estimation subroutine (Matlab /
Octave). It finds the delay and scaling factor between two cyclic (or
zero-padded) signals, and applies it to one signal in order to match the
Download links are on  at the top of the page.
The main algorithm is described in my blog entry  from 2007, which was
rewritten a month ago.
The fallback algorithm is documented in .
The code also supports phase unwrapping as an algorithm option, see line
I hope it's useful.