5
$\begingroup$

I have a query about the Fourier utility, that does discrete Fourier transforms. I am unable to find any information on whether different FourierParameters can be used in each dimension. This is a natural thing to do in wave theory where you have $\exp(i (k x-\omega t))$ representations. Is it possible for example to use FourierParameters -> {1, 1} for the first dimension and {1, -1} for subsequent dimensions?

Background information (if useful):

Specifically, I use FourierParameters -> {1, 1} for the time dimension and {1, -1} for two spatial dimensions. I wish to take a Fourier transform of a large (960 × 256 × 256) array where the dimensions are $(t,x,y)$. This works, but is slow.

Ftxy[h_] := Module[{Hxy}, Hxy = Fourier[#, FourierParameters -> {1, -1}] & /@ h;
  Transpose[Map[Fourier[#, FourierParameters -> {1, 1}] &,
    Transpose[Hxy, {3, 2, 1}], {2}], {3, 2, 1}]]

This also works, but is slower

Ftxy3[h_] := With[{n = Length[h]}, N[Exp[-2 π I Range[0, n - 1]/n]]*
   Fourier[Reverse[h], FourierParameters -> {1, -1}]]

The raw 3D Fourier[] is fast, but multiplying through by the complex exponential vector is the slowest part. I tried setting FourierParameters -> {{1, 1}, {1, -1}, {1, -1}}, but that is not accepted.

$\endgroup$
3
  • 1
    $\begingroup$ Maybe f[h_] := RotateRight@Reverse@Fourier[h, FourierParameters -> {1, -1}] $\endgroup$ – Simon Woods May 12 '15 at 20:19
  • $\begingroup$ Thanks Simon. That's very elegant, and fixes my immediate problem. However, the general issue remains of whether different, more general FourierParameters can be used in each dimension rather than applying some sort of post-processing. $\endgroup$ – Paul Cally May 12 '15 at 22:22
  • $\begingroup$ Now, here's a question whose answers I'll be very interested in… $\endgroup$ – J. M.'s ennui May 13 '15 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.