annotate util/SMALL_AudioDeNoiseResult.m @ 12:b6d8f2c4f5fa

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