www.pudn.com > LBG_GA.rar > disdis_1.m, change:2011-04-07,size:434b


function  Dist=disdis_1(x,y) 
%x为提取取的特征矢量318*12;y为码本库特征矢量32*12; 
%y为两个特征矢量的相似度比较后的值 
 
N=size(x,1); 
N1=size(x,2); 
M=size(y,1); 
dis=zeros(M,N1); 
diss=zeros(1,M); 
dist=zeros(1,N); 
Dist=0; 
  
for i=1:N 
    for j=1:M 
        for k=1:N1 
            dis(j,k)=(x(i,k)-y(j,k))^2; 
        end 
        diss(j)=sum(dis(j,:),2)/N1; 
    end 
    dist(i)=min(diss); 
end 
Dist=sum(dist)/N; 
end