updates to sawtooth function to correct frequency error