user139632
user139632

Reputation: 21

Strange Result from FFT using Scipy

I'm trying to do an FFT of some data (a Gaussian pulse), but I'm finding a strange result. The real and imaginary components of the resultant FFT alternate in sign every index of the array. The absolute values of the arrays, however, are continuous. So, I get something that looks like this:

FFT of Gaussian pulse

Does anybody have an idea on what is causing this? Thanks!

Upvotes: 2

Views: 240

Answers (1)

SleuthEye
SleuthEye

Reputation: 14577

Alternating signs in the frequency domain corresponds to an exp(j*pi*n) complex factor which by the shift theorem corresponds to a time domain circular shift of N/2 samples. Looking at your time domain Gaussian pulse you should notice that the peak indeed appears at N/2 instead of index 0.

Shifting back your time domain Gaussian pulse with ifftshift should give you a pulse centered at 0 whose frequency domain representation does not have this sign alternation.

Upvotes: 6

Related Questions