Mercurial > hg > smallbox
comparison util/SMALL_AudioDeNoiseResult.m @ 178:4ea4badb2266 danieleb
added ramirez dl (to be completed) and MOCOD dictionary update
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Nov 2011 11:22:17 +0000 |
parents | f42aa8bcb82f |
children |
comparison
equal
deleted
inserted
replaced
177:714fa7b8c1ad | 178:4ea4badb2266 |
---|---|
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; |