1. A method comprising: receiving a first array of values obtained from measuring an array of touch panel sensor areas; generating a second array of values based on subtracting a reference array of values from the first array of values, wherein generating the second array comprises: generating a third array by subtracting the reference array from the first array; and generating the second array by filtering the third array using a spatial low pass filter having a bandwidth equal to a reference bandwidth value; determining presence of at least one touch event in dependence upon the second array of values; and upon a negative determination: generating a new reference array based on exponential smoothing of the reference array and the first array using a weighting factor, or generating a new reference array which is equal to the first array; and, storing the new reference array; and upon a positive determination: outputting the second array determining, based on a difference of the second array and the third array, a first amount by which values corresponding to at least one touch event are attenuated and a second amount by which values not corresponding to any touch event are attenuated; generating a new reference bandwidth value based on the first amount and the second amount; and storing the new reference bandwidth value.