Re: Problem with the zero-term of Fourier[]
- To: mathgroup at smc.vnet.net
- Subject: [mg19634] Re: Problem with the zero-term of Fourier[]
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Mon, 6 Sep 1999 04:20:47 -0400
- Organization: University of Western Australia
- References: <7qsftj$17c@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hans Steffani wrote: > If have a long list of measured values in ixr. > (Plus@@ixr)/Sqrt[Length[ixr]] > gives > -146.263 > > but > Fourier[ixr][[1]] > gives > -56.1317-3.03437 I > > which is complex although it should be real (ixr is a list of > real numbers) and it is different from the first term althugh > it should be the same. Assuming that ixr is real then I can only guess that the problem arises from the bug with packed arrays of complex numbers? I don't see this behaviour though. For the list In[1]:= ixr=Table[Random[], {20000}]; here is the DC term, In[2]:= Plus @@ ixr/Length[ixr] Out[2]= 0.498249 which agrees with the Fourier result: In[3]:= Chop[Fourier[ixr][[1]]/Sqrt[Length[ixr]]] Out[3]= 0.498249 > I also tried > 1/Sqrt[Length[ixr]] * > Sum[ixr[[tau]] Exp[2 Pi I(tau-1)(1-1)/Length[ixr]],{tau,Length[ixr]}] > which also gives -146.263 In[4]:= Sum[ixr[[tau]]*E^((2*Pi*I[tau - 1]*(1 - 1))/Length[ixr]), {tau, 1, Length[ixr]}]/Length[ixr] Out[4]= 0.498249 > What is the problem? You need to use the appropriate normalization in each case. ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________