added an updateBaseFreq function to update the baseline frequency offset