我正在尝试进行语音质量测试(pesq),但我不知道如何开始。我试图编译一个公共源代码(http://www.itu.int/itu-t/recommendations/index.aspx?ser=P (p.862)),但无法启动测试。有没有人用过这个?
发布于 2012-10-22 05:44:41
您将需要一个C编译器( ITU PESQ reference implementation实际上是C,所以您不需要C++编译器,尽管这两个编译器都应该可以很好地工作)
例如,在linux上,您可以进入source目录并使用gcc进行编译
$ cd Software/P862_annex_A_2005_CD/source
$ gcc -o PESQ *.c这会将文件dsp.c, pesqdsp.c, pesqio.c, pesqmain.c, pesqmod.c编译成二进制文件PESQ,然后您可以使用./PESQ运行该文件
$ ./PESQ
Perceptual Evaluation of Speech Quality (PESQ)
Reference implementation for ITU-T Recommendations P.862, P.862.1 and P.862.2.
Version 2.0 October 2005.
<snip long unenlightening IP notice>
Usage:
PESQ HELP Displays this text
PESQ [options] ref deg
Run model on reference ref and degraded deg
Options: +8000 +16000 +swap +wb
Sample rate - No default. Must select either +8000 or +16000.
Swap byte order - machine native format by default. Select +swap for byteswap.
Default mode of operation is P.862 (narrowband handset listening). Select +wb
to use P.862.2 wideband extension (headphone listening).
File names may not begin with a + character.
Files with names ending .wav or .WAV are assumed to have a 44-byte header, which is automatically skipped. All other file types are assumed to have no header.要运行此二进制文件并测试您的算法,您需要“参考”.wav文件(这是干净的原始语音)和“降级”的.wav文件(这是算法的输出)。只需将这两个参数传递给PESQ,它就会给出测试的输出。下面是一个运行在国际电信联盟源代码发行版中的两个.wav文件上的示例:
$ cd Software/P862_annex_A_2005_CD/conform
$ ../source/PESQ +8000 or105.wav dg105.wav
Perceptual Evaluation of Speech Quality (PESQ)
Reference implementation for ITU-T Recommendations P.862, P.862.1 and P.862.2.
Version 2.0 October 2005.
<snip IP notice>
Reading reference file or105.wav...done.
Reading degraded file dg105.wav...done.
Level normalization...
IRS filtering...
Variable delay compensation...
Acoustic model processing...
P.862 Prediction (Raw MOS, MOS-LQO): = 2.237 1.844其中,+8000参数表示以8000 at对wav文件进行采样。
发布于 2014-02-03 16:38:34
在上一个版本的GCC中,你可能需要使用这个命令来编译:
gcc -o PESQ *.c -lmBR
发布于 2018-06-13 21:42:33
除了来自staticfloat的回答之外,基于AntoineF的回答,一些gcc版本可能会抛出以下警告:
pesqmain.c: In function 'main':
pesqmain.c:322:17: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=]
printf ("An error of type %d ", Error_Flag);
^
pesqmain.c: In function 'pesq_measure':
pesqmain.c:629:35: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
fprintf (resultsFile, "%d\t", Fs);
^
pesqmain.c:636:34: warning: too many arguments for format [-Wformat-extra-args]
fprintf (resultsFile, "\n", Fs);要解决此问题,您可以通过运行以下命令来明确忽略这些警告:
gcc -Wno-format -Wno-format-extra-args -o pesq *.c -lm # works on Ubuntu 16.04, gcc 5.4.0希望能对像我这样不熟悉C代码编译的人有所帮助!
https://stackoverflow.com/questions/2329403
复制相似问题