<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Century Gothic" size=2>I'm having trouble with the fast
fourier transform function ("fft"). Apparently, I'm not understanding what
R's function is actually doing, let me show you with the example in the R
manual:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2>if I put in:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2> y <-
1:4</FONT></DIV>
<DIV><FONT face="Century Gothic" size=2> fft(x)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2>i'll get this back:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2>10+0i
-2+2i -2+0i -2-2i</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2>this is what I'm assuming:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2>R is interpreting the increasing values
of y to have an associated value that is incremented as x increases (a plot
will show y against an index, so in this case we have something like y=x
over the interval 1 to 4).</FONT></DIV>
<DIV><FONT face="Century Gothic" size=2>The real value returned represents the
coeffient of the cosine value, the imaginary value that of the sine, for n=0 to
N-1 where N is the number of data points and n is the coeffient inside the
sine/cosine terms, so that the output would be interpreted as:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2>10 - 2 cos(2 pi*x) + 2 sin (2 pi * x) -2
cos (4 pi * x) -2 cos(6 pi * x) - 2 sin (6 pi * x)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Century Gothic" size=2>which looks nothing like y=x over the
interval (1,4).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Basically, I want to be able to fit fast fourier
transforms to several sets of empirical data. Controlling the period would
also be important here, and the R function does not seem to have a way of
handling that. I would appreciate any information on what this function is
actually doing, or information on other R packages that are able to do
transforms.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thank you for taking the time to look at
this,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Michael Olsen</FONT></DIV></BODY></HTML>