Skip to content

Commit

Permalink
Revert "Fixing isse AudioCommons#12 where np.log(0) caused a RunTime …
Browse files Browse the repository at this point in the history
…Error"

This reverts commit a1c66e2.
  • Loading branch information
olivecha committed Aug 20, 2021
1 parent a1c66e2 commit b7cace3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
*.pyc
__pycache__/
.idea/*
timbral_models.egg-info/*
.DS_Store
6 changes: 1 addition & 5 deletions timbral_models/Timbral_Warmth.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,7 @@ def timbral_warmth(fname, dev_output=False, phase_correction=False, clip_output=
HF decay
- linear regression of the values above the warmth region
'''
# Sometimes when there are zero values in the spec array (the intensity is null),
# the np.log10 raises a warning.
# Because the log10 is used to reduce the range of the values,
# when a value is zero, zero should be returned :
above_WR_spec = np.array([value if value == 0 else np.log10(value) for value in spec[WR_upper_f_limit_idx:]])
above_WR_spec = np.log10(spec[WR_upper_f_limit_idx:])
above_WR_freq = np.log10(freq[WR_upper_f_limit_idx:])
np.ones_like(above_WR_freq)
metrics = np.array([above_WR_freq, np.ones_like(above_WR_freq)])
Expand Down

0 comments on commit b7cace3

Please sign in to comment.