I am currently modeling FMCW (linear FM) and SFCW (stepped FM) chirps in python. For my project, I need to simulate those signals as a transmit chirp and a received one, scattered from point targets at some distance. I think I got it generally right for the linear chirps, where I am generating the transmit signal like this: $$ \begin{aligned} s_{tx}(t) &= \exp(j2\pi(f_c+\frac{\alpha}{2}t)t) \\ &= \exp(j2\pi f_c t + j\pi \alpha t^2) \end{aligned} $$ with $\alpha=B/T$ being the chirp rate, $B$ the total bandwidth, $T$ the chirp duration and $f_c$ the carrier frequency. As an experiment, I tried different ways to model the received signal. Lets say I have a point scatterer at a distance $R$. I get the time delay by: $$ \tau = \frac{2R}{c} $$ where $c$ is my propagation speed. Thus, my received signal should be: $$ \begin{aligned} s_{rx}(t) &= s_{tx}(t-\tau) \\ &= \exp(j2\pi f_c (t-\tau)+j\pi \alpha (t-\tau)^2)\\ &= s_{tx}(t) \cdot \exp(-j2\pi \tau (f_0 + \alpha t - \frac{\alpha}{2}\tau)) \end{aligned} $$ which is nice, since I can just multiply my already generated transmit chirp by a phasor with a frequency component proportional to $\alpha \tau$ and some phase terms.
Another option I was wondering about, is using the fourier transform shift property:
$$
F\{s_{tx}(t-\tau)\}(s) = \exp(-2j\pi s \tau) \cdot F\{s(t)_{tx}\}(s)
$$
From my understanding, calculating the FFT of $s_{tx}(t)$, applying the shift in frequency domain and then performing the IFFT should give me the same result. However, I get different results when I compare both methods.
One difference I could pin out is the phase of the resulting receive signals:
While the one shifted via the model equation (orange) has a smooth phase, the one shifted with the FFT (red) not only has a different trajectory but also some sort of kink that occurs at the time by which the signal has been shifted.
Consequently, I get different results down the line when I do the deramping procedure. Upon deramping via:
$$
s_{if}(t) = s_{rx}(t) \cdot s^*_{tx}(t)
$$
I optain a perfectly fine sinusoidal beat signal with the model-based method, but the FFT-based method has a distinct change:
which results in a secondary frequency component in the spectrum and some significant differences in the phase:
Upon further inspection, the two methods seem to do a different "shift" in time. This can be seen for this example plot of the two resulting shifted versions of the transmit signal. While the model-based shift seems to be symmetric around the time delay, the FFT-based shift looks like it just pushes the end of the chirp back into the beginning (similar to a circular shift)
Note that the plot is zoomed and only the start of the chirp is shown for clarity.
Is there an alternative method that could be used to achieve fine time delays that does not result in this circular shift property?
Cheers!
EDIT For clarification the code to apply the shift in the FFT domain. Its not completely copy & pastable for readability but I hope the steps are clear.
S_tx = fftshift(fft(s_tx*win, n=nFFT)) # nFFT number of FFT points
sRes = fs/nFFT # fs = sampling frequency
sAxis = np.arange(-fs/2, fs/2, sRes)
shift_phasor = np.exp(-2j*pi*sAxis*tDelay)
S_rx = shift_phasor * S_tx
s_rx = ifft(ifftshift(S_rx))