The spectral centroid is a measure used in
digital signal processing to characterise a
spectrum
A spectrum (plural ''spectra'' or ''spectrums'') is a condition that is not limited to a specific set of values but can vary, without gaps, across a continuum. The word was first used scientifically in optics to describe the rainbow of colors ...
. It indicates where the
center of mass of the spectrum is located. Perceptually, it has a robust connection with the impression of
brightness of a sound.
It is sometimes called center of spectral mass.
Calculation
It is calculated as the
weighted mean
The weighted arithmetic mean is similar to an ordinary arithmetic mean (the most common type of average), except that instead of each of the data points contributing equally to the final average, some data points contribute more than others. The ...
of the frequencies present in the signal, determined using a
Fourier transform, with their magnitudes as the weights:
:
where ''x(n)'' represents the weighted frequency value, or magnitude, of
bin number ''n'', and ''f(n)'' represents the center frequency of that bin.
Alternative usage
Some people use "spectral centroid" to refer to the
median of the spectrum. This is a ''different'' statistic, the difference being essentially the same as the difference between the unweighted median and
mean
There are several kinds of mean in mathematics, especially in statistics. Each mean serves to summarize a given group of data, often to better understand the overall value (magnitude and sign) of a given data set.
For a data set, the '' ari ...
statistics. Since both are
measures of central tendency, in some situations they will exhibit some similarity of behaviour. But since typical audio spectra are not
normally distributed, the two measures will often give strongly different values. Grey and Gordon in 1978 found the mean a better fit than the median.
Applications
Because the spectral centroid is a good predictor of the "brightness" of a sound,
it is widely used in digital audio and music processing as an automatic measure of musical
timbre
In music, timbre ( ), also known as tone color or tone quality (from psychoacoustics), is the perceived sound quality of a musical note, sound or tone. Timbre distinguishes different types of sound production, such as choir voices and musica ...
.
[
]
References
Digital signal processing
{{Signal-processing-stub