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