(self, melspecgrams)
return tf.concat(
        [logmag[:, :, :, tf.newaxis], p[:, :, :, tf.newaxis]], axis=-1)
Converts melspecgrams to specgrams.

    Args:
      melspecgrams: Tensor of log magnitudes and instantaneous frequencies,
        shape [batch, time, freq, 2], mel scaling of frequencies.

    Returns:
      specgrams: Tensor of log magnitudes and instantaneous frequencies,
        shape [batch, time, freq, 2].
Converts melspecgrams to specgrams.
Converts melspecgrams to specgrams .
def melspecgrams_to_specgrams(self, melspecgrams):
    """Converts melspecgrams to specgrams.

    Args:
      melspecgrams: Tensor of log magnitudes and instantaneous frequencies,
        shape [batch, time, freq, 2], mel scaling of frequencies.

    Returns:
      specgrams: Tensor of log magnitudes and instantaneous frequencies,
        shape [batch, time, freq, 2].
    """
    if self._mel_downscale is None:
      return melspecgrams

    logmelmag2 = melspecgrams[:, :, :, 0]
    mel_p = melspecgrams[:, :, :, 1]

    mel2l = tf.to_float(self._mel_to_linear_matrix())
    mag2 = tf.tensordot(tf.exp(logmelmag2), mel2l, 1)
    logmag = 0.5 * self._safe_log(mag2)
    mel_phase_angle = tf.cumsum(mel_p * np.pi, axis=-2)
    phase_angle = tf.tensordot(mel_phase_angle, mel2l, 1)
    p = spectral_ops.instantaneous_frequency(phase_angle)

    return tf.concat(
        [logmag[:, :, :, tf.newaxis], p[:, :, :, tf.newaxis]], axis=-1)
def melspecgrams_to_specgrams ( self , melspecgrams ) : if self . _mel_downscale is None : return melspecgrams logmelmag2 = melspecgrams [ : , : , : , 0 ] mel_p = melspecgrams [ : , : , : , 1 ] mel2l = tf . to_float ( self . _mel_to_linear_matrix ( ) ) mag2 = tf . tensordot ( tf . exp ( logmelmag2 ) , mel2l , 1 ) logmag = 0.5 * self . _safe_log ( mag2 ) mel_phase_angle = tf . cumsum ( mel_p * np . pi , axis = - 2 ) phase_angle = tf . tensordot ( mel_phase_angle , mel2l , 1 ) p = spectral_ops . instantaneous_frequency ( phase_angle ) return tf . concat ( [ logmag [ : , : , : , tf . newaxis ] , p [ : , : , : , tf . newaxis ] ] , axis = - 1 )