Spectral flux


Spectral flux is a measure of how quickly the power spectrum of a signal is changing, calculated by comparing the power spectrum for one frame against the power spectrum from the previous frame. More precisely, it is usually calculated as the 2-norm between the two normalised spectra.
Calculated this way, the spectral flux is not dependent upon overall power, nor on phase considerations.
The spectral flux can be used to determine the timbre of an audio signal, or in onset detection, among other things.

Variations

Some implementations use the 1-norm rather than the 2-norm.
Some implementations do not normalise the spectra.
For onset detection, increases in energy are important, so some algorithms only include values calculated from bins in which the energy is increasing.