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
04e0e2ff
Commit
04e0e2ff
authored
Oct 12, 2021
by
nateanl
Committed by
Zhaoheng Ni
Oct 12, 2021
Browse files
[BC-Breaking] Replace waveform with specgram in SlidingWindowCmn (#1859)
parent
49c48f93
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
torchaudio/functional/functional.py
torchaudio/functional/functional.py
+1
-1
torchaudio/transforms.py
torchaudio/transforms.py
+6
-6
No files found.
torchaudio/functional/functional.py
View file @
04e0e2ff
...
...
@@ -1211,7 +1211,7 @@ def sliding_window_cmn(
Apply sliding-window cepstral mean (and optionally variance) normalization per utterance.
Args:
specgram (Tensor): Tensor of
audio
of dimension `(..., time, freq)`
specgram (Tensor): Tensor of
spectrogram
of dimension `(..., time, freq)`
cmn_window (int, optional): Window in frames for running average CMN computation (int, default = 600)
min_cmn_window (int, optional): Minimum CMN window used at start of decoding (adds latency only at start).
Only applicable if center == false, ignored if center==true (int, default = 100)
...
...
torchaudio/transforms.py
View file @
04e0e2ff
...
...
@@ -1198,17 +1198,17 @@ class SlidingWindowCmn(torch.nn.Module):
self
.
center
=
center
self
.
norm_vars
=
norm_vars
def
forward
(
self
,
wavefor
m
:
Tensor
)
->
Tensor
:
def
forward
(
self
,
specgra
m
:
Tensor
)
->
Tensor
:
r
"""
Args:
wavefor
m (Tensor): Tensor of
audio
of dimension `(..., time)`.
specgra
m (Tensor): Tensor of
spectrogram
of dimension `(..., time
, freq
)`.
Returns:
Tensor: Tensor of
audio
of dimension `(..., time)`.
Tensor: Tensor of
spectrogram
of dimension `(..., time
, freq
)`.
"""
cmn_
wavefor
m
=
F
.
sliding_window_cmn
(
wavefor
m
,
self
.
cmn_window
,
self
.
min_cmn_window
,
self
.
center
,
self
.
norm_vars
)
return
cmn_
wavefor
m
cmn_
specgra
m
=
F
.
sliding_window_cmn
(
specgra
m
,
self
.
cmn_window
,
self
.
min_cmn_window
,
self
.
center
,
self
.
norm_vars
)
return
cmn_
specgra
m
class
Vad
(
torch
.
nn
.
Module
):
...
...
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