Calculation of autocorrelation functions for electronic spectra