HoerTech-gGmbH / openMHA

The open Master Hearing Aid (openMHA)
http://www.openmha.org
GNU Affero General Public License v3.0
252 stars 74 forks source link

Sound energy estimation #23

Closed Kyle2048 closed 5 years ago

Kyle2048 commented 5 years ago

Hi

I am someone interested in acoustic algorithm. When I tracked the OpenMHA source code for dc.cpp (dynamic compression), I saw the energy estimation as follows 2019-02-19 11 33 34 I can understand that in addition to DC bin and Nyquist bin, other bins need to be multiplied by 2. But according to Parseveal's theorem, I think DC bin and Nyquist bin should be multiplied by 1. Can you tell why you decided to multiply by 0.5 for energy estimation?

best regards

tobiasherzke commented 5 years ago

You are correct, the 0.5 factor is an error. This will be corrected in the next release.

tobiasherzke commented 5 years ago

This has been corrected in openMHA release 4.9.0.

The effect of the error should be negligible for typical configurations and signals. E.g. we had to adjust our expected output level in mha/mhatest/test_runexample01a.m by 0.06 dB to account for the correction.

Kyle2048 commented 5 years ago

That's a good news for me. Thanks for your answer.