1. A method of controlling an automatic gain control circuit used to adjust the gain of a signal input to an analog to digital converter, the method comprising: (a) sampling the output of the analog to digital converter; (b) determining whether the amplitude of the sample is greater than a threshold amplitude value, the threshold amplitude value being less than the saturation point of the analog to digital converter; (c) in response to determining the amplitude of the sample is greater than the threshold amplitude value, incrementing a counter value; (d) repeating steps (a) to (c); and (e) periodically adjusting a target average amplitude of the automatic gain control circuit based on the counter value, the automatic gain control circuit being configured to adjust the gain of the signal input to the analog to digital converter to make the average amplitude of the output of the analog to digital converter equal to the target average amplitude, wherein adjusting the target average amplitude comprises comparing the counter value to a first threshold counter value and decreasing the target average amplitude in response to determining the counter value is greater than the first threshold counter value.