Repository: pytorch/audio

Issue:
Removing `create_fb_matrix` in v0.11
In #1653, we have deprecated  `create_fb_matrix` in favor of `melscale_fbanks`.
After the v.10 release, we plan to remove `create_fb_matrix`.


Discussion:

Resolving patch:
diff --git a/examples/tutorials/audio_feature_extractions_tutorial.py b/examples/tutorials/audio_feature_extractions_tutorial.py
--- a/examples/tutorials/audio_feature_extractions_tutorial.py
+++ b/examples/tutorials/audio_feature_extractions_tutorial.py
@@ -265,7 +265,7 @@ def plot_kaldi_pitch(waveform, sample_rate, pitch, nfcc):
 # 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 @@ def plot_kaldi_pitch(waveform, sample_rate, pitch, nfcc):
 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.,
diff --git a/torchaudio/functional/__init__.py b/torchaudio/functional/__init__.py
--- a/torchaudio/functional/__init__.py
+++ b/torchaudio/functional/__init__.py
@@ -3,7 +3,6 @@
     compute_deltas,
     compute_kaldi_pitch,
     create_dct,
-    create_fb_matrix,
     melscale_fbanks,
     linear_fbanks,
     DB_to_amplitude,
@@ -54,7 +53,6 @@
     'compute_deltas',
     'compute_kaldi_pitch',
     'create_dct',
-    'create_fb_matrix',
     'melscale_fbanks',
     'linear_fbanks',
     'DB_to_amplitude',
diff --git a/torchaudio/functional/functional.py b/torchaudio/functional/functional.py
--- a/torchaudio/functional/functional.py
+++ b/torchaudio/functional/functional.py
@@ -19,7 +19,6 @@
     "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,


Test patch: