Commit 04e0e2ff authored by nateanl's avatar nateanl Committed by Zhaoheng Ni
Browse files

[BC-Breaking] Replace waveform with specgram in SlidingWindowCmn (#1859)

parent 49c48f93
...@@ -1211,7 +1211,7 @@ def sliding_window_cmn( ...@@ -1211,7 +1211,7 @@ def sliding_window_cmn(
Apply sliding-window cepstral mean (and optionally variance) normalization per utterance. Apply sliding-window cepstral mean (and optionally variance) normalization per utterance.
Args: 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) 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). 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) Only applicable if center == false, ignored if center==true (int, default = 100)
......
...@@ -1198,17 +1198,17 @@ class SlidingWindowCmn(torch.nn.Module): ...@@ -1198,17 +1198,17 @@ class SlidingWindowCmn(torch.nn.Module):
self.center = center self.center = center
self.norm_vars = norm_vars self.norm_vars = norm_vars
def forward(self, waveform: Tensor) -> Tensor: def forward(self, specgram: Tensor) -> Tensor:
r""" r"""
Args: Args:
waveform (Tensor): Tensor of audio of dimension `(..., time)`. specgram (Tensor): Tensor of spectrogram of dimension `(..., time, freq)`.
Returns: Returns:
Tensor: Tensor of audio of dimension `(..., time)`. Tensor: Tensor of spectrogram of dimension `(..., time, freq)`.
""" """
cmn_waveform = F.sliding_window_cmn( cmn_specgram = F.sliding_window_cmn(
waveform, self.cmn_window, self.min_cmn_window, self.center, self.norm_vars) specgram, self.cmn_window, self.min_cmn_window, self.center, self.norm_vars)
return cmn_waveform return cmn_specgram
class Vad(torch.nn.Module): class Vad(torch.nn.Module):
......
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