Take your signal, feed it into the Hilbert transform function. Use the original signal as the real part of a complex signal and use the Hilbert transform result as the imaginary part. Take the magnitude of this signal and you will have the envelope. You can then average this signal.
Randall Pursley