I would like to simulate a FMCW radar in the frequency domain. I used the code (Matlab) I attached below. Specially I am interested in the phase spectrum of the beat signal. In a further research I would like to calculate the response of the FMCW signal when it is hitting a dielectric slab. But for now I want to start with a simple example, a single target in a certain distance.
I believe the code is working, but I have the following problems:
The phase spectrum over the range is depending on the sample frequency. Why is that and how can I avoid that?
I am not quite sure if the phase response over the range is correct, does anyone have an idea what to expect?
This is just an 1-D simulaion, but in the future I want to extend it to 2-D. Is there a way to run the code faster?
Is there another way of attacking this simulation problem in Matlab?
%% function ProperShiftChirp clear all; clc; %generate FMCW Signal c=299792458; f_start=65e9; f_end=90e9; fc=80e9; lambda=c/fc; B=f_end-f_start; T=4e-6; %Duration for one sweep; PRI=T; R=0.5; %distance target [m] td=R/c; %roundtrip simple [s] fs=2*B; slope=B/T; t=-T/2:1/fs:T/2; %Generate ChirpSignal sig_transmit=exp(1i*(pi.*slope.*t.^2)); %frequency domain a=nextpow2(length(sig_transmit)); xfft=fft(real(sig_transmit),2.^a); %scaling frequency domain df=fs/length(xfft); freq=(0:df:fs-df); % transfer function absxfft=abs(xfft); phasexfft=angle(xfft); S=absxfft.*exp(1i.*phasexfft).*(exp(-1i*2*td*2*pi.*freq)); %mixing transmitted and received signal erg=fftshift(fft(ifft(xfft).*ifft(S))); %single band idx=(length(erg)/2); abserg=abs(erg(idx:end)); phaserg=angle(erg(idx:end)); meterabs1=(c*freq(1:idx+1))./(2*slope); figure;plot(meterabs1,abserg); xlim([0 R+0.2*R]); xlabel('metre');ylabel('|S|') figure;plot(meterabs1,(unwrap(phaserg))); xlabel('metre');ylabel('rad')