4-6
Viterbi Decoder Implementation
For More Information On This Product,
Go to: www.freescale.com
Algorithmic Extensions
Allowing More General Branch Metrics
4.2.2
Modify Branch Metric Generation
The branch metric generation needs modification also.
Example 4-2
shows the user a
different motivation for noncomplementary branch metrics. In this example, we use
convolutional code from
Section 3
, but take the path metric for state 0 and subtract it
from all branch metrics. This is a computationally inexpensive way to automatically
normalize the path metrics so that we need not worry about arithmetic saturation of
path metrics when decoding very long streams of data. It does, however, destroy the
symmetry of the branch metrics.
Example 4-2
Modified Branch Metric Generation Code
;*****************BRANCH METRIC MACRO*************************************
;
FUNCTION: Input data and generate branch metrics. This function
;
subtracts the path metric for state 0 from all branch metrics
;
to provide autonormaliztion. For this decoder, the metric is a scaled
;
sum or difference of the real and imag inputs.
;
INPUTS:
;
r2 should point to the beginning of the branch metric table
;
r5 should point to the latest path metric for state 0
;
r1 should point to the next input XY data pair
;
OUTPUTS:
;
Branch metrics are stored at BRX in XY memory
;
REGISTERS USED:
;
a,b,x01,y01,r1,r2,r5, r5 unchanged,r2 unchanged (modulo req'd)
;****************************************************************
;
FindMetrics macro
move
x:(r5),a
neg
a
l:(r1)+,y ;negate metric|grab dec input
move
#-16,x1
mac
x1,y1,a
a,b
move
y1,x0
mac
x1,y0,a
a,y1
subl
a,b
b,x0
tfr
y1,a
a,y1
mac
-x1,y0,a
b,x1
tfr
x0,b
b,y0
subl
a,b
y1,x0
;st. metric scaling, read last st. 0
;sign for real component, upper br.
;comp 0x partial br. path mt. to
;mv real input to x0
;a gets 00 br. y1 gets 0x partial br
;a has 00 br, b has 11 br, save path
;swap 0x and 00 to compute 01 branch
;a gets 01 br
;swap path metric,11 branch to y0
;b gets 10 br, x0 has copy of 00 br.
;*****************************************************************************
;
AT this point, X is configured with br 11|00, y with 00|11, and
;
AB with 01|10, BA with 10|01 all needed for quick storage in XY
;
memory.
;*****************************************************************************
F
Freescale Semiconductor, Inc.
n
.