librosax.feature.chroma_filter

chroma_filter(*, sr: float, n_fft: int, n_chroma: int = 12, tuning: float = 0.0, ctroct: float = 5.0, octwidth: float | None = 2, norm: float | None = 2, base_c: bool = True, dtype: ~numpy.dtype = <class 'jax.numpy.float32'>) Array[source]

Create a chroma filter bank.

Creates a linear transformation matrix to project FFT bins onto chroma bins.

Parameters:
  • sr – Sampling rate

  • n_fft – Number of FFT bins

  • n_chroma – Number of chroma bins to produce (default: 12)

  • tuning – Tuning deviation from A440 in fractional bins (default: 0.0)

  • ctroct – Center of Gaussian weighting in octaves (default: 5.0)

  • octwidth – Gaussian half-width for weighting. None for flat weighting (default: 2)

  • norm – Normalization factor for filter weights. None for no normalization (default: 2)

  • base_c – If True, start filter bank at C. If False, start at A (default: True)

  • dtype – Data type for filter bank

Returns:

Chroma filter bank [shape=(n_chroma, 1 + n_fft/2)]

Return type:

jnp.ndarray