mirror of https://github.com/MycroftAI/mimic2.git
Limit frequencies used in mel spectrogram to [125, 7600].
parent
70ba4aaf69
commit
475ed791bf
|
@ -10,6 +10,8 @@ hparams = tf.contrib.training.HParams(
|
||||||
# Audio:
|
# Audio:
|
||||||
num_mels=80,
|
num_mels=80,
|
||||||
num_freq=1025,
|
num_freq=1025,
|
||||||
|
min_mel_freq=125,
|
||||||
|
max_mel_freq=7600,
|
||||||
sample_rate=20000,
|
sample_rate=20000,
|
||||||
frame_length_ms=50,
|
frame_length_ms=50,
|
||||||
frame_shift_ms=12.5,
|
frame_shift_ms=12.5,
|
||||||
|
|
|
@ -130,7 +130,8 @@ def _linear_to_mel(spectrogram):
|
||||||
|
|
||||||
def _build_mel_basis():
|
def _build_mel_basis():
|
||||||
n_fft = (hparams.num_freq - 1) * 2
|
n_fft = (hparams.num_freq - 1) * 2
|
||||||
return librosa.filters.mel(hparams.sample_rate, n_fft, n_mels=hparams.num_mels)
|
return librosa.filters.mel(hparams.sample_rate, n_fft, n_mels=hparams.num_mels,
|
||||||
|
fmin=hparams.min_mel_freq, fmax=hparams.max_mel_freq)
|
||||||
|
|
||||||
def _amp_to_db(x):
|
def _amp_to_db(x):
|
||||||
return 20 * np.log10(np.maximum(1e-5, x))
|
return 20 * np.log10(np.maximum(1e-5, x))
|
||||||
|
|
Loading…
Reference in New Issue