diff viterbi.cpp @ 109:bf894897436d monophonicness

repaired viterbi
author matthiasm
date Mon, 28 Mar 2011 16:04:51 +0100
parents 99b87ce4bb70
children c4d1208e5ea9
line wrap: on
line diff
--- a/viterbi.cpp	Sun Dec 19 22:01:14 2010 +0900
+++ b/viterbi.cpp	Mon Mar 28 16:04:51 2011 +0100
@@ -68,10 +68,10 @@
     }
     
     /* initialise backward step */
-    int bestValue = 0;
+    double bestValue = 0;
     for (int iState = 0; iState < nState; ++iState) {
         double currentValue = delta[(nFrame-1) * nState + iState];
-        if (currentValue > path[nFrame-1]) {
+        if (currentValue > bestValue) {
             bestValue = currentValue;            
             path[nFrame-1] = iState;
         }