function r_k=auto_corr(data,k)
   
   n=length(data);
   r_k=sum((data(k+1:n)-mean(data)).*(data(1:n-k)-mean(data)))/sum((data(1:n)-mean(data)).^2);
   
   