[sdiy] Harmonic bandwidth
ChristianH
chris at chrismusic.de
Wed Jan 9 17:29:22 CET 2008
On Wed, 9 Jan 2008 15:44:36 -0000 "Jason Tribbeck" <Jason.Tribbeck at argogroup.com> wrote:
> Floating point (effectively) depends on how many digits are being used,
> accuraccy decreases the higher the number of decimal places you're
> calculating.
>
> I'll simplify it a bit, by assuming there's 4 digits.
>
> pi = 3.142
>
> 2pi = 6.284
>
> 200pi = 628.4 - so if you're now trying to get to a multiple of 2pi:
>
> 200pi / 2pi = 628.4 / 006.3 [you need to get them into the same digit
> range]
>
> => 99.75
>
> Which isn't what you are expecting.
>
> Double precision floating point is accurate to about 16 digits, so
> hopefully that'll give you an idea as to what you can expect.
>
> Note: It isn't quite like this, but I think it's easier to explain. Feel
> free to correct :)
Um, that's not quite right.
> 200pi / 2pi = 628.4 / 006.3 [you need to get them into the same digit
> range]
200pi = 6.284e2, 2pi = 6.284e0, which is used in full precision on
dividing. Thus the result will be (6.284/6.284)e(2-0) = 1.000e2 = 100.
However, if you choose 200pi-199pi - voila, that's what you meant :-)
Floating add/sub need to adjust mantissa for same exponent values,
that's where limited precision bites you.
And BTW, pi=3 (for small values of pi and large values of 3)...
Christian
More information about the Synth-diy
mailing list