# Spectral centroid

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Spectral_centroid
> Markdown URL: https://mediated.wiki/source/Spectral_centroid.md
> Source: https://en.wikipedia.org/wiki/Spectral_centroid
> Source revision: 1311200791
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Measure used in digital signal processing

The **spectral centroid** is a measure used in [digital signal processing](/source/Digital_signal_processing) to characterise a [spectrum](/source/Spectrum). It indicates where the [center of mass](/source/Center_of_mass) of the spectrum is located. Perceptually, it has a robust connection with the impression of [brightness of a sound](/source/Brightness_(sound)).[1] It is sometimes called center of spectral mass.[2]

## Calculation

It is calculated as the [weighted mean](/source/Weighted_mean) of the frequencies present in the signal, determined using a [Fourier transform](/source/Fourier_transform), with their magnitudes as the weights:[3]

- centroid = ∑ n = 0 N − 1 f ( n ) x ( n ) ∑ n = 0 N − 1 x ( n ) , {\displaystyle {\text{centroid}}={\frac {\sum _{n=0}^{N-1}f(n)x(n)}{\sum _{n=0}^{N-1}x(n)}},}

where *x*(*n*) represents the weighted frequency value, or magnitude, of [bin](/source/Histogram) number *n*, and *f*(*n*) represents the center frequency of that bin.

## Alternative usage

Some people use "spectral centroid" to refer to the [median](/source/Median) of the spectrum. This is a *different* statistic, the difference being essentially the same as the difference between the unweighted median and [mean](/source/Mean) statistics. Since both are [measures of central tendency](/source/Average), in some situations they will exhibit some similarity of behaviour. But since typical audio spectra are not [normally distributed](/source/Normal_distribution), the two measures will often give strongly different values. Grey and Gordon in 1978 found the mean a better fit than the median.[1]

## Applications

Because the spectral centroid is a good predictor of the "brightness" of a sound,[1] it is widely used in digital audio and music processing as an automatic measure of musical [timbre](/source/Timbre).[4]

## References

1. ^ [***a***](#cite_ref-greygordon78_1-0) [***b***](#cite_ref-greygordon78_1-1) [***c***](#cite_ref-greygordon78_1-2) Grey, John M.; Gordon, John W. (1978). "Perceptual effects of spectral modifications on musical timbres". *The Journal of the Acoustical Society of America*. **63** (5). Acoustical Society of America (ASA): 1493–1500. [Bibcode](/source/Bibcode_(identifier)):[1978ASAJ...63.1493G](https://ui.adsabs.harvard.edu/abs/1978ASAJ...63.1493G). [doi](/source/Doi_(identifier)):[10.1121/1.381843](https://doi.org/10.1121%2F1.381843). [ISSN](/source/ISSN_(identifier)) [0001-4966](https://search.worldcat.org/issn/0001-4966).

1. **[^](#cite_ref-2)** Pulavarti, Surya V. S. R. K.; Maguire, Jack B.; Yuen, Shirley; Harrison, Joseph S.; Griffin, Jermel; Premkumar, Lakshmanane; Esposito, Edward A.; Makhatadze, George I.; Garcia, Angel E.; Weiss, Thomas M.; Snell, Edward H. (2022-02-17). ["From Protein Design to the Energy Landscape of a Cold Unfolding Protein"](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9281400). *The Journal of Physical Chemistry B*. **126** (6): 1212–1231. [doi](/source/Doi_(identifier)):[10.1021/acs.jpcb.1c10750](https://doi.org/10.1021%2Facs.jpcb.1c10750). [ISSN](/source/ISSN_(identifier)) [1520-6106](https://search.worldcat.org/issn/1520-6106). [PMC](/source/PMC_(identifier)) [9281400](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9281400). [PMID](/source/PMID_(identifier)) [35128921](https://pubmed.ncbi.nlm.nih.gov/35128921).

1. **[^](#cite_ref-3)** [A Large Set of Audio Features for Sound Description](http://recherche.ircam.fr/equipes/analyse-synthese/peeters/ARTICLES/Peeters_2003_cuidadoaudiofeatures.pdf). Technical report published by [IRCAM](/source/IRCAM) in 2003. Section 6.1.1 describes the spectral centroid.

1. **[^](#cite_ref-4)** Schubert, Emery; Wolfe, Joe; Tarnopolsky, Alex (2004). ["Spectral centroid and timbre in complex, multiple instrumental textures"](https://web.archive.org/web/20110810004531/http://icmpc8.umn.edu/proceedings/ICMPC8/PDF/AUTHOR/MP040215.PDF) (PDF). *Proceedings of the 8th International Conference on Music Perception & Cognition, North Western University, Illinois*. [International Conference on Music Perception & Cognition](http://www.icmpc8.umn.edu/index_all.htm). Lipscomb, S.D.; Ashley, R.; Gjerdingen, R. O.; Webster, P. (Eds.). Sydney, Australia: School of Music and Music Education; School of Physics, University of New South Wales. Archived from [the original](http://icmpc8.umn.edu/proceedings/ICMPC8/PDF/AUTHOR/MP040215.PDF) (PDF) on 2011-08-10.

---
Adapted from the Wikipedia article [Spectral centroid](https://en.wikipedia.org/wiki/Spectral_centroid) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Spectral_centroid?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
