AN2095 explains how logarithmic signal compression works. Routines are developed and an application is shown to implement a μ-Law compressor that converts an analog voice band signal and produces a digitized 8-bit compressed value. An expanding DAC is also developed that restores the compressed digital value back to an analog value.
Introduction
Virtually all telephony applications are becoming digital. Be it wireless or standard line, digitization of speech for transmission has advantages over traditional analog techniques. μ-Law (pronounced mu law) is a technique of data compression and expansion that allows for a greater dynamic range given the same signal bandwidth. This Application Note explains the logarithmic nature of the human ear’s response. Equations are developed to calculate the signal-to-noise ratio for variable input levels. A PSoC® implementation of a μ-Law compressor and expander (compandor) is developed. A project is included that accomplishes the following:
Digitizes and compresses incoming data to an 8-bit value.
Transmits this data via a RS232 transmitter.
Receives this data via a RS232 receiver.
Expands this data and coverts it back to an analog value.
‘C’ callable companding routines are developed and presented.