Viterbi Decoder - Decoding Continuously Encoded Stream Partially I am in trouble with Viterbi decoder for a while. I have some questions.

I need to decode messages from a continuous stream which is encoded without resetting the state metrics. Each message starts with a preamble, but since these preambles are also encoded as part of the stream, there is actually no message concept before decoding.


Encoding without resetting the metrics means that the data is encoded as one big message, doesn't it?
The decoder I am using works frame by frame, without storing and re-using the state metrics. So, I am adding a prefix and a postfix from the previous and next messages.

(last $n$ bits of the previous encoded message + message to be decoded + first $m$ bits of the next encoded message)

I hopefully expect that the prefix works as a training data, and the state metrics after the prefix are ready to decode the actual message. In order to decode the last bits of the message correctly, the postfix is used. I suppose using the data from the next message as the postfix is better than adding zeros or random bits, because adding zeros or random numbers may cause a wrong path affecting not only the decoding of the postfix but also of the actual message.


Is this procedure reasonable?  
Is it common and does it have a name such as sliding windows?

How many bits should I use as the prefix and postfix? (I cannot set the traceback length and see if it is pre-set somewhere. The code rate is $1/2$ and constraint length is $7$.)


Thanks in advance.
Since the decoder that you are working with is a black box, yes, adding prefixes and postfixes to the stream to "window-ize" it is appropriate.  The pre and postfixes need to be the actual data from the previous and post windows, and they need to be at least as long as the traceback depth.  If you do this and get rid of the result bits that correspond to the prefixes and postfixes, then you should do fine.

In a normal situation you would not need to add any postfixes or prefixes.  There are only two things you need to do to handle continuous streams of Viterbi-encoded data.

1) occasionally check the state metrics and lower them when all of them get "high".  This works because the only thing that matters is the difference between the state metrics, not their absolute value.  An easy way to do this is to check if all of them are equal to or above half the maximum state metric value.  If they are, subtract half the maximum value from all of them.

2) You have to do tracebacks while you are decoding.  This is do-able in both FPGA's and microprocessors (it's actually quite easy in microprocessors).  Every $N$ transitions (pick an $N$ that works for your architecture) you do a traceback and output $N$ bits.  You have to go back through $M$ bits ($M$ being equal to the traceback depth) before you get to the $N$ bits that you will output.