[chuck-users] dithering with chuck

Kassen signal.automatique at gmail.com
Sun Dec 10 18:43:49 EST 2006


Adam;

There is another complication. Floating point numbers aren't stored
> the same way that integers are, they are stored as a mantissa and
> exponent. This technique also combats the precision problem. What
> will happen is that the mantissa will stay the same and you are just
> twiddling the exponent bits. No loss of precision. You could
> definitely do this demonstration in chuck, and it is excellent, but I
> think we will have to hear from Ge, Spencer or Perry about exactly
> how much you will need to turn the gain down in order to achieve the
> desired effect.



Yes, I think that explains what is observed. As I understand floating point
we could force (some) data degradation by amplifying the signal by some
ratio that can't be expressed exactly in the exponent, forcing adjustment in
the data itself. Floating point does have rounding errors but I seem to
remember those tend to show up in particular when very large numbers and
very small ones are confronted with eachother.

A more practical way of demonstrating dithering might be to have some
generated piece and record it (in ChucK) to a wave file at a low gain in
order to leave headroom in case several elements decide to be loud at the
same time. This data would be written to a fixed point file (since ChucK
doesn't support floating point formats yet) After this ChucK might be used
again to increase the amplitude to make the loudest part close to 0db at
which point dithering would be usefull? If we are after a demonstration that
might count as a fairly realistic real-world scenario, I could imagine
somebody wanting to publish a algorithmic piece without clipping that would
be made and processed entirely in pure ChucK. Personally I tend to be in
favour of real-world scenarios for demonstrations but this isn't my
experiment so maybe this isn't relevant at all.

Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20061211/7558bbd5/attachment.htm 


More information about the chuck-users mailing list