comparison util/SMALL_AudioDeNoiseResult.m @ 8:33850553b702

(none)
author idamnjanovic
date Mon, 22 Mar 2010 10:56:54 +0000
parents
children fc395272d53e
comparison
equal deleted inserted replaced
7:0151f1ea080d 8:33850553b702
1 function SMALL_AudioDeNoiseResult(SMALL)
2
3 fMain=figure('Name', sprintf('File %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma));
4 m=size(SMALL.solver,2);
5 maxval=SMALL.Problem.maxval;
6 au=SMALL.Problem.Original;
7 aunoise=SMALL.Problem.Noisy;
8
9 subplot(2, m, 1); plot(au/maxval);
10 title('Original audio');
11
12 subplot(2,m,2); plot(aunoise/maxval);
13 title(sprintf('Noisy audio, PSNR = %.2fdB', 20*log10(maxval * sqrt(numel(au)) / norm(au(:)-aunoise(:))) ));
14
15 for i=1:m
16 params=SMALL.solver(i).param;
17 sWav=subplot(2, m, m+i, 'Parent', fMain); plot(SMALL.solver(i).reconstructed.Image/maxval, 'Parent', sWav);
18 title(sprintf('%s Denoised audio, PSNR: %.2fdB', SMALL.DL(i).name, SMALL.solver(i).reconstructed.psnr),'Parent', sWav );
19 if strcmpi(SMALL.DL(i).name,'ksvds')
20 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i).D;
21 else
22 D = SMALL.DL(i).D;
23 end
24 figure('Name', sprintf('%s dictionary in %.2f s', SMALL.DL(i).name, SMALL.DL(i).time));
25 imshow(D*255);
26 % n= size(D,2);
27 % sqrtn=round(sqrt(size(D,2)));
28 % for j=1:n
29 % subplot(sqrtn,sqrtn,j); plot(D(:,j));
30 % end
31 % dictimg = showdict(D,[params.blocksize 1],round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast');
32 %
33 % subplot(2,m,m+i);imshow(imresize(dictimg,2,'nearest'));
34 % title(sprintf('%s dictionary in %.2f s', SMALL.DL(i-1).name, SMALL.DL(i-1).time));
35
36 end