change the lower bound of clip operation

This commit is contained in:
Eren Golge 2018-05-25 05:39:08 -07:00
parent 65ea7b0afb
commit 34531b0c51
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class AudioProcessor(object):
return librosa.filters.mel(self.sample_rate, n_fft, n_mels=self.num_mels)
def _normalize(self, S):
return np.clip((S - self.min_level_db) / -self.min_level_db, 1e-8, 1)
return np.clip((S - self.min_level_db) / -self.min_level_db, 0, 1)
def _denormalize(self, S):
return (np.clip(S, 0, 1) * -self.min_level_db) + self.min_level_db