Revision 22:0a0e449a6069

View differences:

CepstrumPitchTracker.cpp
525 525
    delete[] logmag;
526 526
    delete[] io;
527 527

  
528
    double cep1 = rawcep[1];
529

  
528 530
    int n = m_bins;
529 531
    double *data = new double[n];
530 532
    filter(rawcep, data);
......
560 562

  
561 563
    double confidence = 0.0;
562 564
    if (nextPeakVal != 0.0) {
563
        confidence = (maxval - nextPeakVal) / 200.0;
564
        if (confidence > 1.0) confidence = 1.0;
565
        std::cerr << "maxval = " << maxval << ", cep1 = " << cep1 << std::endl;
566
        double conf0 = (maxval - nextPeakVal) / 80.0;
567
        double conf1 = (cep1 / bs) / 2;
568
        if (conf0 > 1.0) conf0 = 1.0;
569
        if (conf1 > 1.0) conf1 = 1.0;
570
        confidence = conf0 * conf1;
571
        std::cerr << "conf0 = " << conf0 << ", conf1 = " << conf1 << ", confidence = " << confidence << std::endl;
565 572
    }
566 573

  
567 574
    Hypothesis::Estimate e;

Also available in: Unified diff