Rectify the signal using a precision rectifier and pass it through a LP filter. The time constant of the filter gives you the averaging time. Make simulations in Matlab and compare it to the what you obtain from the circuit simulator.
The result is not the "exact" average but very close to it.
Another solution is to sample the signal, pass it through and A/D and then make the average inside a microcontroller. If exact averaging is needed, maybe this is the only response. Any other?