Mercurial > hg > smallbox
annotate util/classes/@dictionary/cumcoherence.m @ 176:d0645d5fca7d danieleb
added MOCOD dictionary update
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Nov 2011 11:17:44 +0000 |
parents | e3035d45d014 |
children | 989b7d78e1c8 |
rev | line source |
---|---|
daniele@160 | 1 function mu = cumcoherence(obj) |
daniele@160 | 2 obj = normalize(obj); |
daniele@160 | 3 [M N] = size(obj.phi); |
daniele@160 | 4 mu = zeros(M,1); |
daniele@160 | 5 for m=1:M |
daniele@160 | 6 c = zeros(N); |
daniele@160 | 7 for i=1:N |
daniele@160 | 8 c(:,i) = abs(obj.phi'*obj.phi(:,i)); |
daniele@160 | 9 c(i,i) = 0; |
daniele@160 | 10 end |
daniele@160 | 11 c = sort(c,'descend'); |
daniele@160 | 12 c = c(1:m,:); |
daniele@160 | 13 if m==1 |
daniele@160 | 14 mu(m) = max(c); |
daniele@160 | 15 else |
daniele@160 | 16 mu(m) = max(sum(c)); |
daniele@160 | 17 end |
daniele@160 | 18 end |
daniele@160 | 19 end |