Thread View: comp.dsp
2 messages
2 total messages
Started by Vance Maverick
Tue, 31 Jul 1990 22:20
mu-law encoding
Author: Vance Maverick
Date: Tue, 31 Jul 1990 22:20
Date: Tue, 31 Jul 1990 22:20
10 lines
874 bytes
874 bytes
(I'm sure this has been discussed within recent memory, but apparently not within my own useful memory.) The SPARCstation plays audio data which has been compressed from a 12-bit range to an 8-bit range, using a (presumably) nonlinear mapping for better signal-to-noise ratio at low amplitudes. Where can I find out just what this mapping is? The subject is glossed over lightly in the Sun documentation. Thanks, Vance
Re: mu-law encoding
Author: Chip Rosenthal
Date: Wed, 01 Aug 1990 02:51
Date: Wed, 01 Aug 1990 02:51
65 lines
3337 bytes
3337 bytes
In article <26618@pasteur.Berkeley.EDU>
maverick@fir.berkeley.edu (Vance Maverick) writes:
> The SPARCstation plays audio data which has been compressed from a
>12-bit range to an 8-bit range, using a (presumably) nonlinear mapping
>for better signal-to-noise ratio at low amplitudes. Where can I find
>out just what this mapping is?
A blast from the past...
|From chip Sat Sep 23 02:43:11 CDT 1989
|Newsgroups: comp.dsp
|Subject: Re: converting to/from compressed form
|References: <RUSTY.89Sep21171741@garnet.berkeley.edu>
|
|rusty@garnet.berkeley.edu writes:
|>We have a Sun Sparcstation 1. The chip inside that it uses for D/A and A/D
|>is the AM79C30 Digital Subscriber Controller. [...] I would like to take
|>uncompressed digital sound samples, say generated by a [program], and feed
|>it to this chip.
|>
|>Does anybody have any code or know where I can get my hands on some
|>that would convert "normal" (uncompressed) 16 bit digital audio into
|>the 8 bit u-law (or A-law) compressed form that the AM79C30 uses?
|
| Reference: |Digital Telephony|, John C. Bellamy, John Wiley & Sons,
| 1982, pp. 90-113.
|
|These compression techniques are used in digital telecommunications to
|try to squeeze reasonable sound quality ("toll quality") into 8-bits.
|
|u-Law (that's "mu-law", not "you-law") compression is defined by:
|
| ln( 1 + u*|x| )
| F (x) = sgn(x) * ----------------
| u ln( 1 + u )
|
|where -1 <= x <= +1, and sgn(x) is the sign function.
|
|The compressed value is usually represented as an 8-bit signed magnitude
|number: one sign bit plus seven magnitude bits. In this scheme, the
|most positive number is 0111111, the most negative number is 11111111,
|00000000 is a positive zero, and 1000000 is a negative zero.
|
|The u-Law expansion formula is:
|
| -1 1 |y|
| F (y) = sgn(y) * --- * [ ( 1 + u ) - 1 ]
| u u
|
|In modern telephony, a value of u=255 is used. The first digital
|telecommunication systems (the "D1" channel bank) used u=100, but with
|the introduction of the "D2" channel bank a value of u=255 was selected
|to simplify the conversion process. This value allows Fu(x) to be easily
|approximated by 15 linear segments. This feature is not so important these
|days since it's easy enough to build a conversion lookup table into ROM.
|
|Please see Bellamy for more information on the linear approximation
|technique and details on constructing ROM lookup tables. A-Law companding
|is also discussed there. u-Law is used primarily in the North American
|and Japanese telecommunications networks, while A-Law is used in Europe.
--
Chip Rosenthal | You aren't some icon carved out
chip@chinacat.Unicom.COM | of soap, sent down here to clean
Unicom Systems Development, 512-482-8260 | up my reputation. -John Hiatt
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads