From 34531b0c51de36a8ec68759ecdacf3e587c00b8b Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Fri, 25 May 2018 05:39:08 -0700 Subject: [PATCH] change the lower bound of clip operation --- utils/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/audio.py b/utils/audio.py index 3ae62683..9b63d99e 100644 --- a/utils/audio.py +++ b/utils/audio.py @@ -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