Python hparams.hparams.preemphasis() Examples

The following are 30 code examples of hparams.hparams.preemphasis(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module hparams.hparams , or try the search function .
Example #1
Source File: audio.py    From gmvae_tacotron with MIT License 5 votes vote down vote up
def preemphasis(x):
	return signal.lfilter([1, -hparams.preemphasis], [1], x) 
Example #2
Source File: audio.py    From tacotron with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
  return scipy.signal.lfilter([1], [1, -hparams.preemphasis], x) 
Example #3
Source File: audio.py    From tacotron with MIT License 5 votes vote down vote up
def spectrogram(y):
  D = _stft(preemphasis(y))
  S = _amp_to_db(np.abs(D)) - hparams.ref_level_db
  return _normalize(S) 
Example #4
Source File: audio.py    From tacotron with MIT License 5 votes vote down vote up
def inv_spectrogram_tensorflow(spectrogram):
  '''Builds computational graph to convert spectrogram to waveform using TensorFlow.

  Unlike inv_spectrogram, this does NOT invert the preemphasis. The caller should call
  inv_preemphasis on the output after running the graph.
  '''
  S = _db_to_amp_tensorflow(_denormalize_tensorflow(spectrogram) + hparams.ref_level_db)
  return _griffin_lim_tensorflow(tf.pow(S, hparams.power)) 
Example #5
Source File: audio.py    From tacotron with MIT License 5 votes vote down vote up
def melspectrogram(y):
  D = _stft(preemphasis(y))
  S = _amp_to_db(_linear_to_mel(np.abs(D))) - hparams.ref_level_db
  return _normalize(S) 
Example #6
Source File: audio.py    From WaveRNN-Pytorch with MIT License 5 votes vote down vote up
def preemphasis(x):
    from nnmnkwii.preprocessing import preemphasis
    return preemphasis(x, hparams.preemphasis) 
Example #7
Source File: audio.py    From WaveRNN-Pytorch with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
    from nnmnkwii.preprocessing import inv_preemphasis
    return inv_preemphasis(x, hparams.preemphasis) 
Example #8
Source File: audio.py    From WaveRNN-Pytorch with MIT License 5 votes vote down vote up
def spectrogram(y):
    D = _lws_processor().stft(preemphasis(y)).T
    S = _amp_to_db(np.abs(D)) - hparams.ref_level_db
    return _normalize(S) 
Example #9
Source File: audio.py    From WaveRNN-Pytorch with MIT License 5 votes vote down vote up
def melspectrogram(y):
    D = _lws_processor().stft(preemphasis(y)).T
    S = _amp_to_db(_linear_to_mel(np.abs(D))) - hparams.ref_level_db
    if not hparams.allow_clipping_in_normalization:
        assert S.max() <= 0 and S.min() - hparams.min_level_db >= 0
    return _normalize(S) 
Example #10
Source File: audio.py    From tacotron with MIT License 5 votes vote down vote up
def preemphasis(x):
  return scipy.signal.lfilter([1, -hparams.preemphasis], [1], x) 
Example #11
Source File: audio.py    From gmvae_tacotron with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
	return signal.lfilter([1], [1, -hparams.preemphasis], x) 
Example #12
Source File: audio.py    From gmvae_tacotron with MIT License 5 votes vote down vote up
def preemphasis(x):
	return signal.lfilter([1, -hparams.preemphasis], [1], x) 
Example #13
Source File: audio.py    From gmvae_tacotron with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
	return signal.lfilter([1], [1, -hparams.preemphasis], x) 
Example #14
Source File: audio.py    From Tacotron2-PyTorch with MIT License 5 votes vote down vote up
def preemphasis(x):
	return scipy.signal.lfilter([1, -hps.preemphasis], [1], x) 
Example #15
Source File: audio.py    From Tacotron2-PyTorch with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
	return scipy.signal.lfilter([1], [1, -hps.preemphasis], x) 
Example #16
Source File: audio.py    From Tacotron2-PyTorch with MIT License 5 votes vote down vote up
def spectrogram(y):
	D = _stft(preemphasis(y))
	S = _amp_to_db(np.abs(D)) - hps.ref_level_db
	return _normalize(S) 
Example #17
Source File: audio.py    From Tacotron2-PyTorch with MIT License 5 votes vote down vote up
def melspectrogram(y):
	D = _stft(preemphasis(y))
	S = _amp_to_db(_linear_to_mel(np.abs(D))) - hps.ref_level_db
	return _normalize(S) 
Example #18
Source File: audio.py    From vae_tacotron2 with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
	return signal.lfilter([1], [1, -hparams.preemphasis], x) 
Example #19
Source File: audio.py    From Griffin_lim with MIT License 5 votes vote down vote up
def _inv_preemphasis(x):
    return signal.lfilter([1], [1, -hparams.preemphasis], x) 
Example #20
Source File: griffin_lim.py    From Griffin_lim with MIT License 5 votes vote down vote up
def _inv_preemphasis(x):
    N = tf.shape(x)[0]
    i = tf.constant(0)
    W = tf.zeros(shape=tf.shape(x), dtype=tf.float32)

    def condition(i, y):
        return tf.less(i, N)

    def body(i, y):
        tmp = tf.slice(x, [0], [i + 1])
        tmp = tf.concat([tf.zeros([N - i - 1]), tmp], -1)
        y = hparams.preemphasis * y + tmp
        i = tf.add(i, 1)
        return [i, y]

    final = tf.while_loop(condition, body, [i, W])

    y = final[1]

    return y 
Example #21
Source File: audio.py    From vae_tacotron with MIT License 5 votes vote down vote up
def preemphasis(x):
  return scipy.signal.lfilter([1, -hparams.preemphasis], [1], x) 
Example #22
Source File: audio.py    From vae_tacotron with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
  return scipy.signal.lfilter([1], [1, -hparams.preemphasis], x) 
Example #23
Source File: audio.py    From vae_tacotron with MIT License 5 votes vote down vote up
def spectrogram(y):
  D = _stft(preemphasis(y))
  S = _amp_to_db(np.abs(D)) - hparams.ref_level_db
  return _normalize(S) 
Example #24
Source File: audio.py    From vae_tacotron with MIT License 5 votes vote down vote up
def inv_spectrogram_tensorflow(spectrogram):
  '''Builds computational graph to convert spectrogram to waveform using TensorFlow.

  Unlike inv_spectrogram, this does NOT invert the preemphasis. The caller should call
  inv_preemphasis on the output after running the graph.
  '''
  S = _db_to_amp_tensorflow(_denormalize_tensorflow(spectrogram) + hparams.ref_level_db)
  return _griffin_lim_tensorflow(tf.pow(S, hparams.power)) 
Example #25
Source File: audio.py    From vae_tacotron with MIT License 5 votes vote down vote up
def melspectrogram(y):
  D = _stft(preemphasis(y))
  S = _amp_to_db(_linear_to_mel(np.abs(D))) - hparams.ref_level_db
  return _normalize(S) 
Example #26
Source File: audio.py    From vae_tacotron2 with MIT License 5 votes vote down vote up
def preemphasis(x):
	return signal.lfilter([1, -hparams.preemphasis], [1], x) 
Example #27
Source File: audio.py    From Griffin_lim with MIT License 5 votes vote down vote up
def _preemphasis(x):
    return signal.lfilter([1, -hparams.preemphasis], [1], x) 
Example #28
Source File: audio.py    From vae_tacotron2 with MIT License 5 votes vote down vote up
def preemphasis(x):
	return signal.lfilter([1, -hparams.preemphasis], [1], x) 
Example #29
Source File: audio.py    From vae_tacotron2 with MIT License 5 votes vote down vote up
def inv_preemphasis(x):
	return signal.lfilter([1], [1, -hparams.preemphasis], x) 
Example #30
Source File: audio.py    From arabic-tacotron-tts with MIT License 5 votes vote down vote up
def preemphasis(x):
  return signal.lfilter([1, -hparams.preemphasis], [1], x)