Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#15 closed defect (fixed)

Bug in aubio-0.3.2 mathutils.c (silence_detection)

Reported by: Owned by: Paul Brossier
Priority: high Milestone: 0.3.3
Component: corelib Version: 0.3.2
Severity: major Keywords:



I think I found a bug in mathutils.c about the calculation of the RMS power dBs involving lines : 417,418 and 433,434 :

loudness = SQRT(loudness); loudness /= (smpl_t)ibuf->length;

The división by the buffer length should be done before the sqrt :

loudness = SQRT(loudness/(smpl_t)ibuf->length))

I found this bug because I was getting pretty low dBs values, and even using a full-power square wave I was getting levels below 0 dBs

Ah, in addition, this code can be optimized removing the SQRT , and using 10*log10f instead of 20*log10f



Change History (2)

comment:1 Changed 8 years ago by Paul Brossier

Status: newassigned

Hi Eric,

Wow, that's a pretty bad one indeed, thanks for noticing.


comment:2 Changed 8 years ago by Paul Brossier

Resolution: fixed
Status: assignedclosed

closed in 1a74ac3c0d8a

Note: See TracTickets for help on using tickets.