Closed fchirono closed 9 months ago
Hi all,
I changed the validation script hearing_model_validation
to clarify some of the calculations, and added functions that calculate the time-dependent loudness N(l)
and the single-value loudness N
as per Eqs. 116 and 117 of the ECMA-418-2, 2nd Ed (2022). The standard specifies a power average (and not the usual np.mean
operator) to obtain the single-value loudness, and a missing factor of delta_z = 0.5
was added in the integration of the specific loudness over all critical bands.
The new figure looks like this - on the left is the older version, right is the new version. Note the "kinks" present in the initial pull request are now gone:
Hello,
Thank you for your PR, we really appreciate the documentation and validation work you've done to ease the merge process ! It's very pleasant to review :) I just started to look at your code, there may be a few changes needed to fit with the rest of mosqito but your results seem great.
Tks, Salomé
Hi Salomé, thank you for your kind reply; happy to contribute to this excellent package :) Please let me know if there is anything I can help with the review process.
Hi Fabio,
If you agree, I'd like to merge your PR in a specific branch where I'll make some little changes to stick to mosqito formalism. Nothing about the calculation, just a few adjustements of form.
By the way, if you are interested about Sottek hearing model, please note that I am currently implementing the roughness model here: _https://github.com/wantysal/MoSQITooo/tree/roughness_ecma_ Any help on that would be trully appreciated :)
Salomé
Hi Salomé,
Yes absolutely, please go ahead with the merge!
I actually also have an implementation of Roughness ECMA-418-2 (2nd Ed, 2022) that I am planning to submit soon, but the results are way off the target values proposed by Fastl & Zwicker in "Psychoacoustics" and I don't know why! I checked the entire code multiple times over, but can't find where it's going wrong :( I'd be happy to join forces and see what we can find! What do you think is the best way to do that?
Here's one example from my validation plots:
Hey,
The values I get with my implementation are also quite far from the expected results... I don't know what is the best way to work together on this but I suggest that we both compare our own implementation with the other one's, and maybe this way we'll identify some critical points... We can create an issue on each other forks to discuss about it along the way !
Salomé
Hi Salomé,
I added you as a collaborator on my fork, and created a new issue showing some Roughness validation results. The code has a bunch of intermediate plots within the functions that are currently commented off, but can be used when debugging the code with some test data.
I'll browse through your implementation too and see if I notice any discrepancies. If you don't have a validation script in yours yet, feel free to copy mine - I think it should be very straightforward to add it to yours.
Fabio
Hi all, I have updated the
loudness_ecma
function to the 2nd Edition of the ECMA-418-2 standard, from 2022. The 2nd Edition includes mostly minor changes, such as a few slightly different coefficients, and I have corrected references within the MoSQITo functions to equations and section numbers to match those of the 2nd Edition.There are a few larger changes in the main
loudness_ecma
function: per Sec. 5.1.2, there are now a windowing function at the start of the signal and zero padding at the start and end of the signal. The new segmentation equations in the 2nd Ed required some code restructuring: the previous file_rectified_band_pass_signals
has been removed, and its content is now split between two new files (_band_pass_signals
and_ecma_time_segmentation
), and the rectification is performed within theloudness_ecma
function itself.Regarding tests and validations:
The script
test_loudness_ecma
currently does NOT pass: the 1 kHz and 5 kHz tones have loudness values of 15.65... and 15.78... with the new calculations, so they are not equal to 7 decimal places. I'm not sure if this is a bug in the code, or if the test was ad-hoc and is not applicable to this new version for some reason. Does anyone has any light on this?In the script
valid_ear_filter_design
, the MoSQITo ear filter now matches the ECMA filter response slightly closer than before. On the left is the older version, right is the new version.hearing_model_validation
, the hearing model curves are very similarly to the older version, although there are a few kinks at low frequencies that appear to be bugs. I'll look into them during the next few days. On the left is the older version, right is the new version:valid_gammatone
, there are now only two curves plotted instead of three - the 2nd edition changed the complex exponential sign in the band pass filters to positive in what is now Section 5.1.4 (Eqs. 16 and 17), so I removed the old curve with the negative sign (that existed in the 1st edition of the standard). On the left is the older version, right is the new version: