annotate util/classes/@dictionary/plotcumcoherence.m @ 174:dc2f0fa21310 danieleb

multiple trials with error bars
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Thu, 17 Nov 2011 11:16:15 +0000
parents 68fb71aa5339
children
rev   line source
daniele@170 1 function plotcumcoherence(obj,mu)
daniele@170 2 if ~exist('mu','var') || isempty(mu), mu = cumcoherence(obj); end
daniele@170 3 [d N] = size(obj.phi);
daniele@170 4
daniele@170 5 % Plot cumulative coherence with lower and upper bounds
daniele@170 6 mumin = (1:d)*sqrt((N-d)/(d*(N-1)));
daniele@170 7 mumax = (1:d);
daniele@170 8 figure,
daniele@170 9 subplot(1,6,1:2)
daniele@170 10 hold on, grid on
daniele@170 11 plot(1,mumax(1),'k-s');
daniele@170 12 plot(1,mu(1),'ko');
daniele@170 13 plot(1,mumin(1),'k-d')
daniele@170 14 set(gca,'XScale','log','YScale','log');
daniele@170 15 axis tight
daniele@170 16 ylabel('\mu');
daniele@170 17 ylim([mumin(1) 10])
daniele@170 18
daniele@170 19 subplot(1,6,3:6)
daniele@170 20 hold on, grid on
daniele@170 21 plot(2:d,mumax(2:end),'k-s');
daniele@170 22 plot(2:d,mu(2:end),'k-o');
daniele@170 23 plot(2:d,mumin(2:end),'k-d');
daniele@170 24 set(gca,'XScale','log','YScale','log');
daniele@170 25 axis tight
daniele@170 26 xlabel('k');
daniele@170 27 ylabel('\mu(k)');
daniele@170 28 ylim([mumin(1) 10])
daniele@170 29
daniele@170 30 % Plot recovery bounds
daniele@170 31 plot(2:d,1-mu(1:d-1),'r-o')
daniele@170 32 plot(2:d,1-mumin(1:d-1)','r-d')
daniele@170 33 plot([2 d],[1/3 1/3],'b');
daniele@170 34 legend('\mu_{max}(k)','\mu(k)','\mu_{min}(k)','Exact-Sparse \mu','Exact-Sparse \mu_{min}','Sparse');
daniele@170 35
daniele@170 36
daniele@170 37 % v = conv(mu,[1 1]);
daniele@170 38 % ind = find(v<1, 1, 'last');
daniele@170 39 %
daniele@170 40 % line([ind ind], [min(mu) max(mu)],'Color','red');
daniele@170 41 % title(['Minimum allowed sparsity (Tanner):' num2str(ind/obj.len)]);
daniele@170 42 end