autopic2.asv
来自「calculation of the autocorrelation peak 」· ASV 代码 · 共 69 行
ASV
69 行
clear, close all;
sqL=10;
p=1;
L=sqL^2;
% t=0:(L-1);
S=frank_seq(sqL,L,p);
% plot(t,angle(S));
% autocorrelation_pic2(L,S,0);
% m=power_integer_2(L);
% nfft=2^(m);
nfft=2*L+1;
% sfft=fft(S,nfft);
% Ac=fftshift(abs(ifft(sfft.* conj(sfft)))/L);
% figure(1);
% time=(-(nfft/2)):1:(nfft/2-1);
% plot(time,Ac);
S=[S, zeros(1,(nfft-L))];
winid=0;
if (winid==0.)
win(1:nfft)=1.;
win=win';
else
if (winid==1.)
win=hamming(nfft);
else
if(winid==2.)
win=kaiser(nfft,pi);
else
if(winid==3.)
win=hann(nfft);
end
end
end
end
x=zeros(41,nfft);
col=0;
for fdT=0:.01:2
col=col+1;
for row=1:nfft
Sr(row)=S(row)*exp(i*2.*pi*(row-1)*fdT/L);
end
x(col,:) = 20*log( fftshift(abs(ifft(fft(Sr).* conj(fft(S)).*win'))/L) );
end
% % test if the autocorrelation figure in the fdT=0 right matched the former Ac computered
% figure(1);
% time=(-(nfft/2)):1:(nfft/2-1);
% plot(time,Ac);
% hold all
% plot(time,x(:,21),'--r');
time=(-(nfft/2)):1:(nfft/2-1);
fdT=0:.01:2;
% box off;
figure(1);
image(time,fdT,x,'CDataMapping','scaled');
xlabel('sample shift');
ylabel('Doppler shift fd*T');
zlabel('Autocorrelation function');
colorbar;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?