The Viterbi algorithm