Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FFT
#1
I have a question about the FFT, sorry if it is quite trivial but I've not reaaly understand where is the mistake.
I want calculte the FFT of the normal  pdf.

The point is that when I compare it whith the correct analitic answer it is different.
def normal(x,sigma,mu):
    return 1./np.sqrt(2*np.pi*sigma**2)*np.exp(-1*(x-mu)**2/(2*sigma**2))

def cfnormal(x,sigma,mu):
    return np.exp(1j*mu*x-0.5*sigma**2*x**2) #char. func. of the normal random variable



x=np.linspace(-100,100,500)

normalvec= normal(x,1,0)

fft=np.fft.fft(normalvec)

print cfnormal(x,1,0)-fft
Where is the error?
And, assuming I want perform the convers task -invert the charateristric function with ifft-
what should I do??

Thank you for the kind attention.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020