nnAudio.librosa_functions

Module containing functions cloned from librosa

To make sure nnAudio would not become broken when updating librosa

Functions

chroma

Create a chroma filter bank.

fft2gammatonemx

# Ellis’ description in MATLAB: # [wts,cfreqa] = fft2gammatonemx(nfft, sr, nfilts, width, minfreq, maxfreq, maxlen) # Generate a matrix of weights to combine FFT bins into # Gammatone bins.

fft_frequencies

Alternative implementation of np.fft.fftfreq :param sr: Audio sampling rate :type sr: number > 0 [scalar] :param n_fft: FFT window size :type n_fft: int > 0 [scalar]

get_gammatone

Create a Filterbank matrix to combine FFT bins into Gammatone bins :param sr: sampling rate of the incoming signal :type sr: number > 0 [scalar] :param n_fft: number of FFT components :type n_fft: int > 0 [scalar] :param n_bins: number of Mel bands to generate :type n_bins: int > 0 [scalar] :param fmin: lowest frequency (in Hz) :type fmin: float >= 0 [scalar] :param fmax: highest frequency (in Hz). If None, use fmax = sr / 2.0 :type fmax: float >= 0 [scalar] :param htk: use HTK formula instead of Slaney :type htk: bool [scalar] :param norm: if 1, divide the triangular mel weights by the width of the mel band (area normalization). Otherwise, leave all the triangles aiming for a peak value of 1.0 :type norm: {None, 1, np.inf} [scalar] :param dtype: The data type of the output basis. By default, uses 32-bit (single-precision) floating point. :type dtype: np.dtype.

get_mel

This function is cloned from librosa 0.7.

hz_to_mel

Convert Hz to Mels .

hz_to_octs

Convert frequencies (Hz) to (fractional) octave numbers.

mel_frequencies

This function is cloned from librosa 0.7.

mel_to_hz

Convert mel bin numbers to frequencies .

normalize

Normalize an array along a chosen axis.

pad_center

Wrapper for np.pad to automatically center an array prior to padding.

tiny

Compute the tiny-value corresponding to an input’s data type.