Skip to content

Commit 5fe6ff5

Browse files
committed
jit for fbank & specify spectral_magnitude args
1 parent 1b4ef61 commit 5fe6ff5

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

speechbrain/lobes/features.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ class Fbank(torch.nn.Module):
7777
>>> feats = feature_maker(inputs)
7878
>>> feats.shape
7979
torch.Size([10, 101, 40])
80+
>>> fbank = Fbank(sample_rate=8000, n_fft=512, n_mels=64, left_frames=0, right_frames=0, deltas=False)
81+
>>> _ = torch.jit.script(fbank)
8082
"""
8183

8284
def __init__(

speechbrain/processing/features.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ def forward(self, x, sig_length=None):
310310
return istft
311311

312312

313-
def spectral_magnitude(stft, power=1, log=False, eps=1e-14):
313+
def spectral_magnitude(
314+
stft, power: int = 1, log: bool = False, eps: float = 1e-14
315+
):
314316
"""Returns the magnitude of a complex spectrogram.
315317
316318
Arguments

0 commit comments

Comments
 (0)