(self)
return padding_l, padding_r
Infer left and right padding for STFT.
Infer left and right padding for STFT.
Infer left and right padding for STFT .
def _get_padding(self):
    """Infer left and right padding for STFT."""
    n_samps_inv = self._nhop * (self._spec_shape[0] - 1) + self._nfft
    if n_samps_inv < self._audio_length:
      raise ValueError('Wrong audio length. Number of ISTFT samples, %d, should'
                       ' be less than audio lengeth %d' % self._audio_length)

    # For Nsynth dataset, we are putting all padding in the front
    # This causes edge effects in the tail
    padding = n_samps_inv - self._audio_length
    padding_l = padding
    padding_r = padding - padding_l
    return padding_l, padding_r
def _get_padding ( self ) : n_samps_inv = self . _nhop * ( self . _spec_shape [ 0 ] - 1 ) + self . _nfft if n_samps_inv < self . _audio_length : raise ValueError ( 'Wrong audio length. Number of ISTFT samples, %d, should' ' be less than audio lengeth %d' % self . _audio_length ) # For Nsynth dataset, we are putting all padding in the front # This causes edge effects in the tail padding = n_samps_inv - self . _audio_length padding_l = padding padding_r = padding - padding_l return padding_l , padding_r