Re: cross correlation
Concerning the phase shift between 2 signals, I'm not sure, in fact, that it may be evaluated automatically without any preliminary specified information. Moreover, both signals must be sinusoidal and have the same period. Then their phasze shift delta_phi may be estimated the following way:
delta_phi = [(delta_t)/T] * 360 degrees,
where (delta_t) - time shift between 2 signals (distance on time-axis between the 1st maximas or minimas of these 2 signals), T - period.
This way is one of the easiest ones. There are more complicated, of course, (Lissagu figures, digital techniques, etc.) but I suppose You'll be satisfied by the one given now.
With respect,
Dmitrij