|
发表于 2024-6-7 21:01:23
|
显示全部楼层
clc,clear
addpath('data')
r=zeros(100,41);
t=0:0.1:9.9;
fd=-40:2:40;
time=1:1:20;
z=zeros(1,100);
for c=1:1:100
e=ceil(c/5);
u=mod(c,5);
if (u==0)
u=5;
end
load(sprintf('data_%d.mat',time(e)));
g=length(seq_sur)/5;
k=length(seq_ref)/5;
fs=f_s;
seqsur2=seq_sur(1+g*(u-1):g*u);
seqref2=seq_ref(1+k*(u-1):k*u);
seqsur=newprocessor(seqsur2,fs);
seqref=newprocessor(seqref2,fs);
cors=cor(seqsur,seqref,fs);
for j=1:1:41
x=cors(:,j);
r(c,j)=abs(max(x));
end
z(c)=max(r(c,:));
r(c,:)=r(c,:)./z(c);
% for k=1:1:41
% r(c,k)=log(r(c,k));
% if (r(c,k)<=-1)
% r(c,k)=-1;
% end
% end
% corM=max(max(cors));
% [tau_M_index,fd_M_index]=find(corM==cors);
% r(c,:)=cors(tau_M_index,:);
end
figure
imagesc(fd,t,r),xlabel('Doppler frequency(Hz)'),ylabel('time(s)');
set(gca,'ytick',0:0.5:9.5);
colorbar
axis xy;
title('Time-Doppler Specturm 0.5s 2Hz');
function out=newprocessor(sig,fs)
f_ddc=-3e6;
bandwidth=9e6;
duration=0.1;
seq_ddc_t=sig.*exp(-1i*2*pi*f_ddc*(0:duration*fs-1)/fs);
[b,a]=butter(32,bandwidth/(0.5*fs));
seq_lpf_t=filter(b,a,seq_ddc_t);
out=seq_lpf_t;
end
function cors=cor(seqsur,seqref,fs)
cors=zeros(7,41);
tau=0:1:6;
fd=-40:2:40;
N=length(seqsur);
temp = zeros(length(tau), N);
for t=1:length(tau)
tau=t-1;
ref=circshift(seqref,tau);
temp(t,:)=fftshift(fft(seqsur.*conj(ref)));
end
cors = temp(: , (-19+N/2: 21+N/2));
end
|
|