• 大小: 3.3MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-29
  • 语言: Matlab
  • 标签: 压缩感知  

资源简介

这是网上找的一份GPSR算法,matlab

资源截图

代码片段和文件信息


close all
% n is the original signal length
n = 2^12;

% k is number of observations to make
k = 2^10;

% number of spikes to put down
% n_spikes = floor(.01*n);
n_spikes = 160;


% random +/- 1 signal
f = zeros(n1);
q = randperm(n);
f(q(1:n_spikes)) = sign(randn(n_spikes1));
%f(q(1:n_spikes)) = randn(n_spikes1);

% measurement matrix
disp(‘Creating measurement matrix...‘);
R = randn(kn);

% orthonormalize rows
R = orth(R‘)‘;

if n == 8192  
   % in this case we load a precomputed
   % matrix to save some time
   load Rmatrix_2048_8192.mat
end
%
disp(‘Finished creating matrix‘);

hR = @(x) R*x;
hRt = @(x) R‘*x;

% noisy observations
sigma = 0; 
y = hR(f) + sigma*randn(k1);

% regularization parameter
tau = 0.005*max(abs(R‘*y));

first_tau_factor = 0.8*(max(abs(R‘*y))/tau);
steps = 5;

debias = 0;

stopCri=3;
tolA=1.e-5;

disp(‘Starting GPSR BB monotonic‘)
[x_BB_monox_debias_BB_monoobj_BB_mono...
    times_BB_monodebias_start_BB_monomse_BB_mono]= ...
         GPSR_BB(yRtau...
         ‘Debias‘debias...
         ‘Monotone‘1...
         ‘Initialization‘0...
         ‘MaxiterA‘10000...
         ‘True_x‘f...
         ‘StopCriterion‘stopCri...
         ‘ToleranceA‘tolA...
         ‘Verbose‘0);
t_BB_mono = times_BB_mono(end);


disp(‘Starting GPSR BB monotonic with continuation‘)
[x_BB_mono_contx_debias_BB_mono_contobj_BB_mono_cont...
    times_BB_mono_contdebias_start_BB_monomse_BB_mono_cont]= ...
         GPSR_BB(yRtau...
         ‘Debias‘debias...
         ‘Continuation‘1...
         ‘ContinuationSteps‘steps...
         ‘FirstTauFactor‘first_tau_factor...
         ‘Monotone‘1...
         ‘Initialization‘0...
         ‘True_x‘f...
         ‘StopCriterion‘stopCri...
         ‘ToleranceA‘tolA...
         ‘Verbose‘0);
t_BB_mono_cont = times_BB_mono_cont(end);

disp(‘Starting GPSR Basic‘)
[x_Basicx_debias_Basicobj_Basic...
    times_Basicdebias_start_Basicmse_Basic]= ...
         GPSR_Basic(yRtau...
         ‘Debias‘debias...
         ‘Initialization‘0...
         ‘MaxiterA‘10000...
         ‘True_x‘f...
         ‘StopCriterion‘stopCri...
         ‘ToleranceA‘tolA...
         ‘Verbose‘0);
t_Basic = times_Basic(end);

disp(‘Starting GPSR Basic with continuation‘)
[x_Basic_contx_debias_Basic_contobj_Basic_cont...
    times_Basic_contdebias_start_Basicmse_Basic_cont]= ...
         GPSR_Basic(yRtau...
         ‘Debias‘debias...
         ‘Continuation‘1...
         ‘ContinuationSteps‘steps...
         ‘FirstTauFactor‘first_tau_factor...
         ‘Initialization‘0...
         ‘True_x‘f...
         ‘StopCriterion‘stopCri...
         ‘ToleranceA‘tolA...
         ‘Verbose‘0);
t_Basic_cont = times_Basic_cont(end);



fprintf(1‘\n\n-------------------------------------------------\n‘)   
fprintf(1‘-------------------------------------------------\n‘)   
fprintf(1‘Problem: n = %g  k = %g number of spikes = %g\n‘nkn_spikes)
fprintf(1‘Parameters: sigma = %g 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        6148  2007-12-04 11:46  .DS_Store
     文件       65126  2007-01-25 13:54  Camera.tif
     文件        7046  2007-09-23 20:49  demo_continuation.m
     文件        5849  2007-07-13 16:40  demo_image_deblur.m
     文件        8489  2007-10-19 16:40  figures_1_2_3.m
     文件        5225  2007-09-12 18:21  figure_4.m
     文件        5276  2007-12-04 11:46  figure_5.m
     文件        2377  2007-07-12 18:41  figure_6.m
     目录           0  2015-10-12 16:54  GPSR_6.0\
     文件        6148  2007-12-04 11:46  GPSR_6.0\.DS_Store
     文件       65126  2007-01-25 13:54  GPSR_6.0\Camera.tif
     文件        1905  2003-10-13 11:06  GPSR_6.0\COMPARE.M
     文件        2257  2002-11-12 15:27  GPSR_6.0\compile.m
     文件         688  2002-11-18 14:11  GPSR_6.0\Contents.m
     文件        3918  2002-11-12 15:30  GPSR_6.0\daubcqf.m
     文件        7046  2007-09-23 20:49  GPSR_6.0\demo_continuation.m
     文件        5849  2007-07-13 16:40  GPSR_6.0\demo_image_deblur.m
     文件        9132  2002-11-12 15:30  GPSR_6.0\denoise.m
     文件        1009  2004-03-01 18:10  GPSR_6.0\ex.m
     文件         409  2004-03-01 14:36  GPSR_6.0\ex1.m
     文件        8489  2007-10-19 16:40  GPSR_6.0\figures_1_2_3.m
     文件        5225  2007-09-12 18:21  GPSR_6.0\figure_4.m
     文件        5276  2007-12-04 11:46  GPSR_6.0\figure_5.m
     文件        2377  2007-07-12 18:41  GPSR_6.0\figure_6.m
     文件        1583  2003-10-13 11:06  GPSR_6.0\find_syll.m
     文件       21922  2008-01-15 16:22  GPSR_6.0\GPSR_Basic.m
     文件       23882  2009-01-16 13:25  GPSR_6.0\GPSR_BB.m
     文件        3117  2002-11-12 15:30  GPSR_6.0\HardTh.m
     文件     1296396  2008-04-30 17:42  GPSR_6.0\immi1.mat
     文件         827  2002-11-12 15:40  GPSR_6.0\INSTALL
     文件         867  2003-10-13 11:10  GPSR_6.0\INSTALL.TXT
............此处省略84个文件信息

评论

共有 条评论