广义正交匹配追踪(Generalized OMP, gOMP)算法可以看作为OMP算法的一种推广,由文献[1]提出,第1作者本硕为哈工大毕业,发表此论文时在Korea University攻读博士学位。OMP每次只选择与残差相关最大的一个,而gOMP则是简单地选择最大的S个。之所以这里表述为“简单地选择”是相比于ROMP之类算法的,不进行任何其它处理,只是选择最大的S个而已。
下图为论文中提出的算法伪代码流程:

1 gOMP重构算法流程

参考文献的代码如下所示:

(1)构造K稀疏信号

% Generate K-sparse vector
%
% N : original signal size.
% K : sparsity level
%
% Output parameters
% x_omp : estimated signal
% iter_count: iteration count during estimating
%
% Written by Suhyuk (Seokbeop) Kwon
% Information System Lab., Korea Univ.
% http://isl.korea.ac.kr
function [x x_pos] = islsp_GenSparseVec(N, K)
KPos = K;
if N/2 < K
KPos = N-K;
end
randPos = ceil(N*rand( KPos, 1 ));
randPos = union(randPos,randPos);
leftPOsLen = KPos-length(randPos);
while leftPOsLen > 0
tmpPos = ceil(N*rand( leftPOsLen, 1 ));
randPos = union(tmpPos,randPos);
leftPOsLen = KPos-length(randPos);
end
if KPos < K
randPos = setxor((1:N), randPos);
end
x = zeros( N, 1 );
x(randPos) = randn( K, 1 );
x_pos = randPos;
end

(2)gOMP函数

% Estimate the sparse signal x using generalized OMP
%
% y : observation
% Phi : sensing matrix
% K : sparsity
% S : selection length
%
% Output parameters
% x_omp : estimated signal
% iter_count: iteration count during estimating
%
% Written by Suhyuk (Seokbeop) Kwon
% Information System Lab., Korea Univ.
% http://isl.korea.ac.kr
function [x_ommp iter_count] = islsp_EstgOMP(y, Phi, K, S, zero_threshold)
% Check the parameters
if nargin < 3
error('islsp_EstgOMP : Input arguments y ,Phi and K must be specified.');
end if nargin < 4
S = max(K/4, 1);
end if nargin < 5
zero_threshold = 1e-6;
end
% Initialize the variables
[nRows nCols] = size(Phi);
x_ommp = zeros(size(Phi,2), 1);
residual_prev = y;
supp = [];
iter_count = 0;
while (norm(residual_prev) > zero_threshold && iter_count < K)
iter_count = iter_count+1;
[supp_mag supp_idx] = sort(abs(Phi'*residual_prev), 'descend');
supp_n = union(supp, supp_idx(1:S));
if (length(supp_n) ~= length(supp)) && (length(supp_n) < nRows )
x_hat = Phi(:,supp_n)\y;
residual_prev = y - Phi(:,supp_n)*x_hat;
supp = supp_n;
else
break;
end
end
x_ommp(supp) = Phi(:,supp)\y; if nargout < 2
clear('iter_count');
end
end

(3)测试主函数

% Measurements size
m = 50;
% Signal size
N = 100;
% Sparsity level
K = 20;
% Generate sensing matrix
Phi = randn(m,N)/sqrt(m);
% Generate sparse vector
[x x_pos] = islsp_GenSparseVec(N, K);
y = Phi*x;
% Using default parameters
[x1 itr1] = islsp_EstgOMP(y, Phi, K);
% Find the sparse vector via selecting 4 indices
[x2 itr2] = islsp_EstgOMP(y, Phi, K, 4);
% Find the sparse vector via selecting 4 indices until the residual becomes 1e-12
[x3 itr3] = islsp_EstgOMP(y, Phi, K, 4, 1e-12);
disp('Mean square error');
[mse(x-x1) mse(x-x2) mse(x-x3)]
disp('Iteration number');
[itr1 itr2 itr3]
参考文献:
[1] Jian Wang, Seokbeop Kwon,Byonghyo Shim.  Generalized orthogonal matching pursuit, IEEE Transactions on Signal Processing, vol. 60, no. 12, pp.6202-6216, Dec. 2012.
Available at: http://islab.snu.ac.kr/paper/tsp_gOMP.pdf
[2] http://islab.snu.ac.kr/paper/gOMP.zip

最新文章

  1. sql server中对xml进行操作
  2. printf对齐
  3. broadcom移植到openwrt总结
  4. Java学习之ConcurrentHashMap实现一个本地缓存
  5. PetaPoco入门(二)
  6. LeetCode Product of Array Except Self (除自身外序列之积)
  7. memcache分布式实现、memcache分布…
  8. About USB Data Link Cable API
  9. express设置ejs并将后缀改为html
  10. Qt WebEngine 网页交互
  11. 《JavaScript高级程序设计》读书笔记 ---理解对象
  12. MySQL外键的作用和创建
  13. 用Composer获取第三方资源总是失败咋办?
  14. 2-4、配置Filebeat使用logstash
  15. 201903&lt;&lt;高效15法则&gt;&gt;
  16. App专项测试之弱网测试
  17. excel追加数据
  18. slf4j+logback搭建超实用的日志管理模块
  19. android开发之Tabhost刷新
  20. oracle--合并行数据(拼接字符串),获取查询数据的前3条数据...

热门文章

  1. Spark SQL数据载入和保存实战
  2. [NPM] npm check to update the dependencies
  3. Ubuntu使用adb连接android手机失败unknown的解决的方法
  4. mac下配置phonegap(cordova)5.1.1开发环境
  5. oracle技术总结
  6. 全局最小割模版 n^3
  7. JS表格分页组件:fupage的设计思路和详细使用方法(未来考虑开源,争取在2015年)
  8. 扩展HtmlHelper
  9. HDU 5302(Connect the Graph- 构造)
  10. 2016/2/24 css画三角形 border的上右下左的调整 以及内区域的无限变小 边界透明