#15 closed defect (fixed)
Bug in aubio-0.3.2 mathutils.c (silence_detection)
Reported by: | epalace@gmail.com | Owned by: | Paul Brossier |
---|---|---|---|
Priority: | high | Milestone: | 0.3.3 |
Component: | corelib | Version: | 0.3.2 |
Severity: | major | Keywords: | |
Cc: |
Description
Hi,
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
Regards,
Eric.
Change History (2)
comment:1 Changed 14 years ago by
Status: | new → assigned |
---|
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
closed in 1a74ac3c0d8a
Note: See
TracTickets for help on using
tickets.
Hi Eric,
Wow, that's a pretty bad one indeed, thanks for noticing.
Paul