Sign the fft results

I am trying to calculate MTF from a test target. I calculate the distribution function quite easily, but the FFT results don't make any sense to me. To summarize, the values ​​seem to alternate, which gives me a reflection of what I expect. To check, I used a simple square wave and numpy:

from numpy import fft

data = []
for x in range (0, 20):
    data.append(0)

data[9] = 10
data[10] = 10
data[11] = 10

dataFFT = fft.fft(data)

The results look correct, except for the sign ... As an example for the following four values, I see the following:

30.00000000 + 0.00000000e + 00j

-29.02113033 + 7.10542736e-15j

26.18033989 -1.24344979e-14j

-21.75570505 + 1.24344979e-14j

So my question is: why is positive - negative - positive - negative in the real plane? This is not what I would expect ... I will build it, it almost seems that the correct function is mirrored around the x axis.

. : example image

, : My results

+1
3

FFT ( N/2). "" . , -1 1 FFT, ( FFT). , , .

, FFT , 0 ( N), 1 .

+2

. , , , - .

numpy.abs mag, numpy, angle for phase. sinc(), , . , sinc, expeceted .

+1
  • ,

    python/numpy ( ), , , , / FFT .

    • FFT ,
    • FFT -

    FFT , . Re Im, / FFT.

  • FFT FFT impulse response (Im = 0) , - Re FFT. Im FFT. , y ().

    , FFT , . , :

    mag=sqrt(Re*Re+Im*Im); // power
    ang=atanxy(Re,Im); // phase angle
    

    atanxy(dx,dy) - 4 arctan, atan2, , , atanxy/atan2. my ++ atanxy

[]

, FFT . Re Im :

{ a0,a1,a2,a3,...,a(n-1),a(n-1)...,a3,a2,a1,a0 }

, . , - . , .

+1

All Articles