We show that the autocorrelation function of an optical signal may be simply obtained using a signal averager and a weighted signal-averaging technique. The method applies to the measurement of either intensity fluctuations or photocount fluctuations, and we present expressions for the weighted signal average and its error for each case. Finally we test the results experimentally and compare the data with the corresponding theoretical expressions.