| CPC G01J 1/4204 (2013.01) | 4 Claims |

|
1. A method of improving performance of an averager, wherein the averager includes an OR gate, a subtractor and a plurality of adders, and the subtractor is connected to a sensor that is an ambient light sensor or a proximity sensor and includes a photoelectric component, the method comprising processes of:
by the sensor, sensing n pieces of sensing data;
by the subtractor, receiving the n pieces of sensing data from the sensor as n pieces of input data;
by the subtractor, sequentially reads the n pieces of input data from the sensor, wherein the number of the sensing data is an integer;
by the subtractor, calculating a difference between an nth piece of the input data and an (n−1)th piece of output data of the averager;
by the subtractor, outputting a value representing that the difference between the nth piece of the input data and the (n−1)th piece of output data is larger than a positive threshold coefficient to one of two input terminals of the OR gate; and
by the subtractor, outputting a value representing that the difference between the nth piece of the input data and the (n−1)th piece of output data is smaller than a negative threshold coefficient to the other of the two input terminals of the OR gate;
wherein when the difference between the nth piece of the input data and the (n−1)th piece of output data of the averager is larger than the positive threshold coefficient or smaller than the negative threshold coefficient, the OR gate outputs a logic value “1”;
wherein when the OR gate outputs the logic value “1” and the difference between the nth piece of the input data and the (n−1)th piece of output data of the averager is larger than a reference value, using yet another one of the plurality of adders to add a negative compensation coefficient to a temporary value being equal to N times the (n−1)th piece of output data to obtain a value as the correction value, using the one of the plurality of adders to add 1/N times the negative value of the correction value to the correction value, and using the another of the plurality of adders to add up the value outputted by the one of the plurality of adders and the n-th input data;
wherein when the OR gate outputs the logic value “1” and the difference between the nth piece of the input data and the (n−1)th piece of output data of the averager is smaller than the reference value, using other of the plurality of adders to add a positive compensation coefficient to the temporary value being equal to N times the (n−1)th piece of output data to obtain a value as the correction value, using the one of the plurality of adders to add 1/N times the negative value of the correction value to the correction value, and using the another of the plurality of adders to add up the value outputted by the one of the plurality of adders and the n-th input data.
|