def mu_law_decode(output, quantization_channels):
 with tf.name_scope('decode'):
  mu = (quantization_channels - 1)
  casted = tf.cast(output, tf.float32)
  signal = ((2 * (casted / mu)) - 1)
  magnitude = ((1 / mu) * (((1 + mu) ** abs(signal)) - 1))
  return (tf.sign(signal) * magnitude)

def mu_law_decode ( output , quantization_channels ) : with tf . name_scope ( 'decode' ) : mu = ( quantization_channels - 1 ) casted = tf . cast ( output , tf . float32 ) signal = ( ( 2 * ( casted / mu ) ) - 1 ) magnitude = ( ( 1 / mu ) * ( ( ( 1 + mu ) ** abs ( signal ) ) - 1 ) ) return ( tf . sign ( signal ) * magnitude )
recovers waveform from quantized values .