diff util/classes/dictionaryMatrices/grassmannian.m @ 166:1495bdfa13e9 danieleb

Updated grassmanian function (restored old computation of the dictionary) and added functions to the audio class
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Mon, 19 Sep 2011 14:53:23 +0100
parents 88578ec2f94a
children 290cca7d3469
line wrap: on
line diff
--- a/util/classes/dictionaryMatrices/grassmannian.m	Wed Aug 31 13:52:23 2011 +0100
+++ b/util/classes/dictionaryMatrices/grassmannian.m	Mon Sep 19 14:53:23 2011 +0100
@@ -4,18 +4,21 @@
 %
 % [A G res] = grassmanian(n,m,nIter,dd1,dd2,initA)
 %
-%
+% REFERENCE
+% M. Elad, Sparse and Redundant Representations, Springer 2010.
+
 %% Parameters and Defaults
 error(nargchk(2,7,nargin));
 
 if ~exist('verb','var')  || isempty(verb),  verb = false; end %verbose output
 if ~exist('initA','var') || isempty(initA), initA = randn(n,m); end %initial matrix
-if ~exist('dd2','var')   || isempty(dd2),   dd2 = 0.95; end %shrinking factor
+if ~exist('dd2','var')   || isempty(dd2),   dd2 = 0.99; end %shrinking factor
 if ~exist('dd1','var')   || isempty(dd1),   dd1 = 0.9; end %percentage of coherences to be shrinked
 if ~exist('nIter','var') || isempty(nIter), nIter = 10; end %number of iterations
 
 %% Main algo
 A = normc(initA); %normalise columns
+[Uinit Sigma] = svd(A);
 G = A'*A; %gram matrix
 
 muMin = sqrt((m-n)/(n*(m-1)));              %Lower bound on mutual coherence (equiangular tight frame)
@@ -40,12 +43,12 @@
 end
 
 % [~, Sigma_gram V_gram] = svd(G); %calculate svd decomposition of gramian
-% Sigma_new = sqrt(Sigma_gram(1:n,:)).*sign(Sigma); %calculate singular values of dictionary
-% A = Uinit*Sigma_new*V_gram';	%update dictionary
+
 % A = normc(A);					%normalise dictionary
 
-[U S] = svd(G);				%calculate svd decomposition of gramian
-A = sqrt(S(1:n,1:n))*U(:,1:n)';		%calculate valid frame, s.t. A'*A=G
+[V_gram Sigma_gram] = svd(G);				%calculate svd decomposition of gramian
+Sigma_new = sqrt(Sigma_gram(1:n,:)).*sign(Sigma); %calculate singular values of dictionary
+A = Uinit*Sigma_new*V_gram';	%update dictionary
 
 % %% Debug visualization function
 % function plotcart2d(A)