daniele@179: function mu = cumcoherence(obj,p) daniele@179: % Calculates the p-cumulative coherence of the dictionary, defined as daniele@179: % \mu_p(k) = max_|I|=k{max_j\notin I{(\sum_i \in I}|<\phi_i,\phi_j>|^p)^1/p} daniele@179: % daniele@179: % INPUT daniele@179: % obj: dictionary object daniele@179: % p: power (default 1) daniele@179: % daniele@179: % OUTPUT daniele@179: % mu: p-cumulative coherence daniele@180: if ~exist('p','var') || isempty(p), p = 1; end daniele@179: daniele@160: obj = normalize(obj); daniele@160: [M N] = size(obj.phi); daniele@160: mu = zeros(M,1); daniele@160: for m=1:M daniele@179: c = zeros(N); daniele@179: for i=1:N daniele@179: c(:,i) = abs(obj.phi'*obj.phi(:,i)).^p; daniele@179: c(i,i) = 0; daniele@179: end daniele@179: c = sort(c,'descend'); daniele@179: c = c(1:m,:); daniele@179: if m==1 daniele@180: mu(m) = max(c.^(1/p)); daniele@179: else daniele@180: mu(m) = max(sum(c).^(1/p)); daniele@179: end daniele@160: end daniele@160: end