Feature extraction

Spectral features

spectral_centroid(*[, y, sr, S, n_fft, ...])

Compute the spectral centroid.

spectral_bandwidth(*[, y, sr, S, n_fft, ...])

Compute p'th-order spectral bandwidth.

spectral_rolloff(*[, y, sr, S, n_fft, ...])

Compute roll-off frequency.

spectral_flatness(*[, y, S, n_fft, ...])

Compute spectral flatness.

spectral_contrast(*[, y, sr, S, n_fft, ...])

Compute spectral contrast.

rms(*[, y, S, frame_length, hop_length, ...])

Compute root-mean-square (RMS) value for each frame.

zero_crossing_rate(y, *[, frame_length, ...])

Compute the zero-crossing rate of an audio time series.

Mel-frequency representations

melspectrogram(*[, y, sr, S, n_fft, ...])

Compute a mel-scaled spectrogram.

mfcc(*[, y, sr, S, n_mfcc, dct_type, norm, ...])

Compute Mel-frequency cepstral coefficients (MFCCs).

Chromagram

chroma_stft(*[, y, sr, S, norm, n_fft, ...])

Compute a chromagram from a power spectrogram or waveform.

chroma_cqt(*[, y, sr, C, hop_length, fmin, ...])

Chromagram from a constant-Q transform.

chroma_filter(*, sr, n_fft[, n_chroma, ...])

Create a chroma filter bank.

Constant-Q transform

cqt(y, *[, sr, hop_length, fmin, n_bins, ...])

Compute the constant-Q transform following nnAudio's CQT1992v2 implementation.

cqt2010(y, *[, sr, hop_length, fmin, fmax, ...])

Compute constant-Q transform using the 2010 algorithm with multi-resolution.

cqt_frequencies(*[, n_bins, ...])

Compute the center frequencies of Constant-Q bins.

Tonal features

tonnetz(*[, y, sr, chroma])

Compute the tonal centroid features (tonnetz).

Pitch and frequency

hz_to_octs(frequencies, *[, tuning, ...])

Convert frequencies (Hz) to octave numbers.

note_to_hz()

Convert one or more note names to frequency (Hz).