On Fri, Aug 28, 2009 at 07:34:20PM +1000, cal wrote:
As in a small DC bias, how small is a "very very
very small constant number"?
I use something like 1e-20f, which is 400dB below normal levels
and unlikely to cause any problem.
The trick is to apply it at the right place. In almost all
cases where denormals turn up it is the result of having
some delay line with feedback, causing values to decay
exponentially when there is no signal. The right place
to insert the DC bias is at the input of the delay line.
A 'delay line' can be as simple as
for ()
{
...
x = x * 0.9f;
...
}
where x is a one-element delay, so this would
become
x = x * 0.9f + 1e-20f;
Ciao,
--
FA
Io lo dico sempre: l'Italia รจ troppo stretta e lunga.