Sampling and optimum data processing of detector signals