Skip to content

Commit 3ee1560

Browse files
authored
Merge pull request #46 from r9y9/fix-log-compresssion
Rollback to previous log compression
2 parents 6f0495e + 4d55efc commit 3ee1560

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

audio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ def _build_mel_basis():
7777

7878

7979
def _amp_to_db(x):
80-
return 20 * np.log10(x + 0.01)
80+
min_level = np.exp(hparams.min_level_db / 20 * np.log(10))
81+
return 20 * np.log10(np.maximum(min_level, x))
8182

8283

8384
def _db_to_amp(x):
84-
return np.maximum(np.power(10.0, x * 0.05) - 0.01, 0.0)
85+
return np.power(10.0, x * 0.05)
8586

8687

8788
def _normalize(S):

0 commit comments

Comments
 (0)