librosax.feature.tonnetz

tonnetz(*, y: Array | None = None, sr: float = 22050, chroma: Array | None = None, **kwargs) Array[source]

Compute the tonal centroid features (tonnetz).

This representation projects chroma features onto a 6-dimensional basis representing the perfect fifth, minor third, and major third each as two-dimensional coordinates.

Parameters:
  • y – Audio time series. Multichannel is supported.

  • sr – Sampling rate of y

  • chroma – Normalized energy for each chroma bin at each frame. If None, a chroma_stft is computed.

  • **kwargs – Additional keyword arguments to chroma_stft, if chroma is not pre-computed.

Returns:

Tonal centroid features [shape=(…, 6, t)]

Tonnetz dimensions: - 0: Fifth x-axis - 1: Fifth y-axis - 2: Minor x-axis - 3: Minor y-axis - 4: Major x-axis - 5: Major y-axis

Return type:

jnp.ndarray