Computing an autocorrelation