Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

FMCW RANGE DOPPLER MAP

clear all
close all
clc;

R=40; %jarak mula-mula


v=40; %kecepatan target

R_max=200; %jarak maksimal


c=3e8; %kecepatan cahaya
Swp_Tm =5.5*range2time(R_max,c);%syarat sweep time optimal 5-6x waktu
pantulan
fc=77e9; %frekuensi
BW=150e6; %bandwidth sweep
Slope=BW/Swp_Tm; %sweep rate
D=128; %jumlah doppler cell atau jumlah chirp yang
dikirimkan
N=2^10; %jumlah sampling dalam 1 periode chirp
t=linspace(0,D*Swp_Tm,D*N); %waktu total
Tx=zeros(1,length(t)); %array sinyal kirim
Rx=zeros(1,length(t)); %array sinyal terima
td=zeros(1,length(t)); %array delay

for i = 1:length(t)
td(i)=2*(R+v*t(i))/c; %persamaan delay
while t(i)>Swp_Tm
t(i)=t(i)-Swp_Tm;
end
Tx(i)=cos(2*pi*((fc*t(i))+((Slope*t(i).^2)/2)));
%FMCW transmit
Rx(i)=cos(2*pi*((fc*(t(i)-td(i)))+((Slope*(t(i)-td(i)).^2)/2)));
%FMCW received
mixed(i)=0.5*cos(2*pi*(fc*td(i)+Slope*td(i)*t(i)-((Slope*(td(i)^2))/2)));
%Sinyal hasil perkalian Tx dan Rx
end

mixer=(Tx.*Rx); %perkalian sinyal kirim dan sinyal terima atau IF signal

figure ('Name','Transmitted, Received and Beat Signals');


subplot(3,1,1);
plot(t,Tx);axis tight; %plot sinyal kirim
title ('Transmitted Signal');
subplot(3,1,2);
plot(t,Rx);axis tight; %plot sinyal terima
title ('Received Signal');
subplot(3,1,3);
plot(t,mixer);axis tight; %plot sinyal IF
title ('IF Signal');

mix1=reshape(mixer,[length(mixer)/D,D]); %reshape matrix sinyal IF dimana


tiap baris menunjukkan data pada tiap periode dan tiap kolom menunjukkan data
tiap chirp
mix2=reshape(mixed,[length(mixed)/D,D]); %reshape matrix sinyal IF yg
disederhanakan dimana tiap baris menunjukkan data pada tiap periode dan tiap
kolom menunjukkan data tiap chirp
[Mx,Nx]=size(mix1); %menentukan ukuran matrix hasil
reshape setelah di transpose
range = periodogram(mix1); %Fungsi power spectral density
estimation sebagai pembanding hasil fft
nfft = 2^nextpow2(Mx); %Ukuran FFT
R_FFT = fft(mix1,nfft); %Fungsi FFT terhadap isyarat IF
fx=linspace(-BW/2,BW/2,nfft);
R_FFT1 = fftshift(fft(mix2,nfft)); %Fungsi FFT terhadap isyarat IF
figure ('Name','Range from First FFT')
subplot(3,1,1); %power spectral density estimate
plot(range);
title ('Power Spectral Density');
axis tight;
subplot(3,1,2); %plot hasil fft sinyal mix1 dengan menggunakan fungsi fft
plot(fx,abs(fftshift(R_FFT)));
axis tight;
title('Range FFT');
xlabel('Range-Frequency');
ylabel('|Amplitude|');
subplot(3,1,3); %plot hasil fft sinyal mixed dengan menggunakan fungsi
fft
plot(fx,abs(R_FFT1));
axis tight;
title('Range FFT');
xlabel('Range-Frequency');
ylabel('|Amplitude|');

%DOPPLER FROM 2ND FFT


Dop=fftshift(fft(R_FFT')); %Second FFT for Doppler information
[My,Ny]=size(Dop);
p=2*fc*R_max/c;
Range=linspace(-BW/2,BW/2,Ny);
doppler=linspace(-p/2,p/2,My);
figure ('Name','Range and Doppler after 2nd FFT');
subplot(2,1,1); %plot kecepatan
plot(doppler,abs(Dop'));
ylabel('Amplitude');
xlabel('Velocity-Frequency');title ('Doppler Map');
axis tight;
subplot(2,1,2); %plot jarak
plot(Range,abs(Dop));
xlabel('Range-Frequency');
ylabel('Amplitude');
axis tight;title ('Range Map');
figure('Name','Range-Doppler map'); %plot jarak dan doppler
contour(Range,doppler,abs(Dop));
axis tight;
grid on;
xlabel('Range-Frequency');
ylabel('Velocity-Frequency');
grid minor;

You might also like