Implement a viterbi algorithm for convolutional coding