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

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

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

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

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

    logmag = specgrams[:, :, :, 0]
    p = specgrams[:, :, :, 1]

    mag2 = tf.exp(2.0 * logmag)
    phase_angle = tf.cumsum(p * np.pi, axis=-2)

    l2mel = tf.to_float(self._linear_to_mel_matrix())
    logmelmag2 = self._safe_log(tf.tensordot(mag2, l2mel, 1))
    mel_phase_angle = tf.tensordot(phase_angle, l2mel, 1)
    mel_p = spectral_ops.instantaneous_frequency(mel_phase_angle)

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