Newsgroups: comp.speech
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!msunews!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!fortis!andrewh
From: andrewh@fortis.speech.su.oz.au (Andrew Hunt)
Subject: error in linear2ulaw routine in comp.speech FAQ
Message-ID: <D0ty0v.M84@ucc.su.OZ.AU>
Sender: andrewh@fortis (Andrew Hunt)
Nntp-Posting-Host: fortis.speech.su.oz.au
Organization: Speech Technology Group, Sydney Uni
Date: Thu, 15 Dec 1994 02:10:06 GMT
Lines: 38


I have just been notified of an important error in the linear2ulaw()
conversion code in Section 2.7 of the comp.speech FAQ posting.  In the
process of converting to HTML (WWW) format, several greater-than > 
signs were accidentally converted to less-than < signs.  Thus the
following code in the current FAQ is incorrect

  INCORRECT

  sign = (sample << 8) & 0x80;          /* set aside the sign */
  if(sign != 0) sample = -sample;               /* get magnitude */
  if(sample < CLIP) sample = CLIP;  


and should read as follows.

  CORRECT

  sign = (sample >> 8) & 0x80;          /* set aside the sign */
  if(sign != 0) sample = -sample;               /* get magnitude */
  if(sample > CLIP) sample = CLIP;              /* clip the magnitude */


I have corrected the error on the WWW site and uploaded a new version
to the RTFM server at MIT.  I will also force another release of the 
FAQ even though it's only a few days since the last release.

If you have used the linear2ulaw code from the FAQ or WWW site in the 
last few months, then you should check for this error.

Many thanks to Marc Zissman for pointing out the error.


Andrew Hunt
  ---
Speech Technology Research Group		Ph:  61-2-351 4509
Dept. of Electrical Engineering			Fax: 61-2-351 3847
University of Sydney, NSW, 2006, Australia	email: andrewh@speech.su.oz.au
