"git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "e3c63f34bc29bcc24cb2c9ca8a49ea1e64024877"
Commit d1825985 authored by Charles J.Y. Yoon's avatar Charles J.Y. Yoon Committed by Vincent QB
Browse files

Simpler amplitude_to_DB (#367)

* Simpler amplitude_to_DB

* flake8
parent 9ab5dd71
...@@ -293,10 +293,7 @@ def amplitude_to_DB(x, multiplier, amin, db_multiplier, top_db=None): ...@@ -293,10 +293,7 @@ def amplitude_to_DB(x, multiplier, amin, db_multiplier, top_db=None):
x_db -= multiplier * db_multiplier x_db -= multiplier * db_multiplier
if top_db is not None: if top_db is not None:
new_x_db_max = torch.tensor( x_db = x_db.clamp(min=x_db.max().item() - top_db)
float(x_db.max()) - top_db, dtype=x_db.dtype, device=x_db.device
)
x_db = torch.max(x_db, new_x_db_max)
return x_db return x_db
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment