pitch-functions-test.cc File Reference
#include <iostream>
#include "base/kaldi-math.h"
#include "feat/feature-plp.h"
#include "feat/pitch-functions.h"
#include "feat/wave-reader.h"
#include "sys/stat.h"
#include "sys/types.h"
#include "base/timer.h"
Include dependency graph for pitch-functions-test.cc:

Go to the source code of this file.

Namespaces

 kaldi
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference:
 

Functions

std::string ConvertIntToString (const int &number)
 
bool DirExist (const std::string &dirname)
 
static void UnitTestSimple ()
 
static void UnitTestSnipEdges ()
 
static void UnitTestPieces ()
 
static void UnitTestDelay ()
 
static void UnitTestSearch ()
 
static void UnitTestComputeGPE ()
 
static void UnitTestKeele ()
 
static void UnitTestPenaltyFactor ()
 
static void UnitTestKeeleNccfBallast ()
 
static void UnitTestPitchExtractionSpeed ()
 
static void UnitTestPitchExtractorCompareKeele ()
 
void UnitTestDiffSampleRate ()
 
void UnitTestProcess ()
 
static void UnitTestFeatNoKeele ()
 
static void UnitTestFeatWithKeele ()
 
int main ()
 

Variables

bool pitch_use_naive_search = false
 

Function Documentation

◆ main()

int main ( )

Definition at line 617 of file pitch-functions-test.cc.

References kaldi::DirExist(), KALDI_ERR, KALDI_LOG, kaldi::SetVerboseLevel(), kaldi::UnitTestFeatNoKeele(), and kaldi::UnitTestFeatWithKeele().

617  {
618  using namespace kaldi;
619 
620  SetVerboseLevel(3);
621  try {
623  if (DirExist("keele/16kHz")) {
625  } else {
626  KALDI_LOG
627  << "Not running tests that require the Keele database, "
628  << "please ask g.meyer@liverpool.ac.uk for the database if you need it.\n"
629  << "Once you have the keele/ subdirectory, containing *.{pel,pet,pev,raw,wav}, do this:\n"
630  << "cd keele; mkdir -p 16kHz; mkdir -p tmp; for x in *.wav; do \n"
631  << "sox $x -r 16000 16kHz/$x; done \n"
632  << "mkdir -p keele-true-lags; for f in *.pev; do \n"
633  << "out_f=keele-true-lags/$(echo $f | sed s:pev:txt:); ( echo ' ['; len=`cat $f | wc -l`; \n"
634  << "head -n $(($len-1)) $f | tail -n $(($len-14)) ; echo -n ']') >$out_f; done \n"
635  << "\n"
636  << "Note: the GPE reported in paper is computed using pseudo-ground-truth pitch obtained\n"
637  << "by voting among the pitch trackers mentioned in the paper.\n";
638  }
639  KALDI_LOG << "Tests succeeded.";
640  return 0;
641  } catch(const std::exception &e) {
642  KALDI_ERR << e.what();
643  return 1;
644  }
645 }
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
bool DirExist(const std::string &dirname)
void SetVerboseLevel(int32 i)
This should be rarely used, except by programs using Kaldi as library; command-line programs set the ...
Definition: kaldi-error.h:64
#define KALDI_ERR
Definition: kaldi-error.h:147
static void UnitTestFeatWithKeele()
static void UnitTestFeatNoKeele()
#define KALDI_LOG
Definition: kaldi-error.h:153