Patent ID: 7986193

Claim:
An electronic device comprising: an oscillator module configured to generate an oscillating signal of a frequency based on a tuning value input at a tuning input of the oscillator module; a result signal generator configured to provide a result signal which is at least partially based on the oscillating signal; and a controller connected to the tuning input of the oscillator module and the result signal generator and configured to apply a plurality of different tuning values to the tuning input of the oscillator module, for each applied tuning value, obtain and save repeated samples of the result signal during a time period at which the tuning value is applied, determine a respective noise value derived from the saved samples, the noise value computed from those saved samples that are at or below a certain threshold, while excluding from the determination of the noise value any saved samples obtained during that time period that exceed the threshold and are considered to be caused by a touch event, the noise value being indicative of a level of noise which appears at the result signal while the applied tuning value is being applied, and perform touch detection using the saved samples regardless of the noise value determination, select one or more low noise tuning values of the plurality of different tuning values, the low noise tuning values being associated with low respective noise values, and apply a low noise tuning value of the one or more low noise tuning values to the tuning input of the oscillating circuit.