A Simple Phase Unwrapping Algorithm and its Application to Phase-Based Frequency Estimation