Esempio n. 1
0
 def __init__(self, sr=16000, n_dct_filters=40, n_mels=128, f_max=4000, f_min=20, n_fft=480, hop_ms=10):
     super().__init__()
     self.n_mels = n_mels
     self.dct_filters = np.load('dct_filter.npy')
     self.sr = sr
     self.f_max = f_max if f_max is not None else sr // 2
     self.f_min = f_min
     self.n_fft = n_fft
     self.hop_length = sr // 1000 * hop_ms
     self.pcen_transform = pcen.StreamingPCENTransform(n_mels=n_mels, n_fft=n_fft, hop_length=self.hop_length, trainable=True)
Esempio n. 2
0
 def __init__(self,
              sr=16000,
              n_dct_filters=40,
              n_mels=40,
              f_max=4000,
              f_min=20,
              n_fft=480,
              hop_ms=10,
              config=None):
     super().__init__()
     self.config = config
     self.n_mels = n_mels  # 40
     self.sr = sr
     self.f_max = f_max if f_max is not None else sr // 2  # 4000
     self.f_min = f_min  # 20
     self.n_fft = n_fft  # duan shi fu li ye 480
     self.hop_length = sr // 1000 * hop_ms
     self.pcen_transform = pcen.StreamingPCENTransform(
         n_mels=n_mels,
         n_fft=n_fft,
         hop_length=self.hop_length,
         trainable=True)