comparison util/SMALL_AudioDeNoiseResult.m @ 161:f42aa8bcb82f ivand_dev

debug and clean the SMALLbox Problems code
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Wed, 31 Aug 2011 12:02:19 +0100
parents 8e660fd14774
children
comparison
equal deleted inserted replaced
155:b14209313ba4 161:f42aa8bcb82f
1 function SMALL_AudioDeNoiseResult(SMALL) 1 function SMALL_AudioDeNoiseResult(SMALL)
2 %% Plots the results of Audio denoising experiment - underconstruction 2 %% Plots the results of Audio denoising experiment - underconstruction
3 3
4 % Centre for Digital Music, Queen Mary, University of London. 4 % Centre for Digital Music, Queen Mary, University of London.
5 % This file copyright 2009 Ivan Damnjanovic. 5 % This file copyright 2011 Ivan Damnjanovic.
6 % 6 %
7 % This program is free software; you can redistribute it and/or 7 % This program is free software; you can redistribute it and/or
8 % modify it under the terms of the GNU General Public License as 8 % modify it under the terms of the GNU General Public License as
9 % published by the Free Software Foundation; either version 2 of the 9 % published by the Free Software Foundation; either version 2 of the
10 % License, or (at your option) any later version. See the file 10 % License, or (at your option) any later version. See the file
11 % COPYING included with this distribution for more information. 11 % COPYING included with this distribution for more information.
12 % 12 %
13 13
14 fMain=figure('Name', sprintf('File %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma)); 14 fMain=figure('Name', sprintf('File %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma));
15 m=size(SMALL.solver,2); 15 m=size(SMALL.solver,2);
16 maxval=SMALL.Problem.maxval; 16 maxval=max(SMALL.Problem.Original);
17 au=SMALL.Problem.Original; 17 au=SMALL.Problem.Original;
18 aunoise=SMALL.Problem.Noisy; 18 aunoise=SMALL.Problem.Noisy;
19 19
20 subplot(2, m, 1); plot(au/maxval); 20 subplot(2, m, 1); plot(au/maxval);
21 title('Original audio'); 21 title('Original audio');
23 subplot(2,m,2); plot(aunoise/maxval); 23 subplot(2,m,2); plot(aunoise/maxval);
24 title(sprintf('Noisy audio, PSNR = %.2fdB', 20*log10(maxval * sqrt(numel(au)) / norm(au(:)-aunoise(:))) )); 24 title(sprintf('Noisy audio, PSNR = %.2fdB', 20*log10(maxval * sqrt(numel(au)) / norm(au(:)-aunoise(:))) ));
25 25
26 for i=1:m 26 for i=1:m
27 params=SMALL.solver(i).param; 27 params=SMALL.solver(i).param;
28 sWav=subplot(2, m, m+i, 'Parent', fMain); plot(SMALL.solver(i).reconstructed.Image/maxval, 'Parent', sWav); 28 sWav=subplot(2, m, m+i, 'Parent', fMain); plot(SMALL.solver(i).reconstructed.audio/maxval, 'Parent', sWav);
29 title(sprintf('%s Denoised audio, PSNR: %.2fdB', SMALL.DL(i).name, SMALL.solver(i).reconstructed.psnr),'Parent', sWav ); 29 title(sprintf('%s Denoised audio, PSNR: %.2fdB', SMALL.DL(i).name, SMALL.solver(i).reconstructed.psnr),'Parent', sWav );
30 if strcmpi(SMALL.DL(i).name,'ksvds') 30 if strcmpi(SMALL.DL(i).name,'ksvds')
31 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i).D; 31 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i).D;
32 else 32 else
33 D = SMALL.DL(i).D; 33 D = SMALL.DL(i).D;