{{Short description|Measure used in digital signal processing}} The '''spectral centroid''' is a measure used in [[digital signal processing]] to characterise a [[spectrum]]. It indicates where the [[center of mass]] of the spectrum is located. Perceptually, it has a robust connection with the impression of [[brightness (sound)|brightness of a sound]].<ref name="greygordon78">{{cite journal | last1=Grey | first1=John M. | last2=Gordon | first2=John W. | title=Perceptual effects of spectral modifications on musical timbres | journal=The Journal of the Acoustical Society of America | publisher=Acoustical Society of America (ASA) | volume=63 | issue=5 | year=1978 | issn=0001-4966 | doi=10.1121/1.381843 | pages=1493–1500| bibcode=1978ASAJ...63.1493G }}</ref> It is sometimes called center of spectral mass.<ref>{{Cite journal |last1=Pulavarti |first1=Surya V. S. R. K. |last2=Maguire |first2=Jack B. |last3=Yuen |first3=Shirley |last4=Harrison |first4=Joseph S. |last5=Griffin |first5=Jermel |last6=Premkumar |first6=Lakshmanane |last7=Esposito |first7=Edward A. |last8=Makhatadze |first8=George I. |last9=Garcia |first9=Angel E. |last10=Weiss |first10=Thomas M. |last11=Snell |first11=Edward H. |date=2022-02-17 |title=From Protein Design to the Energy Landscape of a Cold Unfolding Protein |journal=The Journal of Physical Chemistry B |language=en |volume=126 |issue=6 |pages=1212–1231 |doi=10.1021/acs.jpcb.1c10750 |pmid=35128921 |pmc=9281400 |issn=1520-6106}}</ref>
==Calculation== It is calculated as the [[weighted mean]] of the frequencies present in the signal, determined using a [[Fourier transform]], with their magnitudes as the weights:<ref>[http://recherche.ircam.fr/equipes/analyse-synthese/peeters/ARTICLES/Peeters_2003_cuidadoaudiofeatures.pdf A Large Set of Audio Features for Sound Description]. Technical report published by [[IRCAM]] in 2003. Section 6.1.1 describes the spectral centroid.</ref> : <math> \text{centroid} = \frac{ \sum_{n=0}^{N-1} f(n) x(n) } { \sum_{n=0}^{N-1} x(n) }, </math> where ''x''(''n'') represents the weighted frequency value, or magnitude, of [[Histogram|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]] statistics. Since both are [[Average|measures of central tendency]], in some situations they will exhibit some similarity of behaviour. But since typical audio spectra are not [[normal distribution|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.<ref name="greygordon78"/>
==Applications==
Because the spectral centroid is a good predictor of the "brightness" of a sound,<ref name="greygordon78"/> it is widely used in digital audio and music processing as an automatic measure of musical [[timbre]].<ref> {{cite conference |last1 = Schubert |first1 = Emery |last2 = Wolfe |first2 = Joe |last3 = Tarnopolsky |first3 = Alex |others = Lipscomb, S.D.; Ashley, R.; Gjerdingen, R. O.; Webster, P. (Eds.) |year = 2004 |url = http://icmpc8.umn.edu/proceedings/ICMPC8/PDF/AUTHOR/MP040215.PDF |title = Spectral centroid and timbre in complex, multiple instrumental textures |conference = International Conference on Music Perception & Cognition |conference-url = http://www.icmpc8.umn.edu/index_all.htm |book-title = Proceedings of the 8th International Conference on Music Perception & Cognition, North Western University, Illinois |publisher = School of Music and Music Education; School of Physics, University of New South Wales |location = Sydney, Australia |url-status = dead |archive-url = https://web.archive.org/web/20110810004531/http://icmpc8.umn.edu/proceedings/ICMPC8/PDF/AUTHOR/MP040215.PDF |archive-date = 2011-08-10 }}</ref>
==References== <references/>
[[Category:Digital signal processing]]