[comp.dcom.telecom] Mu-Law Encoding/Decoding

scott%audiofax.com@mathcs.emory.edu (Scott Lee) (02/06/90)

I need to fiddle with some u-Law encoded numbers (12-bit, 8000/sec,
encoded into 8-bit). This is supposed to be standard phone company
stuff. I have a couple of FINE, FINE references that describe the
stuff and promptly give examples that have the sign switched from each
other. Could someone please give me some examples (and tell me which
sign value is correct for positive values after they are encoded). I
just want to write a program that generates the lookup tables and I'd
like to get it correct to avoid any distortion.  Also, if you happen
to be in "that sort of mood," could you drop some stuff on A-law,
also?


Thanks,

Jeff Lee				AudioFAX, Inc.	/ Suite 220
jeff@audiofax.com			2000 Powers Ferry Rd.
emory!audfax!jeff			Marietta, GA. 30067

chip@chinacat.lonestar.org (Chip Rosenthal) (02/08/90)

In article <3540@accuvax.nwu.edu> scott@audiofax.com writes:
>X-Telecom-Digest: Volume 10, Issue 77, message 2 of 5

>I need to fiddle with some u-Law encoded numbers [...]  I have a couple of
>FINE, FINE references that describe the stuff and promptly give examples that
>have the sign switched from each other.

I think I know what the confusion might be over.  In the theoretical
mu-law companding system, there is an inversion at the very end.
Therefore, in the encoding sequence, you use 0 for positive and 1 for
negative, but just before transmission you invert the whole thing.
For example, the maximum positive value will be encoded as 0111 1111.
After inversion this becomes 1000 0000.  If you are generating digital
data to pump into a codec/filter combo (or similar) circuit, then you
would want to perform the inversion and make sure the MSB ends up 1
for positive and 0 for negative values.

A-law gets even wierder, because you invert every other bit.

Personally, my favorite reference is |Digital Telephony| by Bellamy.
However, if you want the nuts-n-bolts, I suggest you get a databook
from somebody who makes codec's and take a gander at that.  I happen
to have National Semiconductor and Motorola books on my shelf, but
there are a gadzillion other folks who make them as well.
 

Chip Rosenthal                            |  Yes, you're a happy man and you're
chip@chinacat.Lonestar.ORG                |  a lucky man, but are you a smart
Unicom Systems Development, 512-482-8260  |  man?  -David Bromberg