float to int conversions

Roberta Eklund eklund at best.com
Wed Jun 10 14:33:44 EDT 1998

hmmm.....one can emulate convergent roundin...or round to even and
no bias....or distortion....in the case of a filter design.
Motorola 56k has this feature....
it's basically look at the next least significant bit past where you are
rounding....if even, truncate, if odd, set to zero....this is binary
notation. that I'm referring to.

On Wed, 10 Jun 1998 chris_perkins at ycrdi.com wrote:

> Richard Dobson writes:
> >>Yes, it's fast, but it does not work correctly for negative numbers - to
> comply
> >>with expected C semantics, the int cast must truncate positive numbers
> >>downwards, and negative numbers upwards, so that -0.5 truncates to 0.0.
> Truncating toward zero may be good C, but I have doubts of it being good DSP.
> If you are not doing rounding, then truncation should all be biased in the
> same direction: downwards or upwards.  If you truncate toward zero you are
> introducing a zero crossing non-linearity in addition to the quantization
> non-linearities, but the zero crossing non-linearity cannot be corrected with
> dither.
> ---
> Christopher J. Perkins  | The opinions expressed in this message
> DSP Software Engineer   | are my own and do not necessarily reflect
> Young Chang R & D Inst. | official policy of Young Chang Co., Ltd.

More information about the music-dsp mailing list