annotate toolboxes/AudioInpaintingToolbox/Utils/evaluation/exclude_testAudioQualityMeasures.m @ 201:5140b0e06c22 luisf_dev

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