I'm having a problem using numpy's fft function. When rotating it, the answer is giving different from the Fourier transform that I implemented manually and by the tests I did the manual seems correct. I think I'm using fft the wrong way.
import numpy as np
import math as m
def transformada_direta(F,x,N):
c=[]
for k in range (N):
c.append(0)
for k in range (N):
soma=0
for j in range (N):
soma=soma+(F[j]*(np.exp((0-1j)*k*x[j])))
c[k]=soma/(N)
return c
def main():
N=4
T=(2*(np.pi))/N
x=np.linspace(0.0,T*(N-1),N)
F=[]
for j in range (N):
F.append(0)
F[0]=5
F[1]=-1
F[2]=3
F[3]=1
c=transformada_direta(F,x,N)
print(c)
yf=np.fft.fft(F)
print(yf)
main()