Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division by zero in loudness calculation #3815

Closed
dhanvanth-pk-13760 opened this issue Jul 24, 2024 · 0 comments
Closed

Division by zero in loudness calculation #3815

dhanvanth-pk-13760 opened this issue Jul 24, 2024 · 0 comments

Comments

@dhanvanth-pk-13760
Copy link

The following line in the functional method loudness results in nan value when the entire waveform is below the hardcoded loudness threshold value gamma_abs = -70.

# Apply relative gating of the blocks
gated_blocks = torch.logical_and(gated_blocks.squeeze(-2), loudness > gamma_rel.unsqueeze(-1))
gated_blocks = gated_blocks.unsqueeze(-2)
energy_filtered = torch.sum(gated_blocks * energy, dim=-1) / torch.count_nonzero(gated_blocks, dim=-1)

An example case is while trying to find loudness of an ambient sound signal.

The threshold can probably be made configurable with mention in documentation.

@dhanvanth-pk-13760 dhanvanth-pk-13760 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant