1

I have a (theoretical) algorithm I want to implement in python. In this algorithm I have a start function called f, and I have to apply the fourier transformation and the inverse fourier transformation several times on this function. Is there a way to do that in python? I only found the DFT, where my function has to be several discrete points (and not a continuous function). Is it possible to create a fourier transformation function in python which can handle a continuous function? Or should I rather generate a huge amount of points representing the function, and then calculate the FT and IFT of them?

The function is:

A(z,t) = C* exp(i*z*N^2/2L)/(cosh(t/T)) 
Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555
arc_lupus
  • 3,942
  • 5
  • 45
  • 81
  • Please add a link to the FT and add your function. – User Mar 30 '15 at 12:13
  • @User: What do you mean with "add a link to the FT"? Should I link to Wikipedia? – arc_lupus Mar 30 '15 at 12:19
  • Yes. Two people do not understand your question. It could be because of that. Also this is a programming forum, no math forum. So you would need to write a Python function if that is possible. I do not know of any Fourier Transform that is not discrete so I will not be of help. – User Mar 30 '15 at 12:22
  • 2
    I don't think there's any need to link to the Fourier transform Wikipedia page, @User. If people don't know what it is then they can't answer this question. – MJeffryes Mar 30 '15 at 12:24
  • @arc_lupus You should change how you are describing your function. Mathjax isn't supported on Stackoverflow. – MJeffryes Mar 30 '15 at 12:30
  • 1
    Do you know [sympy](http://www.sympy.org/en/index.html)? – Phillip Mar 30 '15 at 12:39
  • @Phillip: Sounds really interesting, I'll take a look! – arc_lupus Mar 30 '15 at 13:09
  • @Phillip: Unfortunately sympy is not able to calculate the FT in a sufficient way... – arc_lupus Mar 30 '15 at 13:37
  • What is unsufficient about how sympy calculates the fourier transform? – TheBlackCat Mar 30 '15 at 14:44
  • When I tried to calculate the FT from exp(-a|t|), I got a huge list with separate solutions divided in small parts instead the usual result formula. – arc_lupus Mar 30 '15 at 15:17
  • @TheBlackCat: I get as a result: `Piecewise((1/(tau*(1 + 2*I*pi*w/tau)) + 1/(tau*(1 - 2*I*pi*w/tau)), And(Or(And(Abs(periodic_argument(exp_polar(-I*pi/2)*polar_lift(w), oo)) < pi/2, Abs(periodic_argument(tau, oo)) < pi/2), And(Abs(periodic_argument(exp_polar(-I*pi/2)*polar_lift(w), oo)) < pi/2, Abs(periodic_argument(tau, oo)) <= pi/2), And(Abs(periodic_argument(exp_polar(-I*pi/2)*polar_lift(w), oo)) <= pi/2, Abs(periodic_argument(tau, oo)) < pi/2)), Or(And(Abs(periodic_argument(exp_polar(I*pi/2)*polar_lift(w), oo)) < pi/2, Abs(periodic_argument(tau, oo)) < pi/2), ... )` – arc_lupus Mar 30 '15 at 15:29
  • What is the equation you use? – TheBlackCat Mar 30 '15 at 15:36
  • `integrate(exp(-tau*abs(t))*exp(-I*2*pi*t*w), (t, -oo, oo))` @TheBlackCat – arc_lupus Mar 30 '15 at 15:40
  • 2
    Why aren't you just using the `fourier_transform` function? – TheBlackCat Mar 30 '15 at 15:42
  • Because I did not know that such a function exists... Thanks! – arc_lupus Mar 30 '15 at 16:27

0 Answers0