Closed pallabs-emerychen closed 11 months ago
Hi,
Many thanks for your detailed report. This part of the code was very challenging to implement because the original paper from Aures' never says anything about how the tones' bandwidth shall be computed. Therefore, I really appreciate the feedback and would be very open to try another approaches if you have any clever ideas. Now, specifically concerning your points:
Indeed the value provided by idxrng2
was not correct. As you mentioned, this was due to the incorrect usage of the index on the find function. I have correct it using your approach and now it seems to work fine.
Very good catch. The use of 6!!! samples around idxrng1
(as in SPL(idxrng1+(-3:3))
, for example) was completelly unnecessary. I have corrected the code based on your suggestion and it works fine now.
As the bandwidth have a pretty relevant influence on the tonality calculation, these two small modifications lead to a slightly smaller tonality value in comparison to the original code. To correct for that, I had to increase the value of the calibration constant in Line 335
from C=1.11
to C=1.125
I have tested the Aures' tonality code with these modifications using the codes from the example
and validations
folders and have verified only a small (almost insignificant) change on the results. Nevertheless, I have not tested using more complex signals.
All the best,
Gil.
Hello,
I've been integrating Aures's tonality algorithm into my program and came across some issues in the current script.
Upper Index Calculation in Tone Finding Algorithm: I noticed that the algorithm for determining a tone's upper index does not match the exact number. When running the example script, the tone index (
idx
) calculates as 161, butidxrng2
turns out to be 164, which seems to be one step higher. The correct value foridxrng2
should be 163, consideringSPL(idx:idx+3) = [60.000, 53.981, -26.509, -35.030]
andhafmax=42.420
. A potential fix could be modifyingSPL(idx:numel(Freq)
toSPL(idx+1:numel(Freq)
in thefind
function for the lower bound, changing it toSPL(1:idx-1)
.Interpolation Procedure for
flow
andfhigh
: The current method for determiningflow
andfhigh
seems to have an issue. For instance, the derived valueflow=1003.6
is incorrect becauseflow
should be lower than the center frequency, which is 1000 in this case. The issue might stem from the SPL array not being sorted, leading to inaccurate results frominterp1
. A simple solution might be to use two samples for linear interpolation: [idxrng1, idxrng1+1] forflow
and [idxrng2-1, idxrng2] forfhigh
.