压缩感知中贪婪算法之MP和OMP
1、 Matching Pusuit(匹配追踪):
MP是最简单的追踪算法之一,每次只从A中选取一列,每步迭代时就更新该列所对应的系数。但是,MP一般会反复选择矩阵A的同一列,以进一步减小逼近的误差。因此,算法复杂度较高。
Matlab代码实现如下:
function x = CS_MP(y, A, t )
% Matching Pursuit
%
% y = Phi * x
% x = Psi * theta
% y = Phi*Psi * theta
% 令 A = Phi*Psi, 则y=A*theta
[y_rows,y_columns] = size(y);
if y_rows<y_columns
y = y';%y should be a column vector
end
R = y;
for i = 1 : t
AHR = A' * R; % Hermitian Transpose times b is dot product with dictionary vectors
if i==1, x = zeros( size( AHR ) ); end
[~,maxIndx] = max( abs( AHR ) );
alpha = AHR( maxIndx );
x( maxIndx ) = alpha;
R = R