Add frequency calibration function