📄 autocorrelationwin.m
字号:
function [x,nfft]=autocorrelationwin(L,S,winid)
% m=power_integer_2(L);
% nfft=2^(m);
nfft=2*L-1;
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
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,:) = 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=-2:.1:2;
% % box off;
% figure(1);
% mesh(time,fdT,x);
% xlabel('sample shift');
% ylabel('Doppler shift fd*T');
% zlabel('Autocorrelation function');
%
% figure(2);
% contour(time,fdT,x);
% xlabel('sample shift');
% ylabel('Doppler shift fd*T');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -