def tf_ispecgram(spec,
n_fft=512,
hop_length=None,
mask=True,
pad=True,
log_mag=True,
re_im=False,
dphase=True,
mag_only=False,
num_iters=1000):
dims = spec.get_shape().as_list()
# Add back in nyquist frequency
x = spec if not pad else tf.concat(
[spec, tf.zeros([dims[0], 1, dims[2], dims[3]])], 1)
audio = tf.py_func(batch_ispecgram, [
x, n_fft, hop_length, mask, log_mag, re_im, dphase, mag_only, num_iters
], tf.float32)
return audio
#---------------------------------------------------
# Summaries
#---------------------------------------------------
评论列表
文章目录