changeset 109:bf894897436d monophonicness

repaired viterbi
author matthiasm
date Mon, 28 Mar 2011 16:04:51 +0100
parents ea5d533536ab
children 96cea9c05046
files viterbi.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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;
         }