acfs function

Generic function for calculating autocorrelation