librosa.core.pseudo_cqt

librosa.core.pseudo_cqt(y, sr=22050, hop_length=512, fmin=None, n_bins=84, bins_per_octave=12, tuning=None, filter_scale=1, norm=1, sparsity=0.01, resolution=<DEPRECATED parameter>)

Compute the pseudo constant-Q transform of an audio signal.

This uses a single fft size that is the smallest power of 2 that is greater than or equal to the max of:

  1. The longest CQT filter
  2. 2x the hop_length
Parameters:

y : np.ndarray [shape=(n,)]

audio time series

sr : number > 0 [scalar]

sampling rate of y

hop_length : int > 0 [scalar]

number of samples between successive CQT columns.

fmin : float > 0 [scalar]

Minimum frequency. Defaults to C1 ~= 32.70 Hz

n_bins : int > 0 [scalar]

Number of frequency bins, starting at fmin

bins_per_octave : int > 0 [scalar]

Number of bins per octave

tuning : None or float in [-0.5, 0.5)

Tuning offset in fractions of a bin (cents).

If None, tuning will be automatically estimated.

filter_scale : float > 0

Filter filter_scale factor. Larger values use longer windows.

sparsity : float in [0, 1)

Sparsify the CQT basis by discarding up to sparsity fraction of the energy in each basis.

Set sparsity=0 to disable sparsification.

resolution : float

Warning

This parameter name was in librosa 0.4.2 Use the filter_scale parameter instead. The resolution parameter will be removed in librosa 0.5.0.

Returns:

CQT : np.ndarray [shape=(n_bins, t), dtype=np.float]

Pseudo Constant-Q energy for each frequency at each time.

Raises:

ParameterError

If hop_length is not an integer multiple of 2**(n_bins / bins_per_octave)