idamnjanovic@8: function SMALL_AudioDeNoiseResult(SMALL) idamnjanovic@8: idamnjanovic@8: fMain=figure('Name', sprintf('File %s (training set size- %d, sigma - %d)',SMALL.Problem.name, SMALL.Problem.n, SMALL.Problem.sigma)); idamnjanovic@8: m=size(SMALL.solver,2); idamnjanovic@8: maxval=SMALL.Problem.maxval; idamnjanovic@8: au=SMALL.Problem.Original; idamnjanovic@8: aunoise=SMALL.Problem.Noisy; idamnjanovic@8: idamnjanovic@8: subplot(2, m, 1); plot(au/maxval); idamnjanovic@8: title('Original audio'); idamnjanovic@8: idamnjanovic@8: subplot(2,m,2); plot(aunoise/maxval); idamnjanovic@8: title(sprintf('Noisy audio, PSNR = %.2fdB', 20*log10(maxval * sqrt(numel(au)) / norm(au(:)-aunoise(:))) )); idamnjanovic@8: idamnjanovic@8: for i=1:m idamnjanovic@8: params=SMALL.solver(i).param; idamnjanovic@8: sWav=subplot(2, m, m+i, 'Parent', fMain); plot(SMALL.solver(i).reconstructed.Image/maxval, 'Parent', sWav); idamnjanovic@8: title(sprintf('%s Denoised audio, PSNR: %.2fdB', SMALL.DL(i).name, SMALL.solver(i).reconstructed.psnr),'Parent', sWav ); idamnjanovic@8: if strcmpi(SMALL.DL(i).name,'ksvds') idamnjanovic@8: D = kron(SMALL.Problem.basedict{2},SMALL.Problem.basedict{1})*SMALL.DL(i).D; idamnjanovic@8: else idamnjanovic@8: D = SMALL.DL(i).D; idamnjanovic@8: end idamnjanovic@8: figure('Name', sprintf('%s dictionary in %.2f s', SMALL.DL(i).name, SMALL.DL(i).time)); idamnjanovic@8: imshow(D*255); idamnjanovic@8: % n= size(D,2); idamnjanovic@8: % sqrtn=round(sqrt(size(D,2))); idamnjanovic@8: % for j=1:n idamnjanovic@8: % subplot(sqrtn,sqrtn,j); plot(D(:,j)); idamnjanovic@8: % end idamnjanovic@8: % dictimg = showdict(D,[params.blocksize 1],round(sqrt(size(D,2))),round(sqrt(size(D,2))),'lines','highcontrast'); idamnjanovic@8: % idamnjanovic@8: % subplot(2,m,m+i);imshow(imresize(dictimg,2,'nearest')); idamnjanovic@8: % title(sprintf('%s dictionary in %.2f s', SMALL.DL(i-1).name, SMALL.DL(i-1).time)); idamnjanovic@8: idamnjanovic@8: end