I am trying to find some (preferably MATLAB) code for the Viterbi algorithm in a 2nd order HMM. I know how to apply it for a first order model, and understand the concept for 2nd order. However I am having trouble implementing it for a 2nd order model. Can anyone give me any good references? I have searched Google and, surprisingly, could not find anything that's reasonably clear.
Also, is there a MATLAB library that already implements this? I know there is one for a first order HMM. Thanks