I am currently looking to use some sort of phase detector in an ultrasonic AC circuit, operating nominally at 30 kHz. The end goal is to be able to get the voltage and current in phase. The load in the circuit is a set of ultrasonic Langevin transducers. I have previously been tuning the system by measuring the voltage across the transducers and also across a small resistor, which I use as my visualization of the current. I plot these two voltages against each other and tune the frequency, until the plot is more or less a straight line. I am trying to automate this process and am looking for a component which could tell me information on the phase difference between the two signals. Any information would be helpful in this regard.