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

RunTime error when using tnr_ecma_tv #60

Open
tcordaro opened this issue Jan 20, 2023 · 1 comment
Open

RunTime error when using tnr_ecma_tv #60

tcordaro opened this issue Jan 20, 2023 · 1 comment

Comments

@tcordaro
Copy link

Hello,
runMoqito.py.txt
signal.txt

When running tnr_ecma_tv routine with the attached script and signal (runMoqito.py and signal.txt), I got the following issue:
"""
_python3.10/site-packages/mosqito/sq_metrics/tonality/tone_to_noise_ecma/tnr_main_calc.py:188: RuntimeWarning: invalid value encountered in log10
Ln = 10 * np.log10(10 ** (Ltot / 10) - 10 ** (Lt / 10)) + 10 * np.log10(

"""
I have "played" a bit with the code and it seems that the routine is sensitive to the algorithm of peak detection _peak_level.
When I changed the 10dB criterium to 9.75, the exception disappear.
The exception is raised when Lt is larger than Ltot
The issue is machine dependent (some machine do not raise exception)
Thank for your help,
Regards

@wantysal
Copy link
Collaborator

wantysal commented Mar 7, 2023

Hello,

Thanks for noticing this ! Indeed this error is sometimes raised, depending on the input spectrum. Please note that this adjustment of the peak level is not part of the ECMA, it was added to overcome the level approximation due to the spectrum resolution. We'll add a little test to check that Lt<Ltot in the next release, and explore this correction deeper to find a better model.
Feel free to contribute to MOSQITO if you have an idea :)

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

2 participants