The formula is correct, but I do not know 2700.0, because: Suppose this situation: We have a sound with a depth of 16 bits. This means that we will have available values โโof amplitude 2 ^ 16 ("from two to 16th power") or 65 536 steps. Since the number of steps is divided between positive and negative values โโ(our crests and troughs from the previous one), this means that it is divided into 32,767 positive (plus zero) and 32,768 negative values. Then:
db = 20 * log10(peaks/ 32767);
"2700.0" represents the maximum value of the amplitude of the signals, but I do not know with a bit depth. Best wishes.
source share