c, n = sig.size()
new_sig = sig.new_empty(c, n + self.pad * 2)
new_sig[:, :self.pad].zero_()
new_sig[:, -self.pad:].zero_()
new_sig.narrow(1, self.pad, n).copy_(sig)
sig = new_sig
spec_f = torch.stft(sig, self.n_fft, self.hop, self.ws,
self.window, center=False,
normalized=True, onesided=True).transpose(1, 2)
spec_f /= self.window.pow(2).sum().sqrt()
spec_f = spec_f.pow(2).sum(-1) // get power of "complex" tensor (c, l, n_fft)
return spec_f if is_variable else spec_f.data
class F2M(object):
This turns a normal STFT into a MEL Frequency STFT, using a conversion
After Change
normalized=True, onesided=True).transpose(1, 2)
spec_f /= self.window.pow(2).sum().sqrt()
spec_f = spec_f.pow(2).sum(-1) // get power of "complex" tensor (c, l, n_fft)
return spec_f
class F2M(object):
This turns a normal STFT into a MEL Frequency STFT, using a conversion