Fourier Transforms in sage

720 views
Skip to first unread message

Oscar

unread,
Aug 15, 2014, 4:59:45 PM8/15/14
to sage-s...@googlegroups.com
I wanted to calculate some Fourier transforms, and it seems like sage
doesn't have them. I was expecting something on the likes of
mathematica's command

sage: fourier_transform(exp(-I*omega0*t) , t, omega )
sqrt(2*pi)*dirac_delta(omega-omega0)

Am I completely missing how this is done in sage, or is it really missing?

Thank you,

Oscar Lazo.

David Joyner

unread,
Aug 15, 2014, 5:04:08 PM8/15/14
to SAGE support
They are in sympy, which is in Sage:
http://docs.sympy.org/dev/modules/integrals/integrals.html

> Thank you,
>
> Oscar Lazo.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

Emmanuel Charpentier

unread,
Aug 21, 2014, 4:34:45 PM8/21/14
to sage-s...@googlegroups.com
Beware of sympy for fourier transform of unintegrable functions :

This works :

sage: var("x,t,omega")
(x, t, omega)
sage: from sympy import fourier_transform, inverse_fourier_transform
sage: fourier_transform(e^-t^2,t,omega)._sage_()
sqrt(pi)*e^(-pi^2*omega^2)
sage: inverse_fourier_transform(fourier_transform(e^-t^2,t,omega)._sage_(),omega,t)._sage_()
e^(-t^2)

But :

sage: fourier_transform(sin(t),t,omega)._sage_()
0
sage: fourier_transform(sin(t),t,omega,noconds=False)
(0,
 And(Abs(periodic_argument(exp_polar(-I*pi)*polar_lift(omega)**2, oo)) < pi, Abs(periodic_argument(exp_polar(I*pi)*polar_lift(omega)**2, oo)) < pi))


Whereas one could expect a sum of Diracs. This issue is known to Sympy developers (see this question on stackoverflow and the resulting issue in sympy ticket system).

Maybe a similar ticket should be opened for Sage, which has, as far as I know, no way to represent a Dirac or a Heaviside function in SR...

HTH,

--
Emmanuel Charpentier
Reply all
Reply to author
Forward
0 new messages