📄 viterbi-readme.txt
字号:
KA9Q Viterbi decoder V3.0Copyright 1999 Phil Karn, KA9QMay be used under the terms of the GNU Public LicenseThis package provides encoders and fast Viterbi decoders for the NASAstandard rate 1/2 and rate 1/3 constraint length 7 convolutional codes.Two versions of these encoder and decoder are provided, one forblocked data (with user specified initial and terminal encoder states)and another for continuous streams. The former is a C subroutine, thelatter runs as a UNIX pipeline filter, closely emulating commerciallyavailable hardware Viterbi decoders.Another encoder and Viterbi decoder is also provided for an arbitraryblocked convolutional code. This version attains generality at theexpense of performance. It has been tested with the Mars Pathfinderr=1/6 K=15 code. It's slow, but it works. (389 bps on a 166MHzUltrasparc, 655 bps on a 400 MHz Pentium-II.) Of course, it's *much*faster on shorter codes, though it's not as fast on the k=7 codes asthe decoders optimized for them.An experimental Perl script is also provided that generates aoptimized blocked encoder and Viterbi decoder in C for an arbitraryconvolutional code. As this script uses agressive loop unrolling, itshould not be used for large constraint lengths.Also included are support routines to generate metric tables that areoptimized for gaussian noise with a specified Eb/N0 ratio, and a testdriver that exercises the encoder/decoder routines and keeps statistics.The following files are included:Makefile README this fileviterbi27.h header file for rate 1/2 K=7 codeviterbi37.h header file for rate 1/3 K=7 codeencode27.c stream encoder for rate 1/2 K=7 codeencode37.c stream encoder for rate 1/3 K=7 codevitfilt27.c stream decoder for rate 1/2 K=7 codevitfilt37.c stream decoder for rate 1/3 K=7 codeviterbi27.c block encoder/decoder for rate 1/2 K=7 codeviterbi37.c block encoder/decoder for rate 1/3 K=7 codeviterbi.c block encoder/decoder for arbitrary codegenviterbi.pl perl script for generating encoder/decodersvittest.c driver program for testing the subroutine versionsmetrics.c generate soft-decision metrics for AWGN channelsim.c transmitter/channel simulator (including gaussian noise gen)tab.c lookup table for parity generationThe stream mode encoder and decoder may be demonstrated as follows:$ encode27 < input_file | vitfilt27 (rate 1/2 code)$ encode37 < input_file | vitfilt37 (rate 1/3 code)The test program in vittest.c creates a test frame, encodes it, addsgaussian noise and decodes it with the blocked version of the Viterbidecoder. It then repeats a specified number of times, keeping count ofbit errors and errored frames (frames with at least one error).The files sim.c and metrics.c are also in my Fano decoder package. Seethe readme for that package for further comments on these two files,including math library performance issues for the gaussian randomnumber generator in sim.c.Unlike a sequential decoder, a Viterbi decoder runs at a constantspeed regardless of Eb/N0 ratio. It is also more tolerant of metrictable inaccuracies.The blocked version of the k=7 r=1/2 decoder when compiled with gccversion 2.7.2.3 and the -O9 flag runs at about 757 kilobits/sec on a400 MHz Pentium-II under Linux 2.2.7. Although the code should beportable, it is very heavily optimized for 32-bit machines and willprobably perform poorly on machines with smaller words.Phil KarnMarch 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()October 17, 1996 (version 2.0)Changes for version 2.0: Switched decoder from register exchange mode to traceback mode Continued performance tuning (about 50% faster than version 1.1) Added stream-mode decoder as alternative to existing packet-mode decoderOctober 27, 1997 (version 2.1)Changes for version 2.1: Added rate 1/3 K=7 encoder/decoder in both stream and block mode Added general purpose blocked mode encoder/decoder Added perl script for blocked mode encoder/decoder generation Stream decoders now normalize metrics periodically to prevent overflow Fixed fencepost problem in vittest.c.May 11, 1999 (version 3.0): Updated timings for a more modern CPU (400 MHz PII vs 133 MHz Pentium!) Support for non-zero starting and ending states ("pinned state" decoding): Added startstate and endstate args to blocked mode decoder param lists Fixed logic in tail decoding to handle non-zero tails NB: additional two args (start and end state) to the convolutional encoder and Viterbi decoder routines
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -