(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)
return audio
Inverted Specgram tensorflow op (uses pyfunc).
Inverted Specgram tensorflow op (uses pyfunc).
Inverted Specgram tensorflow op ( uses pyfunc ) .
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):
  """Inverted Specgram tensorflow op (uses pyfunc)."""
  dims = spec.get_shape().as_list()
  # Add back in nyquist frequency
  if pad:
    x = tf.concat([spec, tf.zeros([dims[0], 1, dims[2], dims[3]])], 1)
  else:
    x = spec
  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
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 if pad : x = tf . concat ( [ spec , tf . zeros ( [ dims [ 0 ] , 1 , dims [ 2 ] , dims [ 3 ] ] ) ] , 1 ) else : x = spec 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