(self, waves)
return stfts
Convert from waves to complex stfts.

    Args:
      waves: Tensor of the waveform, shape [batch, time, 1].

    Returns:
      stfts: Complex64 tensor of stft, shape [batch, time, freq, 1].
Convert from waves to complex stfts.
Convert from waves to complex stfts .
def waves_to_stfts(self, waves):
    """Convert from waves to complex stfts.

    Args:
      waves: Tensor of the waveform, shape [batch, time, 1].

    Returns:
      stfts: Complex64 tensor of stft, shape [batch, time, freq, 1].
    """
    waves_padded = tf.pad(waves, [[0, 0], [self._pad_l, self._pad_r], [0, 0]])
    stfts = tf.signal.stft(
        waves_padded[:, :, 0],
        frame_length=self._nfft,
        frame_step=self._nhop,
        fft_length=self._nfft,
        pad_end=False)[:, :, :, tf.newaxis]
    stfts = stfts[:, :, 1:] if self._discard_dc else stfts[:, :, :-1]
    stft_shape = stfts.get_shape().as_list()[1:3]
    if tuple(stft_shape) != tuple(self._spec_shape):
      raise ValueError(
          'Spectrogram returned the wrong shape {}, is not the same as the '
          'constructor spec_shape {}.'.format(stft_shape, self._spec_shape))
    return stfts
def waves_to_stfts ( self , waves ) : waves_padded = tf . pad ( waves , [ [ 0 , 0 ] , [ self . _pad_l , self . _pad_r ] , [ 0 , 0 ] ] ) stfts = tf . signal . stft ( waves_padded [ : , : , 0 ] , frame_length = self . _nfft , frame_step = self . _nhop , fft_length = self . _nfft , pad_end = False ) [ : , : , : , tf . newaxis ] stfts = stfts [ : , : , 1 : ] if self . _discard_dc else stfts [ : , : , : - 1 ] stft_shape = stfts . get_shape ( ) . as_list ( ) [ 1 : 3 ] if tuple ( stft_shape ) != tuple ( self . _spec_shape ) : raise ValueError ( 'Spectrogram returned the wrong shape {}, is not the same as the ' 'constructor spec_shape {}.' . format ( stft_shape , self . _spec_shape ) ) return stfts