Arpapiemonte/openoise-meter

More Frequent Sampling

Closed this issue · 1 comments

Is there anything preventing us from making the polling frequency user-configurable? I can see how it might be useful to change the interval to 100ms, or 60000ms.

Just wanted to check before forking this and potentially wasting a bunch of time or something


Esiste qualche limitazione tecnica o di progetto che ci impedisce di rendere configurabile dall'utente la frequenza di polling? Considero utile la possibilità di modificare tale intervallo, ad esempio a 100ms o 60000ms, per adattarlo meglio alle diverse esigenze.

Prima di iniziare a lavorare su questa modifica attraverso un fork del progetto, vorrei verificare che non esistano impedimenti tecnici o linee guida del progetto che ne sconsigliano l'implementazione.

Hi,
first of all it's important to understand that there are 2 sample rate:

  1. the FFT (file: audio-cfg.service.ts)
  2. the LAeq (file: audio.service.ts)

1. audio-cfg.service.ts
Here it is defined the FFT sample rate to 44100.
Then it's defined the buffer FFT to 8192.
This means that we have a new raw data from the FFT every 186 ms.

2. audio.service.ts
Here it's defined the LAeq(t) rate (the part of code you checked).
We set the Laeq/t) at 1 sec in order to have 5/6 FFT (see point 1).
To garantee a correct acoustic level, we don't recommend to go down below this value (if you want you can try until 186 ms, but it's better to make some tests).
Sure, you can increase the 1 sec value, but all the app it's prepared to have samples every sec, so changing that value maybe some other stuff will not work, as the plots for example.
So you have to change not only that 1000 value.

Thanks for the issue!