资源简介
稀疏分解;ksvd算法;matlab代码
代码片段和文件信息
function [Dictionaryoutput] = KSVD(...
Data... % an nXN matrix that contins N signals (Y) each of dimension n.
param)
% =========================================================================
% K-SVD algorithm
% =========================================================================
% The K-SVD algorithm finds a dictionary for linear representation of
% signals. Given a set of signals it searches for the best dictionary that
% can sparsely represent each signal. Detailed discussion on the algorithm
% and possible applications can be found in “The K-SVD: An Algorithm for
% Designing of Overcomplete Dictionaries for Sparse Representation“ written
% by M. Aharon M. Elad and A.M. Bruckstein and appeared in the IEEE Trans.
% On Signal Processing Vol. 54 no. 11 pp. 4311-4322 November 2006.
% =========================================================================
% INPUT ARGUMENTS:
% Data an nXN matrix that contins N signals (Y) each of dimension n.
% param structure that includes all required
% parameters for the K-SVD execution.
% Required fields are:
% K ... the number of dictionary elements to train
% numIteration... number of iterations to perform.
% errorFlag... if =0 a fix number of coefficients is
% used for representation of each signal. If so param.L must be
% specified as the number of representing atom. if =1 arbitrary number
% of atoms represent each signal until a specific representation error
% is reached. If so param.errorGoal must be specified as the allowed
% error.
% preserveDCAtom... if =1 then the first atom in the dictionary
% is set to be constant and does not ever change. This
% might be useful for working with natural
% images (in this case only param.K-1
% atoms are trained).
% (optional see errorFlag) L... % maximum coefficients to use in OMP coefficient calculations.
% (optional see errorFlag) errorGoal ... % allowed representation error in representing each signal.
% InitializationMethod... mehtod to initialize the dictionary can
% be one of the following arguments:
% * ‘DataElements‘ (initialization by the signals themselves) or:
% * ‘GivenMatrix‘ (initialization by a given matrix param.initialDictionary).
% (optional see InitializationMethod) initialDictionary... % if the initialization method
%
评论
共有 条评论