MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Fourier: Execution time for real and complex arguments


Hi,

I am little curious about the behavior of the
DFT-routine Fourier. Two quesions:

1. Why does Fourier take much more than twice the time
   to calculate the DFT of a list of imaginary/complex
   numbers compared to a equal-length list of real
   numbers (floating-point)?

2. Why does the way I generate a list affect the
   time it takes to run Fourier?

Sample session:

n   = 2^20;
xRe = Table[Random[],{i,n}];
x1  = xRe+I 1.;
x2  = xRe+I Table[1.,{i,n}];

Timing[ y=Fourier[xRe]; ]  (* Real argument *)
Timing[ y=Fourier[x1];  ]  (* Complex argument *)
Timing[ y=Fourier[x2];  ]  (* Complex argument *)
Max[ Abs[x1 - x2] ]
FullForm[x1] - FullForm[x2]
Max[ Abs[ Fourier[x1] - Fourier[x2] ] ]

Out[1]= {1.86 Second,Null}

Out[2]= {4.24 Second,Null}

Out[3]= {10.03 Second,Null}

Out[4]= 0.

Out[5]= 0

Out[6]= 0.


I can understand the difference between Out[1] and
Out[2], but what about Out[3]? Any ideas?
(Where's my mistake? ;-) )

TIA,

--
Martin Johansson
Ericsson Microwave Systems
m.johansson at ericsson.com




  • Prev by Date: Fit[]: how to obtain the parameter values?
  • Next by Date: Re: coloring eveerything outside a circle
  • Previous by thread: Re: Fit[]: how to obtain the parameter values?
  • Next by thread: Re: Fourier: Execution time for real and complex arguments