當前位置: 首頁>>代碼示例>>Python>>正文


Python hparams.preemphasis方法代碼示例

本文整理匯總了Python中hparams.hparams.preemphasis方法的典型用法代碼示例。如果您正苦於以下問題:Python hparams.preemphasis方法的具體用法?Python hparams.preemphasis怎麽用?Python hparams.preemphasis使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在hparams.hparams的用法示例。


在下文中一共展示了hparams.preemphasis方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _inv_preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def _inv_preemphasis(x):
    N = tf.shape(x)[0]
    i = tf.constant(0)
    W = tf.zeros(shape=tf.shape(x), dtype=tf.float32)

    def condition(i, y):
        return tf.less(i, N)

    def body(i, y):
        tmp = tf.slice(x, [0], [i + 1])
        tmp = tf.concat([tf.zeros([N - i - 1]), tmp], -1)
        y = hparams.preemphasis * y + tmp
        i = tf.add(i, 1)
        return [i, y]

    final = tf.while_loop(condition, body, [i, W])

    y = final[1]

    return y 
開發者ID:candlewill,項目名稱:Griffin_lim,代碼行數:22,代碼來源:griffin_lim.py

示例2: _preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def _preemphasis(x):
    return signal.lfilter([1, -hparams.preemphasis], [1], x) 
開發者ID:candlewill,項目名稱:Griffin_lim,代碼行數:4,代碼來源:audio.py

示例3: _inv_preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def _inv_preemphasis(x):
    return signal.lfilter([1], [1, -hparams.preemphasis], x) 
開發者ID:candlewill,項目名稱:Griffin_lim,代碼行數:4,代碼來源:audio.py

示例4: preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def preemphasis(x):
  return scipy.signal.lfilter([1, -hparams.preemphasis], [1], x) 
開發者ID:yanggeng1995,項目名稱:vae_tacotron,代碼行數:4,代碼來源:audio.py

示例5: inv_preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def inv_preemphasis(x):
  return scipy.signal.lfilter([1], [1, -hparams.preemphasis], x) 
開發者ID:yanggeng1995,項目名稱:vae_tacotron,代碼行數:4,代碼來源:audio.py

示例6: spectrogram

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def spectrogram(y):
  D = _stft(preemphasis(y))
  S = _amp_to_db(np.abs(D)) - hparams.ref_level_db
  return _normalize(S) 
開發者ID:yanggeng1995,項目名稱:vae_tacotron,代碼行數:6,代碼來源:audio.py

示例7: inv_spectrogram_tensorflow

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def inv_spectrogram_tensorflow(spectrogram):
  '''Builds computational graph to convert spectrogram to waveform using TensorFlow.

  Unlike inv_spectrogram, this does NOT invert the preemphasis. The caller should call
  inv_preemphasis on the output after running the graph.
  '''
  S = _db_to_amp_tensorflow(_denormalize_tensorflow(spectrogram) + hparams.ref_level_db)
  return _griffin_lim_tensorflow(tf.pow(S, hparams.power)) 
開發者ID:yanggeng1995,項目名稱:vae_tacotron,代碼行數:10,代碼來源:audio.py

示例8: melspectrogram

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def melspectrogram(y):
  D = _stft(preemphasis(y))
  S = _amp_to_db(_linear_to_mel(np.abs(D))) - hparams.ref_level_db
  return _normalize(S) 
開發者ID:yanggeng1995,項目名稱:vae_tacotron,代碼行數:6,代碼來源:audio.py

示例9: preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def preemphasis(x):
	return signal.lfilter([1, -hparams.preemphasis], [1], x) 
開發者ID:rishikksh20,項目名稱:vae_tacotron2,代碼行數:4,代碼來源:audio.py

示例10: inv_preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def inv_preemphasis(x):
	return signal.lfilter([1], [1, -hparams.preemphasis], x) 
開發者ID:rishikksh20,項目名稱:vae_tacotron2,代碼行數:4,代碼來源:audio.py

示例11: preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def preemphasis(x):
  return signal.lfilter([1, -hparams.preemphasis], [1], x) 
開發者ID:youssefsharief,項目名稱:arabic-tacotron-tts,代碼行數:4,代碼來源:audio.py

示例12: inv_preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def inv_preemphasis(x):
  return signal.lfilter([1], [1, -hparams.preemphasis], x) 
開發者ID:youssefsharief,項目名稱:arabic-tacotron-tts,代碼行數:4,代碼來源:audio.py

示例13: preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def preemphasis(x):
    from nnmnkwii.preprocessing import preemphasis
    return preemphasis(x, hparams.preemphasis) 
開發者ID:G-Wang,項目名稱:WaveRNN-Pytorch,代碼行數:5,代碼來源:audio.py

示例14: inv_preemphasis

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def inv_preemphasis(x):
    from nnmnkwii.preprocessing import inv_preemphasis
    return inv_preemphasis(x, hparams.preemphasis) 
開發者ID:G-Wang,項目名稱:WaveRNN-Pytorch,代碼行數:5,代碼來源:audio.py

示例15: spectrogram

# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def spectrogram(y):
    D = _lws_processor().stft(preemphasis(y)).T
    S = _amp_to_db(np.abs(D)) - hparams.ref_level_db
    return _normalize(S) 
開發者ID:G-Wang,項目名稱:WaveRNN-Pytorch,代碼行數:6,代碼來源:audio.py


注:本文中的hparams.hparams.preemphasis方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。