Consider a 2-state trellis which operates at a rate of one bit
per sample, used for encoding uniformly distributed samples
in the interval [0,1]. Each stage of this trellis has the
following four edges (A, B) = (value, code)
to the next stage, where A and B are states
in the current and next stages,
value is a quantized value, and code
is the bit emitted to indicate the branch taken:
- (0,0) = (x, 0)
- (0,1) = (x+0.5, 1)
- (1,0) = (0.5-x, 0)
- (1,1) = (1-x, 1)
and x is given to be in the range [0, 0.25].
Now consider an n-stage trellis code obtained by
replicating the above stage.
- Let x = 0.1 and n = 10.
Write a simulator that generates a sufficient number of
n-vectors of random samples from [0,1],
determines the optimum trellis code for each,
and calculates the average SQNR in decibels.
- Vary x and determine the optimum value of x
so as to maximize the average SQNR.
- Vary n to determine approximately the asymptotic
optimal value of x and the corresponding average SQNR
for an arbitrarily large trellis.
- Determine the optimum x and the corresponding
average SQNR when using an on-line (as opposed to a Viterbi)
branch selection and compare the results.