Detecting phase between square wave and sine wave signals
Phase detection is the easiest for digital signals; it's basically an XOR gate. I would convert the sine to a square wave. Feed a comparator with the sine on one input and the averaged sine (LPF) on the other, so that the comparator gives a 50 % duty cycle square wave. Then use a digital phase detector.