KA9Q Viterbi decoder V1.0 Copyright 1995 Phil Karn, KA9Q This package implements an encoder and a Viterbi decoder for the NASA standard rate 1/2 constraint length 7 convolutional code. Also included are support routines to generate metric tables that are optimized for gaussian noise with a specified Eb/N0 ratio, and a test driver that exercises the encoder/decoder routines and keeps statistics. The following files are included: Makefile for BSDI 1.1 README this file genbut.c utility program for generating inline macro calls metrics.c generate soft-decision metrics for AWGN channel sim.c transmitter/channel simulator (including gaussian noise gen) tab.c lookup table for parity generation viterbi.c the encoder and Viterbi decoder routines vittest.c driver program for testing The test program in vittest.c creates a test frame, encodes it, adds gaussian noise and decodes it. It then repeats a specified number of times, keeping count of bit errors and errored frames (frames with at least one error). The files sim.c and metrics.c are also in my Fano decoder package. See the readme for that package for further comments on these two files, including math library performance issues for the gaussian random number generator in sim.c. Unlike a sequential decoder, a Viterbi decoder runs at a constant speed regardless of Eb/N0 ratio. It is also more tolerant of metric table inaccuracies. This decoder runs at about 45.5 kilobits/sec in 32-bit (protected) mode on a 66 MHz 486DX2 using gcc 1.42 and -O under BSDI 1.1. Interestingly, it runs more slowly (about 40.8 kb/s) under GCC 2.5.8, even with full optimization (-O4). Although the code should be portable, it is very heavily optimized for 32-bit machines and will probably perform poorly on machines with smaller words. It's possible to adapt this code for other rates, polynomials and constraint lengths. It would be somewhat tedious, though, since the parameters are hardwired in many places. Phil Karn March 18, 1995