3294 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 50, NO. 12, DECEMBER 2004 IV. CONCLUSION In this correspondence, we have presented a powerful technique for generation of linear subcodes of turbo codes with better distance spectra than the mother turbo code, building upon and extending the work of Öberg and Siegel in [2]. We have presented the construction of the linear subcodes as an optimization problem conducted via minimization of a cost function closely related to the upper bound on the asymptotic BER of the code. The minimization itself is achieved via injection of known trace bits at the input of the encoder at strategic locations rendering the occurrence of certain error events impossible, and selective puncturing of the code that allows for recovery of the rate loss incurred in the trace-bit injection process. Due to the enormous complexity of the direct minimization itself, a greedy approach is adopted that performs iterative optimization by determining the optimal position of the trace bits at a given step, fol- lowed by determination of the optimal positions of the punctured bits, without any backtracking (i.e., in a greedy mode). Simulation results are provided validating the effectiveness of the approach by improving the distance spectra of several already optimized PCCC codes. REFERENCES [1] F. Daneshgaran and M. Mondin, “Design of interleavers for turbo codes: Iterative interleaver growth algorithms of polynomial complexity,” IEEE Trans. Inform. Theory, vol. 45, Sept. 1999. [2] M. Öberg and P. H. Siegel, “Application of distance spectrum analysis to turbo code performance improvement,” in Proc. 35th Allerton Conf., Urbana-Chamapign, IL, Sept. 1997, pp. 701–710. [3] S. ten Brink, “Code doping for triggering iterative decoding conver- gence,” in Proc. IEEE Int. Symp. Information Theory (ISIT2001), Wash- ington, DC, June 2001, p. 235. [4] D. Divsalar and F. Pollara, “Turbo codes for PCS applications,” in Proc. 1995 IEEE Int. Conf. Communications, Seattle, WA, May 1995, pp. 54–59. [5] F. Daneshgaran and M. Mondin, “Optimized turbo codes for delay constrained applications,” IEEE Trans. Inform. Theory, vol. 48, pp. 293–305, Jan. 2002. Near-Optimal Depth-Constrained Codes Pankaj Gupta, Member, IEEE, Balaji Prabhakar, Member, IEEE, and Stephen Boyd, Fellow, IEEE Abstract—Thisnoteconsidersan -letteralphabetinwhichthe thletter is accessed with probability . The problem is to design efficient algo- rithms for constructing near-optimal, depth-constrained Huffman and al- phabetic codes. We recast the problem as one of determining a probability vector in an appropriate convex set, , so as to min- imize the relative entropy over all . Methods from convex optimization give an explicit solution for in terms of . We show that the Huffman and alphabetic codes so constructed are within 1 and 2 bits of the corresponding optimal depth-constrained codes. Index Terms—Alphabetic codes, prefix lookup, router. I. BACKGROUND AND INTRODUCTION In the standard binary prefix coding problem, one is required to find binary codewords of lengths for the letters, , of an alphabet such that 1) no codeword is a prefix of another codeword, and 2) if the letter occurs with a probability , then the average codeword length is minimized. An optimal prefix code can be constructed by Huffman’s algorithmic procedure [1]. The Huffman procedure constructs a binary tree with the letters of the alphabet at its leaves, and the codeword represents the path from the root node of the tree to the leaf node associated with the letter . The depth of the leaf corresponding to , and hence the length of codeword , is . The depth of the Huffman tree is defined to be the maximum depth of any letter in the tree. The complexity of Huffman’s construction is in both time and space when the prob- abilities are given in sorted order; otherwise, it is in time and in space [2]. If there is an ordering relationship in the alphabet, say if , one is sometimes interested in constructing alphabetic codes. Alphabetic codes are prefix codes with the additional restriction that must appear lexicographically before for . Equally, in the tree corresponding to an alphabetic code, the letters must appear in alphabetic order as leaves of the tree. Hu and Tucker [3] and Garsia and Wachs [4] describe procedures for finding the optimal alphabetic code in time and space. An important variant of the general prefix coding problem is the depth-constrained prefix coding problem—the subject of this corre- spondence. This is the prefix coding problem subject to an additional constraint that the depth of the tree cannot exceed a specified maximum value, say . This problem is useful in many compression and en- coding/decoding applications. For instance, it is generally much easier to design efficient decoders when the codes are restricted to a maximum length (such as the word size of the decoding machine). Manuscript received September 16, 2001; revised July 12, 2004. The work of B. Prabhakar was supported by a Terman Fellowship and an Alfred P. Sloan Fellowship. P. Gupta is with Cypress Semiconductor, Palo Alto, CA 94301 USA (e-mail: pankaj.gupta@cs.stanford.edu). B. Prabhakar and S. Boyd are with the Department of Electrical Engineering and Computer Science, Stanford University, Stanford, CA 94305 USA (e-mail: balaji@stanford.edu; boyd@stanford.edu). Communicated by R. Urbanke, Associate Editor for Coding Techniques. Digital Object Identifier 10.1109/TIT.2004.838345 0018-9448/04$20.00 © 2004 IEEE