Exemple #1
0
def delta_delta(fbank, sr=8000, feature_size=40):
    '''
  params:
    fbank: [nframe, nfbank]
  return : [nframe, nfbank, 3]
  '''
    del sr, feature_size
    assert fbank.ndim == 2
    delta = psf.delta(fbank, N=2)
    _delta_delta = psf.delta(delta, N=2)
    return np.stack([fbank, delta, _delta_delta], axis=-1)
Exemple #2
0
def extract_fbank(samples, sr=8000, winlen=0.025, winstep=0.01,
                  feature_size=40):
  ''' extract logfbank with delta and delta-delta
  Return:
      ndarray of shape [nfrmae, feature_size * 3]
  '''
  feat = psf.logfbank(
      samples,
      nfilt=feature_size,
      samplerate=sr,
      winlen=winlen,
      winstep=winstep,
      lowfreq=0,
      highfreq=None,
      preemph=0.97)
  delta = psf.delta(feat, N=2)
  _delta_delta = psf.delta(delta, N=2)
  return np.stack([feat, delta, _delta_delta], axis=-1)