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
a14c2992
Commit
a14c2992
authored
Feb 03, 2019
by
Jeremy Howard
Committed by
Soumith Chintala
Feb 03, 2019
Browse files
accept f_max and f_min for better compatibility with librosa
parent
3c3ce998
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
.gitignore
.gitignore
+4
-0
torchaudio/transforms.py
torchaudio/transforms.py
+3
-3
No files found.
.gitignore
View file @
a14c2992
...
@@ -3,6 +3,10 @@ __pycache__/
...
@@ -3,6 +3,10 @@ __pycache__/
*.py[cod]
*.py[cod]
*$py.class
*$py.class
# temp files
~*
*.swp
# C extensions / folders
# C extensions / folders
*.so
*.so
_ext/
_ext/
...
...
torchaudio/transforms.py
View file @
a14c2992
...
@@ -306,7 +306,7 @@ class MEL2(object):
...
@@ -306,7 +306,7 @@ class MEL2(object):
>>> sig, sr = torchaudio.load("test.wav", normalization=True)
>>> sig, sr = torchaudio.load("test.wav", normalization=True)
>>> spec_mel = transforms.MEL2(sr)(sig) # (c, l, m)
>>> spec_mel = transforms.MEL2(sr)(sig) # (c, l, m)
"""
"""
def
__init__
(
self
,
sr
=
16000
,
ws
=
400
,
hop
=
None
,
n_fft
=
None
,
def
__init__
(
self
,
sr
=
16000
,
ws
=
400
,
hop
=
None
,
n_fft
=
None
,
fmin
=
0.
,
fmax
=
None
,
pad
=
0
,
n_mels
=
40
,
window
=
torch
.
hann_window
,
wkwargs
=
None
):
pad
=
0
,
n_mels
=
40
,
window
=
torch
.
hann_window
,
wkwargs
=
None
):
self
.
window
=
window
self
.
window
=
window
self
.
sr
=
sr
self
.
sr
=
sr
...
@@ -317,8 +317,8 @@ class MEL2(object):
...
@@ -317,8 +317,8 @@ class MEL2(object):
self
.
n_mels
=
n_mels
# number of mel frequency bins
self
.
n_mels
=
n_mels
# number of mel frequency bins
self
.
wkwargs
=
wkwargs
self
.
wkwargs
=
wkwargs
self
.
top_db
=
-
80.
self
.
top_db
=
-
80.
self
.
f_max
=
None
self
.
f_max
=
fmax
self
.
f_min
=
0.
self
.
f_min
=
fmin
self
.
spec
=
SPECTROGRAM
(
self
.
ws
,
self
.
hop
,
self
.
n_fft
,
self
.
spec
=
SPECTROGRAM
(
self
.
ws
,
self
.
hop
,
self
.
n_fft
,
self
.
pad
,
self
.
window
,
self
.
wkwargs
)
self
.
pad
,
self
.
window
,
self
.
wkwargs
)
self
.
fm
=
F2M
(
self
.
n_mels
,
self
.
sr
,
self
.
f_max
,
self
.
f_min
)
self
.
fm
=
F2M
(
self
.
n_mels
,
self
.
sr
,
self
.
f_max
,
self
.
f_min
)
...
...
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