autocorellation calculation