-
Notifications
You must be signed in to change notification settings - Fork 77
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
ebur128_true_peak returns 2.12815e-314, incorrect measures overall #126
Comments
Hello, |
Hello and thank you for your reply. Here's the complete function:
|
Should that be: Line 212 in 67b33ab
|
Since I am testing it with a mono signal it didn't make a difference to the readings, but yes - good point, thanks! |
A couple of other questions/comments:
|
Have you tried to use c pointers instead of c++ references for the double args in your code ?
Does it change anything to the results obtained ? |
Thank you very much for your help Brian!
So now that I'm getting some values, the main problem still remains - my readings are quite off. True peak is way above its real value, dynamic range is way too low. Integrated loudness: -21.942 (should be -29.0) I also tried it with EBU test samples. Similar story. seq-3341-9-24bit.wav, for example: I must be doing something wrong... :/ The one that is crucial to get right for my purposes is dynamic range. Once again, thank you very much for your help, I truly appreciate it. |
@audionuma - Thank you very much! I have tried that. It changed something on some files, but not all. My original example still returned identical results. It is a clean sound effects file, well formatted, well recorded and I have checked it thoroughly. TP too high and LRA way off, still. On the EBU test sample seq-3341-9-24bit.wav, it's changed slightly: Here's how I load my audio files, in case I'm messing something up there:
I pass audio_signal, channels and samplerate to my calculateLoudnessMetrics function. Once again, thank you very, very much. |
I do not have any experience with Sndfile. But maybe you should mimic its use from the example program to make sure you are getting the right format. I see the example uses sf_readf_double(). I am not sure what format is returned by wav_sf.read(). https://github.com/jiixyj/libebur128/blob/master/test/minimal-example.c#L60 |
Sndfile can feed the audio as float, double or short. I have tried loading the signal both as float and double. No change. So, true peak and dynamic range are still off. I am developing on an M1 Mac, ARM64, wonder if that could be the issue? |
The true peak level at least looks good! 0.1 corresponds to -20dB, and 0.825834 to -1.6dB. |
Thanks jiixyj, that's great to hear. I have applied 20 * log10 to my true peak readings and they are now spot on. For example, here are the results for seq-3341-13-13-24bit.wav.wav seq-3341-10-1-24bit.wav: I have tried all examples in test.c too - same results... |
With that, do you mean the tests in https://github.com/jiixyj/libebur128/blob/master/test/tests.c#L322, and those tests printed "FAILED"? If so, that indeed points to some bug in the library... |
Yes, I meant I tried running examples in tests.c and results were the same - meaning that true peak, integrated, short were pretty accurate, but loudness range was completely off. But no, they did NOT print "FAILED". I am in no way suggesting this could be a bug in the library. I believe the problem is caused by my implementation. I will run these same tests on my Windows machine to rule out any system specific causes. I don't believe there's a problem with my wav files, since Izotope RX reports loudness very accurately - dynamic sounds are reported with LRA > 10, flat sounds LRA < 10. With libebur128 this is inconsistent. I have some very dynamic files with gunshots, metal rods being hit and door slams with some silent audio events in between and libebur128 reports LRA around 5, just like that of "Neighborhood ambience" or "Motel roomtone background" which are basically constant hums. By contrast, Izotope's meter reports LRA around 25 for the dynamic audio and 5 for ambiences. But occasionally, maybe half of the results are reasonably meaningful, not completely accurate but have fairly obvious clues when audio is dynamic or flat. I wonder if there are any gating settings, or filter, or window size I could tweak? Either way - I must say this - thank you for this library, it's really very cool. And thank you for your precious time. I still have hope I will figure it out eventually. |
I think I've hit the wall with this. Most of the time I get true peak as 2.12815e-314.
Overall, I'm getting incorrect measures - but not consistently. I'm comparing results against another commercial loudness meter from Izotope. I'm loading audio with libsndfile and passing on a std::vector with number of channels and correct samplerate.
For example, here's my output from libebur128
Integrated loudness: -21.942
Short term loudness: -28.8716
True peak level: 2.12815e-314
Dynamic range: 5.80092
By contrast, in Izotope RX I am getting the following (image attached):
Integrated loudness: -29.0
Short term loudness: -25.1
True peak level: -1.6
Dynamic range: 13.7
I know that it's a very dynamic signal but LRA readings from libebur128 suggest otherwise.
I'm initializing ebur128 like this:
ebur128_state* state = ebur128_init(channels, sampleRate, EBUR128_MODE_LRA | EBUR128_MODE_TRUE_PEAK | EBUR128_MODE_S | EBUR128_MODE_I);
And calculating true peak like this:
ebur128_true_peak(state, channels, &peakLevel);
I suspect that because it's having trouble calculating true peak, all the other readings are off as well.
I would very much appreciate any help.
The text was updated successfully, but these errors were encountered: