III. Coding

A. General

The signal through serial port 0 sampled at 8 kHz will form the 8-bit code consisting of a sign bit in the first bit, the segment in the next three bit, and the final four bits defining the final value in the segment. For Mu-law, the sign bit is 1 for negative values and the byte is negated before transmission. For the two values of the sign bit, this makes 16 segments, but the segments cutting the origin are collinear and counted as 1 and the Mu-law is a 15 segment low because the first positive and the first negative segment count as one.[Mal95] The output characteristics of the Mu-law around zero has a dead zone which requires two
codes (plus and minus zero).
Figure 4. Mu-Law approximation around the Origin and the Encoding Function

B. Data Types and Compiler Limits

The data types of 'C30 C compiler are different from those of regular C compilers. All integer types (char, short, int, long, and their unsigned counterparts) are equivalent types and are represented as 32-bit binary values and those signed types are represented in 2s-complement notation. The comparisons of the data types are shown as below.
Table 1. Data Type Comparison
Due to the variety of host systems supported by the 'C30 compiler and the limitations of some of these systems, the compiler may not be able to successfully compile source files that are excessively large or complex. Most of these conditions occur during the first compilation pass(parsing). When such a condition occurs, the parser issues a code-I diagnostic message indicating the condition that caused the failure; usually the message also specifies the maximum value for whatever limit has been exceeded. The code generator also has compilation limits but fewer than the parser.[Cmp95]
In general, exceeding any compiler limit prevents continued compilation, so the compiler aborts immediately after printing the error message. The only way to avoid exceeding a compiler limit is to simplify the program or parse and preprocess in separate steps. [Cmp95]
 
Table 2. Absolute Compiler Limits[Cmp95]

C. Coding

The C code Mu-Law Compander is coded under the consideration of special characteristics of data types and limitation of 'C30 compiler.

*If you would like to obtain a copy of C code compander, please e-mail me leejinyo@pilot.msu.edu

Previous Page Next Page