Revision 14:98256077e2a2

View differences:

CepstrumPitchTracker.cpp
51 51
    Estimate last = m_pending[m_pending.size()-1];
52 52
    double r = s.freq / last.freq;
53 53
    int cents = lrint(1200.0 * (log(r) / log(2.0)));
54
    return (cents > -200 && cents < 200);
54
    return (cents > -100 && cents < 100);
55 55
}
56 56

  
57 57
bool 
......
109 109
        }
110 110
    }
111 111

  
112
    return accept;
112
    return accept && (m_state == Satisfied);
113 113
}        
114 114

  
115 115
CepstrumPitchTracker::Hypothesis::State
......
522 522
            }
523 523
        }
524 524

  
525
        // reap rejected/expired hypotheses from possible list
526
        Hypotheses toReap = m_possible;
527
        m_possible.clear();
528
        for (int i = 0; i < toReap.size(); ++i) {
529
            Hypothesis h = toReap[i];
530
            if (h.getState() != Hypothesis::Rejected && 
531
                h.getState() != Hypothesis::Expired) {
532
                m_possible.push_back(h);
533
            }
534
        }
535
    }  
536

  
525 537
        std::cerr << "accepted length = " << m_accepted.getPendingLength()
526 538
                  << ", state = " << m_accepted.getState()
527 539
                  << ", hypothesis count = " << m_possible.size() << std::endl;
528 540

  
529
        //!!! and also need to reap rejected/expired hypotheses from the list
530
    }  
531 541
            
532 542

  
533 543
/*

Also available in: Unified diff