{{Short description|Measure used in digital signal processing to characterize an audio spectrum}} thumb|Maximum spectral flatness (approaching 1) is achieved by white noise. '''Spectral flatness''' or '''tonality coefficient''',<ref name="johnston88"> {{cite journal |author=J. D. Johnston |title=Transform coding of audio signals using perceptual noise criteria |journal=IEEE Journal on Selected Areas in Communications |volume=6 |issue=2 |pages=314–332 |year=1988 |doi=10.1109/49.608 |s2cid=5999699 }}</ref><ref name="Signal Processing Letters"> {{cite journal |author=Shlomo Dubnov |title=Generalization of Spectral Flatness Measure for Non-Gaussian Linear Processes |journal= IEEE Signal Processing Letters |volume=11 |issue=8 |pages=698–701 |year=2004 |issn=1070-9908 |doi=10.1109/LSP.2004.831663 |bibcode=2004ISPL...11..698D |s2cid=14778866 }}</ref> also known as '''Wiener entropy''',<ref>[http://soundanalysispro.com/manual-1/chapter-4-the-song-features-of-sap2/wiener-entropy The Song Features › Wiener entropy] "defined as the ratio of geometric mean to arithmetic mean of the spectrum"</ref><ref>[https://luscinia.sourceforge.net/page19/page8/page33/page33.html Luscinia parameters] "Wiener entropy is an alternative measure of the noisiness of a signal. It is defined as the ratio of the geometric mean to the arithmetic mean of the power spectrum."</ref> is a measure used in digital signal processing to characterize an audio spectrum. Spectral flatness is typically measured in decibels, and provides a way to quantify how much a sound resembles a pure tone, as opposed to being noise-like.<ref name="Signal Processing Letters" />
==Interpretation== The meaning of ''tonal'' in this context is in the sense of the amount of peaks or resonant structure in a power spectrum, as opposed to the flat spectrum of white noise. A high spectral flatness (approaching 1.0 for white noise) indicates that the spectrum has a similar amount of power in all spectral bands — this would sound similar to white noise, and the graph of the spectrum would appear relatively flat and smooth. A low spectral flatness (approaching 0.0 for a pure tone) indicates that the spectral power is concentrated in a relatively small number of bands — this would typically sound like a mixture of sine waves, and the spectrum would appear "spiky".<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 9.1</ref>
Dubnov <ref name="Signal Processing Letters" /> has shown that spectral flatness is equivalent to information theoretic concept of mutual information that is known as dual total correlation.
==Formulation== The spectral flatness is calculated by dividing the geometric mean of the power spectrum by the arithmetic mean of the power spectrum, i.e.:
:<math> \mathrm{Flatness} = \frac{\sqrt[N]{\prod_{n=0}^{N-1}x(n)}}{\frac{\sum_{n=0}^{N-1}x(n)}{N}} = \frac{\exp\left(\frac{1}{N}\sum_{n=0}^{N-1} \ln x(n)\right)}{\frac{1}{N} \sum_{n=0}^{N-1}x(n)} </math>
where ''x(n)'' represents the magnitude of bin number ''n''. Note that a single (or more) empty bin yields a flatness of 0, so this measure is most useful when bins are generally not empty.
The ratio produced by this calculation is often converted to a decibel scale for reporting, with a maximum of 0 dB and a minimum of −∞ dB.
The spectral flatness can also be measured within a specified sub-band, rather than across the whole band.
== Applications == This measurement is one of the many audio descriptors used in the MPEG-7 standard, in which it is labelled <nowiki>"AudioSpectralFlatness"</nowiki>.
In birdsong research, it has been used as one of the features measured on birdsong audio, when testing similarity between two excerpts.<ref>Tchernichovski, O., Nottebohm, F., Ho, C. E., Pesaran, B., Mitra, P. P., 2000. A procedure for an automated measurement of song similarity. Animal Behaviour 59 (6), 1167–1176, {{doi|10.1006/anbe.1999.1416}}.</ref> Spectral flatness has also been used in the analysis of electroencephalography (EEG) diagnostics and research,<ref>{{cite journal|title=Burns & Rajan (2015) Combining complexity measures of EEG data: multiplying measures reveal previously hidden information. F1000Research. 4:137.|year=2015|pmc=4648221|last1=Burns|first1=T.|last2=Rajan|first2=R.|journal=F1000Research|volume=4|page=137|doi=10.12688/f1000research.6590.1|pmid=26594331 |doi-access=free }}</ref> and psychoacoustics in humans.<ref>{{cite journal|title=A Mathematical Approach to Correlating Objective Spectro-Temporal Features of Non-linguistic Sounds With Their Subjective Perceptions in Humans|year=2019|pmid=31417350|last1=Burns|first1=T.|last2=Rajan|first2=R.|journal=Frontiers in Neuroscience|volume=13|page=794|doi=10.3389/fnins.2019.00794|pmc=6685481|doi-access=free}}</ref>
== References ==
{{Reflist}}
Category:Digital signal processing Category:Spectrum (physical sciences)