SpectralCentroid#
- class ansys.sound.core.psychoacoustics.SpectralCentroid(signal=None)#
Computes the spectral centroid of a signal.
The spectral centroid is the center of gravity of the spectrum. It is a measure of the distribution of the spectral energy of a signal.
See also
Examples
Compute the spectral centroid of a signal.
>>> from ansys.sound.core.psychoacoustics import SpectralCentroid >>> spectral_centroid = SpectralCentroid(signal=my_signal) >>> spectral_centroid.process() >>> spectral_centroid_value = spectral_centroid.get_spectral_centroid()
Class instantiation takes the following parameters.
- Parameters:
- signal
Field, default:None Signal on which to compute spectral centroid.
- signal
Methods
Get the spectral centroid.
Get the spectral centroid as a NumPy array.
Get the spectral centroid.
Plot the output.
Compute the spectral centroid.
Attributes
Input signal.