ivan@155: function [Phiout,unhatnz] = dict_update_MOD_cn(x,unhat,cvset) ivan@155: %% Method of Optimized Direction (MOD) Dictionary Update followed by the ivan@155: %% constraint on the column norms %% ivan@155: ivan@155: %% ivan@155: eps = .01; ivan@155: K = x*unhat'*inv(unhat*unhat'+eps*eye(size(unhat,1))); ivan@155: if cvset == 1, ivan@155: K = K*diag(min(sum(K.^2).^(-.5),1)); % Projecting on the convex constraint set ivan@155: else ivan@155: K = K*diag(sum(K.^2).^(-.5)); % Projecting on the Unit-Norm constraint set ivan@155: end ivan@155: ivan@155: %% depleted atoms cancellation %%% ivan@155: [Y,I] = sort(sum(K.^2),'descend'); ivan@155: RR = sum(Y>=.01); ivan@155: Phiout = K(:,I(1:RR)); ivan@155: unhatnz = unhat(I(1:RR),:); ivan@155: ivan@155: end