I am currently working on simulating RF transmissions for beamforming and other applications in Matlab.
One of the fundamental properties that I need to simulate is signal propagation delay due to transmission distance. This can either be done by generating the signal $s(t-\tau)$ with offset $\tau = d / c$ where $c$ is the speed of light and $d$ the transmission distance, or by utilising the Fourier transform property $s(t-\tau) = \mathcal{F}^{-1}(\mathcal{F}(s(t)) \exp(-j2\pi f\tau))$ after the fact.
However, the Fourier transform method produces complex time domain signals in practice. I wanted to confirm whether the imaginary component produced in this instance is a result of insufficient computational precision, or if the imaginary component has some interpretation as an IQ signal (and if so, how to interpret this IQ data given that there's no carrier involved in this process).
Below is a minimum working example in Matlab to demonstrate.
N = 100; % number of data points
t = linspace(0, 2*pi, N+1); t(end) = []; % time vector
dt = t(2) - t(1); % time delta
s = cos(5*t) + cos(3*t) + cos(t); % some baseband signal
fs = 1 / dt; % sample rate
f = linspace(-fs/2, fs/2, N+1); f(end) = []; % frequency vector
tau = 0.5*dt; % chosen delay (fractional sample)
s_delayed = ifft(ifftshift(fftshift(fft(s)) .* exp(-1j*2*pi*f*tau))); % delay in fourier domain
% plot original and delayed signal
figure, plot(t, s)
hold on, plot(t, real(s_delayed));
plot(t, imag(s_delayed));
legend('original', 'real of time delayed', 'imag of time delayed')