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

Modify code for longer LEQ_PERIOD #2

Open
KianYeo opened this issue Apr 21, 2020 · 1 comment
Open

Modify code for longer LEQ_PERIOD #2

KianYeo opened this issue Apr 21, 2020 · 1 comment

Comments

@KianYeo
Copy link

KianYeo commented Apr 21, 2020

Hi,

The current program calculates and displays the LEQ every 1 second. How can I modify the code to display the LEQ every 5 minutes instead?

If I were to change LED_PERIOD to 300, then SAMPLES_LEQ will become 14,400,000, and the accumulated Leq sum would probably overflow?

I am not familar with calculating LEQ, but I presume I can't just add up the LEQs for every one second and divide it by 300 (after 5 minutes) to get the average LEQ for 5 minutes right?

@ikostoski
Copy link
Owner

Hi @KianYeo, you can't add-and-average Leq values, you would need to integrate them (see: http://www.gracey.co.uk/basics/leq-b1.htm). However, even with large LED_PERIOD values, it is unlikely to overload double-precision floating-point Leq_sum_sqr (max ~1.7e+308)...

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