资源简介
KSVD_Matlab_ToolBox,稀疏表示的经典算法
代码片段和文件信息
% KSVD running file
% in this file a synthetic test of the K-SVD algorithm is performed. First
% a random dictionary with normalized columns is being generated and then
% a set of data signals each as a linear combination of 3 dictionary
% element is created with noise level of 20SNR. this set is given as input
% to the K-SVD algorithm.
% a different mode for activating the K-SVD algorithm is until a fixed
% error is reached in the Sparse coding stage instead until a fixed number of coefficients is found
% (it was used by us for the
% denoising experiments). in order to switch between those two modes just
% change the param.errorFlag (0 - for fixed number of coefficients 1 -
% until a certain error is reached).
param.L = 4; % number of elements in each linear combination.
param.K = 10; % number of dictionary elements
param.numIteration = 30; % number of iteration to execute the K-SVD algorithm.
param.errorFlag = 0; % decompose signals until a certain error is reached. do not use fix number of coefficients.
%param.errorGoal = sigma;
param.preserveDCAtom = 0;
%%%%%%% creating the data to train on %%%%%%%%
N = 20; % number of signals to generate
n = 4; % dimension of each data
% SNRdB = 20; % level of noise to be added
% [param.TrueDictionary D x] = gererateSyntheticDictionaryAndData(N param.L n param.K SNRdB);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% initial dictionary: Dictionary elements %%%%%%%%
D=randn(420);
% D =[ 0.9736 0.0777 0.2600 0.0620 -0.2304 -0.7423 -0.5626 -0.3611;
% -1.6218 -1.4809 -1.3147 1.3018 2.1225 -0.4863 -1.4601 0.4708;
% 0.9989 0.6580 0.1184 0.3662 -1.4400 -0.3024 0.3116 1.0625;
% 1.5201 0.2445 0.8431 -0.9663 0.7049 -0.1089 -1.5096 -1.5038]
param.InitializationMethod = ‘GivenMatrix‘;%不需要初始字典
param.initialDictionary=ones(410);
param.displayProgress = 1;
disp(‘Starting to train the dictionary‘);
[Dictionaryoutput] = KSVD(Dparam);
% disp([‘The KSVD algorithm retrived ‘num2str(output.ratio(end))‘ atoms from the original dictionary‘]);
% [Dictionaryoutput] = MOD(Dparam);
% disp([‘The MOD algorithm retrived ‘num2str(output.ratio(end))‘ atoms from the original dictionary‘]);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 12292 2009-12-03 08:02 KSVD.m
文件 954 2007-04-29 10:17 OMP.m
文件 2326 2009-12-05 10:32 demo1.m
文件 1896 2009-12-03 07:43 gererateSyntheticDictionaryAndData.m
----------- --------- ---------- ----- ----
17468 4
- 上一篇:qam16.m211716
- 下一篇:小波变换降噪处理
评论
共有 条评论