Write code to compute autocorrelation functions and power spectral density.