[LAD] Floating point Denormals: C++ and Waf
tim at quitte.de
Fri Aug 3 00:04:28 UTC 2012
[Harry van Haaren]
>Thanks all for the replies, I've certainly learnt a lot.
>On Thu, Aug 2, 2012 at 9:11 PM, Tim Goetze <tim at quitte.de> wrote:
>> I think it's almost always a better idea to add an inaudible DC offset
>> or a square wave at the block interval or at Nyquist
>How small is inaudible? Or better yet, how small is way beyond inaudible,
>but enough to eliminate any denormals?
Some useful numeric suggestions have already been made, and the why
amounts to this:
"""The minimum positive normal value [of a 32-bit float] is 2−126 ≈
1.18 × 10−38"""
1.0f corresponding to 0dB makes 1.18e-38 equivalent to around -758dB.
Roughly speaking, 16 bit samples cover around 90 dB (1./(1<<15)), 24
bits give you 138 dB (1./(1<<23)).
For all intents and purposes involving current digital audio hardware
and human beings at their current point of hearing evolution, anything
past that is surely perfectly inaudible, so a sensible approach is to
choose any amplitude between this and the above mentioned smallest
normal float for your injected "normalising" signal, keeping in mind
subsequent amplification factors in your signal path, and that
amplitudes can decrease quickly in IIR filters, especially when you
stack them (one feeding the next).
More information about the Linux-audio-dev