I have a question about crossover distortion. It is mentionned in the dist10 decoder in the last step of the decoding, when the time domain samples are converted to PCM :
CODE
/* Casting truncates towards zero for both positive and negative numbers,
the result is cross-over distortion, 1995-07-12 shn */
if (time_sample > 0) {
foo = (long) (time_sample * (double)SCALE+ (double)0.5);
}
else {
foo = (long) (time_sample * (double)SCALE - (double)0.5);
}
if (foo >= (long) SCALE) {
pcm = (short)(SCALE-1);
}
else if (foo < (long) -SCALE) {
pcm = (short)(-SCALE);
}
else
pcm =(short)foo;
SCALE is equal to 32768.
What is crossover distortion exactly ? Does the addition of +/- 0.5 make a noticeable difference in the final result ?