📄 autocorrelation_pic_win.m
字号:
function autocorrelation_pic2(L,S,winid)
% 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))];
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.0
col=col+1;
for row=1:nfft
Sr(row)=S(row)*exp(i*2.*pi*(row-1)*fdT/L);
end
x(col,:) = 20*log10( 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;
% subplot(2,1,2);
% contour(time,fdT,x);
% xlabel('sample shift');
% ylabel('Doppler shift fd*T');
% Gtext('Autocorrelation of Frank Sequence of length 100 along with Doppler Shift');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -