fix(tracker): peak amplitude dBs should be 20*log10, not 10*log10

This commit is contained in:
5684185+vsariola@users.noreply.github.com 2025-04-27 19:55:25 +03:00
parent 5a3c859a51
commit 845f0119c8

View File

@ -375,12 +375,12 @@ func (d *peakDetector) update(buf sointu.AudioBuffer) (ret PeakResult) {
for i := range d.windows {
d.windows[i][chn].WriteWrapSingle(p)
windowPeak := vek32.Max(d.windows[i][chn].Buffer)
ret[i+int(PeakMomentary)][chn] = Decibel(10 * math.Log10(float64(windowPeak)))
ret[i+int(PeakMomentary)][chn] = Decibel(20 * math.Log10(float64(windowPeak)))
}
if d.maxPower[chn] < p {
d.maxPower[chn] = p
}
ret[int(PeakIntegrated)][chn] = Decibel(10 * math.Log10(float64(d.maxPower[chn])))
ret[int(PeakIntegrated)][chn] = Decibel(20 * math.Log10(float64(d.maxPower[chn])))
}
return
}