# [SciPy-user] Fourier-sine transform with SciPy

Anne Archibald peridot.faceted@gmail....
Fri Jun 6 03:44:07 CDT 2008

2008/6/6 Lubos Vrbka <lists@vrbka.net>:

> i need to perform a discrete fourier transform of a radially symmetric
> function, dependent only on the |r| and |k| in real and fourier space,
> respectively. after some straightforward math, i arrived at the
> expression for the sine transform (continuous transform), namely
> F(k) = A \int_0^\infty f(r) sin(kr) dr (FT)
> f(r) = B \int_0^\infty f(k) sin(kr) dk (iFT)
> with A and B being constant coefficients. naturally this has got the
> advantage of just one function being needed to perform the transform
> (just with different coefficient every time).
>
> the problem is, that i don't know how (and whether it actually is
> posible) to perform this task (discrete sine transform) with scipy.
> searching the google and lists wasn't of much help, either.
>
> i know that for example fftw includes the function for sine and cosine
> transforms, but i didn't find any connection between the fftw functions
> and scipy.fft, that would be younger than several years.

I don't think we have a function that computes discrete sine or cosine
transforms, but if f is real, you can get the sine transform you wrote
as the imaginary part of a complex Fourier transform.

Anne