本文整理匯總了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
示例2: _preemphasis
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def _preemphasis(x):
return signal.lfilter([1, -hparams.preemphasis], [1], x)
示例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)
示例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)
示例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)
示例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)
示例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))
示例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)
示例9: preemphasis
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def preemphasis(x):
return signal.lfilter([1, -hparams.preemphasis], [1], x)
示例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)
示例11: preemphasis
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import preemphasis [as 別名]
def preemphasis(x):
return signal.lfilter([1, -hparams.preemphasis], [1], x)
示例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)
示例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)
示例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)
示例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)