Phase-sensitive-detector
Is there a better way?


You can do what most folk would turn to, an exclusive or gate: -



You would convert your sine wave and reference phase to square waves (using a comparator) and just feed them to the EXOR. The average level of the output represents the phase between the two signals. In example 1 that is zero, in example 2, the average level has risen. In example 3 the two signals are nearly output phase and the average level is nearly an analogue level equivalent to logic 1. In example 4 the two signals are antiphase and the output = logic 1.

Midpoint i.e. halfway between 0 and logic level 1 is 90 degrees.