Phase Detection Matlab Implementation of three methods: FFT- Based Multiplication Pulse-Lag VHDL implementation of first one and second one is here. The note on how these methods work is here.