File Exchange

image thumbnail


version 1.0 (171 KB) by

MATLAB wrapper for the PESQ binary. Both narrowband and wideband (WB-PESQ) modes are supported.



View License

Implements a MATLAB wrapper function for the PESQ version 2.0 binary [1]. Both narrowband and wideband modes are supported. The narrowband approach (P.862) returns both the raw MOS_PESQ score and its mapping to LQO scale: MOS_LQO as per P.862.1. The wideband extension (P.862.2) returns LQO mapped score: MOS_LQO as per P.862.2. LQO mapping transforms objective scores to allow for linear comparisons with MOS (P.800.1) results of subjective experiments.

This framework is written specifically to work corss-platform on Linux and Windows operating systems. Note, however, that for the wapper to work, the PESQ sources have to be compiled and the binary has to be installed on the target PC. The sources are freely available for download (however with license constraints) from ITU-T website at the following url:

Linux makefile can be downloaded from:

Windows makefile and DEV-C++ project file can be downloaded from:

DEV-C++ (IDE along with MingW compiler, for compiling on the Windows platform) can be downloaded from:

[1] ITU-T (2005), "P.862: Revised Annex A - Reference implementations
and conformance testing for ITU-T Recs P.862, P.862.1 and P.862.2"

Comments and Ratings (11)

Jacob D

Jacob D (view profile)

Running ITU PESQ code compiled as a MEX function to accept vector inputs, and running in parallel, yields even greater performance:

da tony

where can i get 'pesq.exe' ?

mimi sam

Thank you Mr. Arkadiy Prodeus for sharing those information

mimi sam

Thank you Mr. Kamil Wojcicki.

Kamil Wojcicki

Kamil Wojcicki (view profile)

Download, compile and install PESQ executable (see instructions above).

Download the zip file with the wrapper. Extract. Start MATLAB. Navigate to the extracted folder. Run test_pesqbin.m example.

mimi sam

how can I use this zip to evaluate my signals?
(please, tell me step by step)

Jacob D

Jacob D (view profile)

A faster way to run PESQ in MATLAB may be to compile the ITU PESQ code as a MEX function. Step by step guide here:

5. Function pesqbin.m has bags: its results are NaN, when "reference" and "degraded" arguments are string variables.

For getting correct results, it is necessary make next corrections in pesqbin_linux and pesqbin_windous functions:

First correction:

if ischar(reference)
%file.reference = reference;
%[ ~, fs, nbits ] = wavread( file.reference );
[ ref, fs, nbits ] = wavread( reference );
file.reference = sprintf( '%s%s%s', tmpdir, filesep, '~80b4eb734d.wav' );
wavwrite( 0.999*ref./max(abs(ref)), fs, nbits, file.reference );

Second correction:

if ischar(degraded)
%file.degraded = degraded;
%[ ~, fs, nbits ] = wavread( file.degraded );
[ deg, fs, nbits ] = wavread( degraded );
file.degraded = sprintf( '%s%s%s', tmpdir, filesep, '~be4dfad7fba.wav' );
wavwrite( 0.999*deg./max(abs(deg)), fs, nbits, file.degraded );

Notice that we also changed "isstr" on "ischar" because of Matlab recommendations.

The idea is excellent. However, in practice (I use Windows XP), PESQ Matlab Wrapper has some significant drawbacks:

1. We find in description that "binary has to be installed on the target PC"; but only through experimentation we found out that file pesq.exe should be copied to directory C:\WINDOWS\system32 or as an alternative to the directory C:\DOCUME~1\USERNAME\LOCALS~\Temp

2. Calculation results are placed in the file pesq_results.txt, which is stored in the directory C:\DOCUME~1\USERNAME\LOCALS~1\Temp; it is inconvenient because researched audio files are not usually stored in the temporary directory.

3. Calculation results, placed in the file pesq_results.txt, are extremely uncomfortable for subsequent analysis, because identical "temporary" file names are used instead of genuine (and, of course, different) file names; it is especially inconvenient when analyzing the processing results of a set of different audio files.

4. Function pesqbin.m arguments are not the names of audio files, but the names of their corresponding numeric arrays; it confuses the user, as is different from the syntax of the program pesq.exe


hai (view profile)

Great job!

MATLAB Release
MATLAB 7.12 (R2011a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video