KA9Q Viterbi decoder V1.1 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 when compiled with gcc version 2.6.3 and the -O4 flag runs at about 74 kilobits/sec in 32-bit (protected) mode on a AMD 486DX4-100 under BSDI 2.0. The same executable runs at about 116kb/s on a 90Mhz Pentium. 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 (version 1.0) August 5, 1995 (version 1.1) Changes for version 1.1: improved butterfly performance (thanks to N6NKF) fixed bug in computation of esn0; changed calling convention to gen_met()