# Total Variation of a Signal - Is It Proportional to Signal Energy?

In an audio application, I found it very useful to measure the total variation of a signal $y[n]$

$$\sum_{n=n_0}^{n_0+N} |y[n]-y[n-1]|$$

over a window of time length $N$ (discrete analogous to total variation of a function).

I've noticed that:

• during "background noise only" parts of the signal, this total variation is low

• during "background noise + musical sound" parts of the signal, the total variation is strictly higher.

Thus, it worked well in my application for envelope detection, etc. After doing my application, I heard about total variation denoising, and it seems to confirm why it works:

It is based on the principle that signals with excessive and possibly spurious detail have high total variation, that is, the integral of the absolute gradient of the signal is high.

This noise removal technique has advantages [...] total variation denoising is remarkably effective at simultaneously preserving edges whilst smoothing away noise in flat regions, even at low signal-to-noise ratios

The total variation of the signal over a time-window is in fact the distance traveled on the y-axis by the 1D-curve $n \mapsto y[n]$, so we understand why it works:

• when the signal is noise only, the waveform of the signal "travels" at a nearly-constant rate (see left of the following image)

• when the signal is noise + musical sound, the waveform of the signal "travels" more! (see right of the image)

Now the question:

Question: It seems that the total variation of the signal over a time-window is more or less proportional to the energy present in the signal during this window. Is this true?

• More like bandwidth than energy – Stanley Pawlukiewicz May 10 '18 at 15:03
• Suppose that we take $y[n]$ to be Gaussian. Then $y[n]-y[n-1]$ is simply a colored Gaussian - through a $1-z^{-1}$ filter, and $|y[n]-y[n-1]|$ is a "folded normal" RV. Your two conditions of "noise only" versus "signal+noise" is a comparison of two folded-normal-distributed RVs, coming from spectrally-shaped Gaussian random processes. The averaging over N samples provides a "sample mean" (well N times the sample mean) of the folded normal variables. – user35336 May 11 '18 at 4:29
• @msm the noise can be modelled by a gaussian, but the melodic signal is not: we can model it by a superposition of a few sinusoidal components for example – Basj May 11 '18 at 10:11
• True, if the "signal" is only a few sinusoidal components, then its distribution isn't so close to Gaussian. Often, the audio components are richer than this, though, and once you get past several main components, it heads towards (highly colored) Gaussian. – user35336 May 11 '18 at 23:32