Reference getCentroid()

getCentroid()

Returns the spectral centroid of the input signal. NOTE: analyze() must be called prior to getCentroid(). Analyze() tells the FFT to analyze frequency data, and getCentroid() uses the results determine the spectral centroid.

Examples

Returns

Number: Spectral Centroid Frequency of the spectral centroid in Hz.
Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References