| An important distinction needs to be made between floats as a general
calculation vehicle, and floats as the storage format for a soundfile.
In the latter case, values are expected to be normalized, i.e betweeen +1.0 and
-1.0. This makes it effectively equivalent in precision to 24bit fixed-point
ints (e.g as used in Motorola 56K dsps). The 8 bits of the exponent allow for
overflow, but this can quite quickly lead to loss of precision. Problems can
arise for example when adding a very small number to a very large number. You
have a floating point, indeed, but only 24bits of precision. Sonic Foundry, for
example, are careful to describe SoundForge as doing '24bit processing', in
distinction to the use of 32bit ints - which if treated as fractional fixed
point gives you more precision than floats. So programmers cannot in fact
entirely afford to disregard scaling issues, whichever format they are using.
On the 32bit x86 processor, in any event, calculations are typically done in
64bit doubles, where precision is less of a problem (and the fpu in fact uses
80-bit doubles internally).
Richard Dobson
Charles Baker wrote:
>
> Ben Jefferys wrote:
>
> Exactly: only floating point gives you full usage of word, no matterwhat
> the absolute value of the sample:within limits, of course, but
> *practically*
> it gives better results ! Even if we're talking short floats, no longer
> than the
> int formats, the results are often quite noticably better: if only because
> darn few
> of us make sure that all samples input and output are scaled to use all of
> the
> word. And this brings up another advantage of F.P.: when int sounds are
> used,
> one has to be extremely careful in combining them, scaling the input
> samples
> to assure that you don't overflow. This is not a worry with float samples:
>
> they can be combined freely & without concern over the absolute value of
> the result,
> and then scaled/converted into ints to play. CLM and jpff's WinCsound (for
> example) both
> provide this as a way to synthesize your sound, a way many experienced
> composers |