I'm trying to wrap my mind around the FT and specifically the IFT:
$$x(t) = \frac{1}{2T}\int_{-\infty}^{\infty}x(\omega)e^{i\omega t}d\omega $$
I understand that they are generalization of the Fourier Series to non-periodic functions, where you take the period to be infinite, and the interval to be 0.
My question is - does it still hold that what you get is, sort-of, a "sum" of sinusoids? The $x(\omega)$ representing the frequency-domain, are the magnitudes of the different frequencies, but how do you get rid of the imaginary part $i$ when expanding $e^{i\omega t}$ using Euler's formula?
Specifically, is there a way to (numerically approximate) the rect function (time domain) by "sampling" of frequencies from the sinc function (frequency domain) and appropriate sinusoids? (To be honest, the sinc function itself is already somewhat similar to the rect, so I think some approximation is possible...)



I think what you are looking for is the Nyquist–Shannon sampling theorem, a striking result of the last century I came to know in a seminar. It roughly says that, if the Fourier transform is zero outside an interval, then you can perfectly reconstrct the function with discrete samples, "summing up" sinc function. The right hypothesis to assume is that your signal has "limited bandwidth". Let me also remark that this is not too restrictive in digital signal processing: since human can sense from $20 Hz$ to $20.000Hz$, it does not make any difference if you cut the Fourier transform to zero outside this interval.
The explicit reconstruction is given by the Whittaker-Shannon interpolation formula: $$x(t) = \sum_{n=-\infty}^{\infty} x(nT) \cdot \text{sinc} \left ( \frac{t-nT}{T} \right ) $$
where $T$ is the sampling time you choose. There is also an explicit bound in how small you should choose $T$ in order to have a perfect approximation: if the frequencies are at most $B$, a sampling time of $T=1/2B$ will perfectly reconstruct the function.
Personally I was strike by the fact that a finite number of samples can give a perfect interpolation, as one intuitively thinks that the fidelity is proportional to how small the sampling time is.