       Fourier: Execution time for real and complex arguments

• To: mathgroup at smc.vnet.net
• Subject: [mg31824] Fourier: Execution time for real and complex arguments
• From: Silvia Raffaelli <silviar at elmagn.chalmers.se>
• Date: Wed, 5 Dec 2001 06:51:48 -0500 (EST)
• Organization: Chalmers University of Technology
• Sender: owner-wri-mathgroup at wolfram.com

```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.86 Second,Null}

Out= {4.24 Second,Null}

Out= {10.03 Second,Null}

Out= 0.

Out= 0

Out= 0.

I can understand the difference between Out and
Out, but what about Out? 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