1

What is the difference in Mathematica between the following:

pts = {{1, 2}, {2, 3}, {8, 2.2}, {4.5, 3.1}, {1, 2}};
toComplex[pts_] := pts[[All, 1]] + I pts[[All, 2]];
(* first *)
Fourier[Transpose@pts, FourierParameters -> {-1, 1}]

(* second *)
Fourier[toComplex@pts, FourierParameters -> {-1, 1}]

They appear to output "close" results, but not exact.

Outputs:

(* first *)
{2.88 + 0. I, -0.892837 + 0.343035 I, 0.202837 - 0.129718 I, 
  0.202837 + 0.129718 I, -0.892837 - 0.343035 I}, {0.42 + 
   0. I, -0.744296 + 0.258626 I, 0.284296 - 0.418465 I, 
  0.284296 + 0.418465 I, -0.744296 - 0.258626 I}}

(* second *)
{3.3 + 2.46 I, -1.72154 + 0.45312 I, 0.198385 - 0.629641 I, 
 0.77588 + 0.466724 I, -1.55272 - 0.750202 I}

I do notice for the transpose DFT if I total it I get

{3.3 + 0. I, -1.63713 + 0.601661 I, 0.487132 - 0.548183 I, 
 0.487132 + 0.548183 I, -1.63713 - 0.601661 I}

Which is pretty close ($3.3$ being the same for the real portion of the first point, other points are "pretty" close).

What is the difference between representing $(x, y)$ points as complex numbers, $x + i y$, vs two lists: one list of the $x$ values and one of the $y$ values in the DFT in Mathematica?

I have seen in the Scope section of the documentation on Fourier that it appears to be a "2D" Fourier transform, however I do not understand what that means as my understanding is that a complex number is a "2D" number.

Alex D
  • 111
  • 1
  • "2D-Fourier transform" of a matrix means that the matrix is interpreted as a bivariate, $\mathbb{R}$-valued function -- not as a univariate , $\mathbb{R}^2$-valued function. – Henrik Schumacher Apr 12 '20 at 07:51
  • So for the first example, the value for $f(n)$ in the definition of the DFT is a single $\mathbb{R}$ value, where for the second example, $f(n)$ returns a $\mathbb{C}$ value? Except the first one is the function with 2 variables as input, presumably the first being row and the second column? – Alex D Apr 12 '20 at 08:05
  • I have to correct myself: "2D-Fourier transform" of a matrix means that the matrix is interpreted as a bivariate, $\mathbb{C}$-valued function -- not as a univariate $\mathbb{C}$-valued function. That is, the function for the array case is interpreted to be of the form $f(m,n$). – Henrik Schumacher Apr 12 '20 at 08:08
  • So with the result being a 2x5 matrix for the first example, how does that relate to the 1D version with the complex number? Is the second row just the strength of the $y$ portion of the signal? – Alex D Apr 12 '20 at 08:17
  • What I tried to say is that the two cases do not relate at all to each other. – Henrik Schumacher Apr 12 '20 at 08:18
  • I suppose my confusion comes from the following two pieces of code:
    1. https://mathematica.stackexchange.com/a/17780/71533
    2. https://mathematica.stackexchange.com/a/171658/71533
    – Alex D Apr 12 '20 at 08:26
  • They seem to be accomplishing the same thing with 1) using a 2D DFT and 2) using a 1D DFT and parameterizing on the Real part and the Imaginary part – Alex D Apr 12 '20 at 08:27

0 Answers0