A low complexity autofocusing technique