www.pudn.com > isar2.zip > Alignment_corr.m, change:2010-04-06,size:992b


%% 包络对齐:相关法 
%  输入信号:距离压缩后的回波信号,格式为(Na,nr) 
%  输出信号:距离向包络对齐的信号 
function [sig] =  Alignment_corr( sig ) 
%% adjacent correlational method。using 8 times interp。 
[Na,nr] = size(sig); 
sig_8 = zeros(Na,8*nr); 
for ii = 1:Na 
    sig_8(ii,:) = interp(sig(ii,:),8); 
end 
sig_ref = zeros(1,8*nr); 
sig_ref = abs(sig_8(1,:)); 
for jj = 1:Na-1     
    c = xcorr(sig_ref,abs(sig_8(jj+1,:))); 
    tau = find(c==max(c)); 
    tau = tau-8*nr; 
    if tau < 0 
        sig_8(jj+1,1:8*nr-abs(tau)) = sig_8(jj+1,abs(tau)+1:8*nr); 
%         sig_8(jj+1,8*nr-abs(tau)+1:8*nr) = sig_8(jj+1,1:abs(tau)); 
        sig_8(jj+1,8*nr-abs(tau)+1:8*nr) = 0; 
    else 
        sig_8(jj+1,abs(tau)+1:8*nr) = sig_8(jj+1,1:8*nr-abs(tau)); 
%         sig_8(jj+1,1:abs(tau)) = sig_8(jj+1,8*nr-abs(tau)+1:8*nr); 
        sig_8(jj+1,1:abs(tau)) = 0; 
    end 
    sig_ref=(jj*sig_ref+abs(sig_8(jj+1,:)))/(jj+1);  %mean value 
end 
for ii=1:nr 
    sig(:,ii) = sig_8(:,ii*8); 
end