annotate util/SMALL_AudioDeNoiseResult.m @ 143:8d866d96f006

changes to the merge
author Ivan <ivan.damnjanovic@eecs.qmul.ac.uk>
date Tue, 26 Jul 2011 15:13:29 +0100
parents 8e660fd14774
children f42aa8bcb82f
rev   line source
idamnjanovic@8 1 function SMALL_AudioDeNoiseResult(SMALL)
ivan@128 2 %% Plots the results of Audio denoising experiment - underconstruction
ivan@128 3
idamnjanovic@24 4 % Centre for Digital Music, Queen Mary, University of London.
idamnjanovic@24 5 % This file copyright 2009 Ivan Damnjanovic.
idamnjanovic@24 6 %
idamnjanovic@24 7 % This program is free software; you can redistribute it and/or
idamnjanovic@24 8 % modify it under the terms of the GNU General Public License as
idamnjanovic@24 9 % published by the Free Software Foundation; either version 2 of the
idamnjanovic@24 10 % License, or (at your option) any later version. See the file
idamnjanovic@24 11 % COPYING included with this distribution for more information.
idamnjanovic@24 12 %
idamnjanovic@8 13
idamnjanovic@8 14 fMain=figure('Name', sprintf('File %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma));
idamnjanovic@8 15 m=size(SMALL.solver,2);
idamnjanovic@8 16 maxval=SMALL.Problem.maxval;
idamnjanovic@8 17 au=SMALL.Problem.Original;
idamnjanovic@8 18 aunoise=SMALL.Problem.Noisy;
idamnjanovic@8 19
idamnjanovic@8 20 subplot(2, m, 1); plot(au/maxval);
idamnjanovic@8 21 title('Original audio');
idamnjanovic@8 22
idamnjanovic@8 23 subplot(2,m,2); plot(aunoise/maxval);
idamnjanovic@8 24 title(sprintf('Noisy audio, PSNR = %.2fdB', 20*log10(maxval * sqrt(numel(au)) / norm(au(:)-aunoise(:))) ));
idamnjanovic@8 25
idamnjanovic@8 26 for i=1:m
idamnjanovic@8 27 params=SMALL.solver(i).param;
idamnjanovic@8 28 sWav=subplot(2, m, m+i, 'Parent', fMain); plot(SMALL.solver(i).reconstructed.Image/maxval, 'Parent', sWav);
idamnjanovic@8 29 title(sprintf('%s Denoised audio, PSNR: %.2fdB', SMALL.DL(i).name, SMALL.solver(i).reconstructed.psnr),'Parent', sWav );
idamnjanovic@8 30 if strcmpi(SMALL.DL(i).name,'ksvds')
idamnjanovic@8 31 D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i).D;
idamnjanovic@8 32 else
idamnjanovic@8 33 D = SMALL.DL(i).D;
idamnjanovic@8 34 end
idamnjanovic@8 35 figure('Name', sprintf('%s dictionary in %.2f s', SMALL.DL(i).name, SMALL.DL(i).time));
idamnjanovic@8 36 imshow(D*255);
idamnjanovic@8 37 % n= size(D,2);
idamnjanovic@8 38 % sqrtn=round(sqrt(size(D,2)));
idamnjanovic@8 39 % for j=1:n
idamnjanovic@8 40 % subplot(sqrtn,sqrtn,j); plot(D(:,j));
idamnjanovic@8 41 % end
idamnjanovic@8 42 % dictimg = showdict(D,[params.blocksize 1],round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast');
idamnjanovic@8 43 %
idamnjanovic@8 44 % subplot(2,m,m+i);imshow(imresize(dictimg,2,'nearest'));
idamnjanovic@8 45 % title(sprintf('%s dictionary in %.2f s', SMALL.DL(i-1).name, SMALL.DL(i-1).time));
idamnjanovic@8 46
idamnjanovic@8 47 end