comparison toolboxes/AudioInpaintingToolbox/Utils/evaluation/exclude_testAudioQualityMeasures.m @ 144:19e0af570914 release_1.5

Merge from branch "ivand_dev"
author Ivan <ivan.damnjanovic@eecs.qmul.ac.uk>
date Tue, 26 Jul 2011 15:14:15 +0100
parents 56d719a5fd31
children
comparison
equal deleted inserted replaced
143:8d866d96f006 144:19e0af570914
1 function testAudioQualityMeasures
2 %
3 %
4 % Usage:
5 %
6 %
7 % Inputs:
8 % -
9 % -
10 % -
11 % -
12 % -
13 % -
14 % -
15 % -
16 %
17 % Outputs:
18 % -
19 % -
20 % -
21 % -
22 %
23 % Note that the CVX library is needed.
24 %
25 % -------------------
26 %
27 % Audio Inpainting toolbox
28 % Date: June 28, 2011
29 % By Valentin Emiya, Amir Adler, Maria Jafari
30 % This code is distributed under the terms of the GNU Public License version 3 (http://www.gnu.org/licenses/gpl.txt).
31
32 soundDir = './';
33
34 [xRef fs] = wavread([soundDir 'xClean.wav']);
35
36 testFiles = {'xClipped.wav','xEst2.wav','xEstInterp'};
37 Nf = length(testFiles);
38
39 SNR = zeros(Nf,1);
40 PSM = zeros(Nf,1);
41 PSMt = zeros(Nf,1);
42 PESQ_MOS = zeros(Nf,1);
43 EAQUAL_ODG = zeros(Nf,1);
44 EAQUAL_DIX = zeros(Nf,1);
45
46 options.ENABLE_PEMOQ = true;
47
48 for kf = 1:Nf
49 xTest = wavread([soundDir testFiles{kf}]);
50 [SNR(kf) PSM(kf),PSMt(kf),...
51 PESQ_MOS(kf),EAQUAL_ODG(kf), EAQUAL_DIX(kf)] = ...
52 audioQualityMeasures(xRef,xTest,fs,options);
53 end
54
55 for kf = 1:Nf
56 fprintf('Quality of %s: SNR = %g dB, PSM=%g, PSMt=%g, PESQ=%g, EAQUAL_ODG=%g, EAQUAL_DIX=%g\n',...
57 testFiles{kf},SNR(kf),PSM(kf),PSMt(kf),PESQ_MOS(kf),EAQUAL_ODG(kf),EAQUAL_DIX(kf));
58 end
59
60 Q = [SNR,PSM,PSMt,PESQ_MOS,EAQUAL_ODG,EAQUAL_DIX];
61 Qs = {'SNR','PSM','PSMt','PESQ MOS','EAQUAL ODG','EAQUAL DIX'};
62
63 figure
64 for k=1:size(Q,2)
65 subplot(ceil(sqrt(size(Q,2))),ceil(sqrt(size(Q,2))),k)
66 plot(Q(:,k))
67 xlabel('audio files');
68 ylabel(Qs{k})
69 end
70 return