changeset 179:989b7d78e1c8 danieleb

added support for p-cumulative coherence
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Thu, 17 Nov 2011 12:55:36 +0000
parents 4ea4badb2266
children 28b20fd46ba7
files util/classes/@dictionary/cumcoherence.m
diffstat 1 files changed, 24 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/util/classes/@dictionary/cumcoherence.m	Thu Nov 17 11:22:17 2011 +0000
+++ b/util/classes/@dictionary/cumcoherence.m	Thu Nov 17 12:55:36 2011 +0000
@@ -1,19 +1,30 @@
-function mu = cumcoherence(obj)
+function mu = cumcoherence(obj,p)
+% Calculates the p-cumulative coherence of the dictionary, defined as
+% \mu_p(k) = max_|I|=k{max_j\notin I{(\sum_i \in I}|<\phi_i,\phi_j>|^p)^1/p}
+%
+% INPUT
+% obj: dictionary object
+% p: power (default 1)
+%
+% OUTPUT
+% mu: p-cumulative coherence
+if ~exist('type','var') || isempty(p), p = 1; end
+
 obj = normalize(obj);
 [M N] = size(obj.phi);
 mu = zeros(M,1);
 for m=1:M
-    c = zeros(N);
-    for i=1:N
-        c(:,i) = abs(obj.phi'*obj.phi(:,i));
-        c(i,i) = 0;
-    end
-    c = sort(c,'descend');
-    c = c(1:m,:);
-    if m==1
-        mu(m) = max(c);
-    else
-        mu(m) = max(sum(c));
-    end
+	c = zeros(N);
+	for i=1:N
+		c(:,i) = abs(obj.phi'*obj.phi(:,i)).^p;
+		c(i,i) = 0;
+	end
+	c = sort(c,'descend');
+	c = c(1:m,:);
+	if m==1
+		mu(m) = max(c^(1/p));
+	else
+		mu(m) = max(sum(c)^(1/p));
+	end
 end
 end