mirror of https://github.com/MycroftAI/mimic2.git
Remove dead code
parent
faf7b8d083
commit
e61fa839f9
|
@ -111,7 +111,6 @@ def _stft_parameters():
|
|||
# Conversions:
|
||||
|
||||
_mel_basis = None
|
||||
_inv_mel_basis = None
|
||||
|
||||
def _linear_to_mel(spectrogram):
|
||||
global _mel_basis
|
||||
|
@ -119,12 +118,6 @@ def _linear_to_mel(spectrogram):
|
|||
_mel_basis = _build_mel_basis()
|
||||
return np.dot(_mel_basis, spectrogram)
|
||||
|
||||
def _mel_to_linear(mel_spectrogram):
|
||||
global _inv_mel_basis
|
||||
if _inv_mel_basis is None:
|
||||
_inv_mel_basis = np.linalg.pinv(_build_mel_basis())
|
||||
return np.maximum(1e-10, np.dot(_inv_mel_basis, mel_spectrogram))
|
||||
|
||||
def _build_mel_basis():
|
||||
n_fft = (hparams.num_freq - 1) * 2
|
||||
return librosa.filters.mel(hparams.sample_rate, n_fft, n_mels=hparams.num_mels)
|
||||
|
|
Loading…
Reference in New Issue