Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
22379d14
Unverified
Commit
22379d14
authored
Nov 10, 2021
by
Krishna Kalyan
Committed by
GitHub
Nov 10, 2021
Browse files
[BC-Breaking] Remove deprecated create_fb_matrix (#1998)
parent
348ca8f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
55 deletions
+2
-55
docs/source/functional.rst
docs/source/functional.rst
+0
-4
examples/tutorials/audio_feature_extractions_tutorial.py
examples/tutorials/audio_feature_extractions_tutorial.py
+2
-2
torchaudio/functional/__init__.py
torchaudio/functional/__init__.py
+0
-2
torchaudio/functional/functional.py
torchaudio/functional/functional.py
+0
-47
No files found.
docs/source/functional.rst
View file @
22379d14
...
...
@@ -23,10 +23,6 @@ DB_to_amplitude
.. autofunction:: DB_to_amplitude
create_fb_matrix
----------------
.. autofunction:: create_fb_matrix
melscale_fbanks
---------------
...
...
examples/tutorials/audio_feature_extractions_tutorial.py
View file @
22379d14
...
...
@@ -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.
,
...
...
torchaudio/functional/__init__.py
View file @
22379d14
...
...
@@ -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'
,
...
...
torchaudio/functional/functional.py
View file @
22379d14
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment