Unverified Commit 22379d14 authored by Krishna Kalyan's avatar Krishna Kalyan Committed by GitHub
Browse files

[BC-Breaking] Remove deprecated create_fb_matrix (#1998)

parent 348ca8f6
......@@ -23,10 +23,6 @@ DB_to_amplitude
.. autofunction:: DB_to_amplitude
create_fb_matrix
----------------
.. autofunction:: create_fb_matrix
melscale_fbanks
---------------
......
......@@ -265,7 +265,7 @@ play_audio(waveform, sample_rate)
# Mel Filter Bank
# ---------------
#
# ``torchaudio.functional.create_fb_matrix`` generates the filter bank
# ``torchaudio.functional.melscale_fbanks`` generates the filter bank
# for converting frequency bins to mel-scale bins.
#
# Since this function does not require input audio/features, there is no
......@@ -277,7 +277,7 @@ n_fft = 256
n_mels = 64
sample_rate = 6000
mel_filters = F.create_fb_matrix(
mel_filters = F.melscale_fbanks(
int(n_fft // 2 + 1),
n_mels=n_mels,
f_min=0.,
......
......@@ -3,7 +3,6 @@ from .functional import (
compute_deltas,
compute_kaldi_pitch,
create_dct,
create_fb_matrix,
melscale_fbanks,
linear_fbanks,
DB_to_amplitude,
......@@ -54,7 +53,6 @@ __all__ = [
'compute_deltas',
'compute_kaldi_pitch',
'create_dct',
'create_fb_matrix',
'melscale_fbanks',
'linear_fbanks',
'DB_to_amplitude',
......
......@@ -19,7 +19,6 @@ __all__ = [
"DB_to_amplitude",
"compute_deltas",
"compute_kaldi_pitch",
"create_fb_matrix",
"melscale_fbanks",
"linear_fbanks",
"create_dct",
......@@ -466,52 +465,6 @@ def _create_triangular_filterbank(
return fb
def create_fb_matrix(
n_freqs: int,
f_min: float,
f_max: float,
n_mels: int,
sample_rate: int,
norm: Optional[str] = None,
mel_scale: str = "htk",
) -> Tensor:
r"""Create a frequency bin conversion matrix.
Args:
n_freqs (int): Number of frequencies to highlight/apply
f_min (float): Minimum frequency (Hz)
f_max (float): Maximum frequency (Hz)
n_mels (int): Number of mel filterbanks
sample_rate (int): Sample rate of the audio waveform
norm (str or None, optional): If 'slaney', divide the triangular mel weights by the width of the mel band
(area normalization). (Default: ``None``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
Returns:
Tensor: Triangular filter banks (fb matrix) of size (``n_freqs``, ``n_mels``)
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 be
``A * create_fb_matrix(A.size(-1), ...)``.
"""
warnings.warn(
"The use of `create_fb_matrix` is now deprecated and will be removed in "
"the 0.11 release. "
"Please migrate your code to use `melscale_fbanks` instead. "
"For more information, please refer to https://github.com/pytorch/audio/issues/1574."
)
return melscale_fbanks(
n_freqs=n_freqs,
f_min=f_min,
f_max=f_max,
n_mels=n_mels,
sample_rate=sample_rate,
norm=norm,
mel_scale=mel_scale
)
def melscale_fbanks(
n_freqs: int,
f_min: float,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment