Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to calculate average db level? (Read 21144 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to calculate average db level?

Hello

How I can calculate average db level from audio file?

How to calculate average db level?

Reply #1
dB is a relative, not an absolute measurement - so you have to compare against something else.

However, you can define something to measure relative to. It would help to know your purpose.

For example, Replaygain scanning (e.g. in foobar2000, or format-specific apps like wavgain, mp3gain, etc) measures a good estimate of perceptual loudness. Some interfaces report the loudness figure, while some only report the 'correction' required to adjust the file to the standard level.

What it measures loudness relative to is a pink noise sample used to calibrate loudness to 83 dB SPL (sound pressure level), which has a precise measurable meaning. The target loudness is normally 89 dB SPL. The loudness you achieve depends on your volume control, unless you have fixed it at a level calibrated to this reference.

Other methods use simple non-perceptual RMS measures.
Dynamic – the artist formerly known as DickD

How to calculate average db level?

Reply #2
Hello

How I can calculate average db level from audio file?

You mean amplitude level or RMS power?
If you want to calculate the latter, I would try the formula

rmspow(dB) = 10 * log10 (sqrt (sum(sample^2)/total_samples)/max_sample_value)

It should give you the average RMS power with reference to a full amplitude square wave (maximum achievable power). I'm not totally sure about the formula, though.

How to calculate average db level?

Reply #3
Hello

How I can calculate average db level from audio file?
You mean amplitude level or RMS power?
If you want to calculate the latter, I would try the formula

rmspow(dB) = 10 * log10 (sqrt (sum(sample^2)/total_samples)/max_sample_value)

It should give you the average RMS power with reference to a full amplitude square wave (maximum achievable power). I'm not totally sure about the formula, though.
Or.... rmspow(dB) = 20 * log10 (sum(sample^2/total_samples)/max_sample_value) to save a sqrt operation....
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

How to calculate average db level?

Reply #4
I have DVD with 2 audio tracks, english 5.1 and other language 2.0, and I want to make 5.1 other language track by replacing central channel in 5.1

but when I decode everything to mono WAVs, I found that they (central english channel and downmixed to mono language track) have different volume level, and I need to calculate somehow difference between them

how it will be better to do that?

How to calculate average db level?

Reply #5
I have DVD with 2 audio tracks, english 5.1 and other language 2.0, and I want to make 5.1 other language track by replacing central channel in 5.1

but when I decode everything to mono WAVs, I found that they (central english channel and downmixed to mono language track) have different volume level, and I need to calculate somehow difference between them

how it will be better to do that?

If you need just a software that can measure that... The easiest way I can think of is to use Foobar 2000 player,  right click the track and select replaygain->scan per-track file gain, then right click again and choose properties. There you will see something like this "replaygain_track_gain = +5.35 dB" (the number will, of course, vary). Do this for both the tracks and just subtract the values and you will obtain the gain you need to apply to the other track to achieve comparable loudness.