torchaudio.prototype.functional.barkscale_fbanks¶
- torchaudio.prototype.functional.barkscale_fbanks(n_freqs: int, f_min: float, f_max: float, n_barks: int, sample_rate: int, bark_scale: str = 'traunmuller') Tensor [source]¶
Create a frequency bin conversion matrix.
- Parameters:
n_freqs (int) – Number of frequencies to highlight/apply
f_min (float) – Minimum frequency (Hz)
f_max (float) – Maximum frequency (Hz)
n_barks (int) – Number of mel filterbanks
sample_rate (int) – Sample rate of the audio waveform
bark_scale (str, optional) – Scale to use:
traunmuller
,``schroeder`` orwang
. (Default:traunmuller
)
- Returns:
Triangular filter banks (fb matrix) of size (
n_freqs
,n_barks
) meaning number of frequencies to highlight/apply to x the number of filterbanks. Each column is a filterbank so that assuming there is a matrix A of size (…,n_freqs
), the applied result would beA * barkscale_fbanks(A.size(-1), ...)
.- Return type: