From your question and comments, it looks like what you want to extract is the envelope of a signal.
A few things are still not clear:
- Do you have any prior knowledge about the shape of this envelope (looks like it might be an exponential in your case)?
- What is the signal "attenuated" by this envelope. Something complex like music? A pure sine-wave?
- What are the relative "scale" of the signals. Is the carrier period several orders of magnitude lower than the constant time of the envelope? Or just one order of magnitude lower?
Some leads:
- As @JasonR recommended, Compute signal power (or maximum absolute value) over sliding, overlapping, windows of N samples, where N is an order of magnitude greater than the period of your signal. If necessary, low-pass filter. If your goal is to get a single time constant (assuming exponential decay), take the log of the values and fit to a straight line.
- Demodulation techniques. Take the absolute value of your signal and low-pass filter - optionally after band-pass filtering to select a frequency band of interest. Exactly how AM radio works! This works well when the envelope is relatively slow (several orders of magnitudes) compared with the carrier.
- Parametric techniques. If your signal takes the form $\Re (\alpha z^n)$ (exponential damped sine wave) or $\Re(\sum_p \alpha_p z_p^n)$ (sum of exponentially damped sine waves) plus some white noise, where $\alpha$ is a complex number carrying the phase/amplitude information and $z$ a complex number carrying the sine wave period/exponential decay constant information, there are parametric techniques (ESPRIT, MUSIC) to get least square estimates of $z$. These techniques are particularly efficient when it comes to discriminating components in sums of signals. If you have a 100 Hz tone with a 1s exponential decay, and a 101 Hz tone with a 1.5s exponential decay added together, you'll recover these parameters provided noise is low-enough (while a naive DFT would have a hard time discriminating the two nearby sine waves). The downside is that your signal must conform to the chosen model for this to work.