Where does SDR IQ data come from?
The "imaginary" part needs to be captured on the analog side, with a separate mixer that uses a LO source that is exactly 90 degrees offset from the "real" LO.

In the physical world, only real-valued signals can be transmitted, so on your antenna input you have a real-valued time-continuous signal.

If you mix (i.e. multiply) this with your LO signal, the output of that will have zero at any place where either the input or the output signal has a zero-crossing. This means that if you feed a CW signal at the same frequency as your LO, the phase shift between these signals determines what you get on the output.

If you have octave:

x = [ -2*pi : 0.01*pi : 2*pi ];
unshifted = cos(x);
shifted = sin(x);


This defines two signals, unshifted and shifted that are in phase and 90 degrees out of phase with a cosine LO.

Compare:

plot(x, cos(x) .* unshifted);


with

plot(x, cos(x) .* shifted);


The integral of the second function is zero, so a FFT over this data would show no energy in the DC bin -- clearly wrong, since we are transmitting energy at precisely that frequency.

However, if we mix with both the original and a phase-shifted LO, then the RF energy is always visible regardless of phase shift:

plot(x, cos(x) .* unshifted, x, sin(x) .* unshifted);


vs

plot(x, cos(x) .* shifted, x, sin(x) .* shifted);


At the same time, how much of the RF energy went into the "real" and "imaginary" parts after mixing can tell you the phase angle between the two signals, so you can encode information inside the phase angle as well.