librosax.feature.cqt2010¶
- cqt2010(y: ~jax.Array, *, sr: float = 22050, hop_length: int = 512, fmin: float | None = None, fmax: float | None = None, n_bins: int = 84, bins_per_octave: int = 12, tuning: float = 0.0, filter_scale: float = 1.0, norm: float | None = 1.0, sparsity: float = 0.01, window: str = 'hann', scale: bool = True, pad_mode: str = 'reflect', res_type: str | None = None, dtype: ~numpy.dtype = <class 'jax.numpy.complex64'>, output_format: str = 'magnitude', earlydownsample: bool = True) Array[source]¶
Compute constant-Q transform using the 2010 algorithm with multi-resolution.
This implementation follows nnAudio’s CQT2010v2 algorithm which is more memory-efficient than CQT1992. It creates a small CQT kernel for the top octave and uses downsampling to compute lower octaves.
- Parameters:
y – Audio time series
sr – Sampling rate
hop_length – Number of samples between successive CQT columns
fmin – Minimum frequency (default: C1 = 32.70 Hz)
fmax – Maximum frequency (default: inferred from n_bins)
n_bins – Number of frequency bins
bins_per_octave – Number of bins per octave
tuning – Tuning offset in fractions of a bin
filter_scale – Filter scale factor
norm – Normalization type for basis functions
sparsity – Sparsification factor (not implemented)
window – Window function
scale – If True, scale the output
pad_mode – Padding mode
res_type – Resampling type (not used)
dtype – Complex data type
output_format – Output format (‘magnitude’, ‘complex’, ‘phase’)
earlydownsample – If True, use early downsampling optimization
- Returns:
CQT matrix