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