本文整理匯總了Python中hparams.hparams.power方法的典型用法代碼示例。如果您正苦於以下問題:Python hparams.power方法的具體用法?Python hparams.power怎麽用?Python hparams.power使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hparams.hparams
的用法示例。
在下文中一共展示了hparams.power方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: inv_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_spectrogram(spectrogram):
S = _db_to_amp(_denormalize(spectrogram) + hparams.ref_level_db) # Convert back to linear
return _inv_preemphasis(_griffin_lim(S ** hparams.power)) # Reconstruct phase
示例2: _db_to_amp
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def _db_to_amp(x):
return np.power(10.0, x * 0.05)
示例3: inv_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_spectrogram(spectrogram):
S = _db_to_amp(_denormalize(spectrogram) + hparams.ref_level_db) # Convert back to linear
return _inv_preemphasis(spectrogram2wav(S ** hparams.power)) # Reconstruct phase
示例4: inv_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_spectrogram(spectrogram):
'''Converts spectrogram to waveform using librosa'''
S = _db_to_amp(_denormalize(spectrogram) + hparams.ref_level_db) # Convert back to linear
return inv_preemphasis(_griffin_lim(S ** hparams.power)) # Reconstruct phase
示例5: inv_spectrogram_tensorflow
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [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))
示例6: _db_to_amp
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def _db_to_amp(x):
return np.power(10.0, x * 0.05)
示例7: inv_linear_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_linear_spectrogram(linear_spectrogram):
'''Converts linear spectrogram to waveform using librosa'''
if hparams.signal_normalization:
D = _denormalize(linear_spectrogram)
else:
D = linear_spectrogram
S = _db_to_amp(D + hparams.ref_level_db) #Convert back to linear
return _griffin_lim(S ** hparams.power)
示例8: inv_mel_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_mel_spectrogram(mel_spectrogram):
'''Converts mel spectrogram to waveform using librosa'''
if hparams.signal_normalization:
D = _denormalize(mel_spectrogram)
else:
D = mel_spectrogram
S = _mel_to_linear(_db_to_amp(D + hparams.ref_level_db)) # Convert back to linear
return _griffin_lim(S ** hparams.power)
示例9: _db_to_amp
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def _db_to_amp(x):
return np.power(10.0, (x) * 0.05)
示例10: inv_mel_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_mel_spectrogram(mel_spectrogram):
'''Converts mel spectrogram to waveform using librosa'''
if hparams.mel_normalization:
D = _denormalize(mel_spectrogram)
else:
D = mel_spectrogram
S = _mel_to_linear(_db_to_amp(D + hparams.ref_level_db)) # Convert back to linear
return _griffin_lim(S ** hparams.power)
示例11: inv_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_spectrogram(spectrogram):
'''Converts spectrogram to waveform using librosa'''
S = _db_to_amp(_denormalize(spectrogram) + hparams.ref_level_db) # Convert back to linear
processor = _lws_processor()
D = processor.run_lws(S.astype(np.float64).T ** hparams.power)
y = processor.istft(D).astype(np.float32)
return inv_preemphasis(y)
示例12: inv_spectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_spectrogram(spectrogram):
'''Converts spectrogram to waveform using librosa'''
S = _db_to_amp(_denormalize(spectrogram) + hps.ref_level_db) # Convert back to linear
return inv_preemphasis(_griffin_lim(S ** hps.power)) # Reconstruct phase
示例13: inv_melspectrogram
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def inv_melspectrogram(spectrogram):
mel = _db_to_amp(_denormalize(spectrogram) + hps.ref_level_db)
S = _mel_to_linear(mel)
return inv_preemphasis(_griffin_lim(S ** hps.power))
示例14: _db_to_amp
# 需要導入模塊: from hparams import hparams [as 別名]
# 或者: from hparams.hparams import power [as 別名]
def _db_to_amp(x):
return np.power(10.0, x * 0.05)