'FFTing signal gives a strange output

I've got an Intensity array and corresponding time array.

The intensity array has this shape: I_n=[real0, img0, real1, img1...,] and time_n=[t1,t2...,tn], and am DFT-ing the Intensity (I).

I am not sure if this is obvious, but there is no requirement to input time values in the function, I just included the I array. I get an object of this shape { re:[...], im:[...] }

If I get the idea correctly, FTs do I (t) --> I (f). I am plotting the real part and complex part vs time (though I thought the imaginary part is non-important), expecting to at least get the right shape (some peaks). Instead I get a plot that looks pretty much like a spectra (with peaks) but some of those peaks are negative.

Is there any clear error here? I can't wrap my hear around it so far.

[1]: https://i.stack.imgur.com/MGVO0.png

fft


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source