Borrar filtros
Borrar filtros

Orthogonal Matching Pursuit algorithm implementation problem

3 visualizaciones (últimos 30 días)
Navdeep Sony
Navdeep Sony el 22 de Abr. de 2017
Editada: Navdeep Sony el 22 de Abr. de 2017
I am trying to implement orthogonal Matching Pursuit algorithm. The algorithm can be found here.
It says that the residual is orthogonal to the span of selected atoms but I am getting only the first selected atom as orthogonal to the residual. No later selected atoms are coming out to be orthogonal to the residual.
Kindly check the code and explain where Am I doing it wrong?
clc,clear;
dictionary = [1 0; 1/2 sqrt(3)/2; -1/sqrt(2) -1/sqrt(2)]';
t=5;
s=[1;1/2];
r=s;
atoms=zeros(size(dictionary,1),size(dictionary,2));
coefs=zeros(size(dictionary,2),1);
%Normalize the dictionary
for index=1:size(dictionary,2)
dictionary(:,index)=dictionary(:,index)./norm(dictionary(:,index));
end
D=dictionary;
index=[];
while(t>1e-15 && sum(dictionary(:)~=0))%Process while (Eucledian norm > 10^-15)
inner_product=dictionary'*r; %Dot Product
[m,ind]=max(abs(inner_product));
index=[index ind];
atoms(:,ind)=dictionary(:,ind); %Select atom which has maximum inner product
x=(atoms(:,ind)'*atoms(:,ind))\(atoms(:,ind)'*r); %Least Square method
coefs(ind)=x;
r=r-atoms(:,ind)*x;
t=power(norm(r),2);
end
More Links: Contains Screen shots of the same algorithm from different papers:

Respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by