ivan@138
|
1 function [SNRAll,SNRmiss] = SNRInpaintingPerformance(xRef,xObs,xEst,IMiss,DISP_FLAG)
|
ivan@138
|
2 % Various SNR measures for inpainting performance
|
ivan@138
|
3 %
|
ivan@138
|
4 % Usage: [SNRAll,SNRmiss] = SNRInpaintingPerformance(xRef,xObs,xEst,IMiss,DISP_FLAG)
|
ivan@138
|
5 %
|
ivan@138
|
6 %
|
ivan@138
|
7 % Inputs:
|
ivan@138
|
8 % - xRef - reference signal
|
ivan@138
|
9 % - xObs - observed signal
|
ivan@138
|
10 % - xEst - estimate signal
|
ivan@138
|
11 % - IMiss - location of missing data
|
ivan@138
|
12 %
|
ivan@138
|
13 % Outputs:
|
ivan@138
|
14 % - SNRAll - SNRAll(1) is the original SNR, between xRef and xObs;
|
ivan@138
|
15 % SNRAll(2) is the SNR is the obtained SNR, between xRef and xEst
|
ivan@138
|
16 % - SNRmiss - the same as SNRAll but computed on the missing/restored
|
ivan@138
|
17 % samples only
|
ivan@138
|
18 %
|
ivan@138
|
19 %
|
ivan@138
|
20 % -------------------
|
ivan@138
|
21 %
|
ivan@138
|
22 % Audio Inpainting toolbox
|
ivan@138
|
23 % Date: June 28, 2011
|
ivan@138
|
24 % By Valentin Emiya, Amir Adler, Maria Jafari
|
ivan@138
|
25 % This code is distributed under the terms of the GNU Public License version 3 (http://www.gnu.org/licenses/gpl.txt).
|
ivan@138
|
26 if nargin<5
|
ivan@138
|
27 DISP_FLAG = 0;
|
ivan@138
|
28 end
|
ivan@138
|
29
|
ivan@138
|
30 SNRAll = [SNR(xRef,xObs),SNR(xRef,xEst)];
|
ivan@138
|
31 SNRmiss = [SNR(xRef(IMiss),xObs(IMiss)),SNR(xRef(IMiss),xEst(IMiss))];
|
ivan@138
|
32
|
ivan@138
|
33 if DISP_FLAG>0
|
ivan@138
|
34 fprintf('SNR on all samples / clipped samples:\n');
|
ivan@138
|
35 fprintf('Original: %g dB / %g dB\n',...
|
ivan@138
|
36 SNRAll(1),...
|
ivan@138
|
37 SNRmiss(1));
|
ivan@138
|
38 fprintf('Estimate: %g dB / %g dB\n',...
|
ivan@138
|
39 SNRAll(2),...
|
ivan@138
|
40 SNRmiss(2));
|
ivan@138
|
41 end
|
ivan@138
|
42
|
ivan@138
|
43 return
|