Re: Re: fourier ( FFT )

*To*: mathgroup at smc.vnet.net*Subject*: [mg52269] Re: [mg52254] Re: fourier ( FFT )*From*: Sseziwa Mukasa <mukasa at jeol.com>*Date*: Sat, 20 Nov 2004 03:41:39 -0500 (EST)*References*: <200411100945.EAA11193@smc.vnet.net> <cmve3o$sh2$1@smc.vnet.net> <200411180644.BAA10601@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

On Nov 18, 2004, at 1:44 AM, bar at ANTYSPAM.ap.krakow.pl wrote: > Sseziwa Mukasa <mukasa at jeol.com> wrote: > >>> How can I use Mathematica to obtain frequencies ? >>> Fourier[] works on only one list! > >> See >> http://forums.wolfram.com/mathgroup/archive/2003/Sep/msg00062.html. > Hi, > > example: > I have two series: > t=Table[tt,{tt,0,10,0.01}]; > x=Table[Sin [A t],{t,0,10,0.01}]; > > I expected maximum peak on frequence Omega=A ( omega = 2 Pi/T, not > 1/T) > > It must be independece on density (0.01) and length (10) > > > I need that to analyse of solution differential equation > that look like a chaotic. If you are using a Discrete Fourier Transform the maximum value will occur at a frequency that necessarily depends on the sampling rate (density) and data point length since the discrete frequencies used as a basis depend explicitly on those values. If it is possible you should use a Continuous Fourier Transform which is the FourierTransform expression in Mathematica. On the other hand, the discrete transform can provide a reasonable estimate given enough data points, for example: A = 2 ¹ 20; t = Table[tt, {tt, 0, 10, 0.01}]; x = Table[Sin [A t], {t, 0, 10, 0.01}]; s = RotateRight[Fourier[x], Quotient[Length[x], 2]]; w = Table[-1/(2 (t[[2]] - t[[1]])) + i/ (Length[t] (t[[2]] - t[[1]])), {i, 0, Length[t] - 1}]; ListPlot[Transpose[{w, Abs[s]}], PlotJoined -> True, PlotRange -> All]; ListPlot[Transpose[{2 ¹ w, Abs[s]}], PlotJoined -> True, PlotRange -> All]; will generate two plots, one in units of 1/T and one in units of 2 pi/T both of which give a reasonable estimate of A. If your signal is real only (as in this case you can discard the (anti)symmetric portion of the spectrum as follows: s = Take[Fourier[x], Quotient[Length[x], 2]]; w = Table[i/(Length[t] (t[[2]] - t[[1]])), {i, 0, Quotient[Length[t], 2] - 1}]; ListPlot[Transpose[{w, Abs[s]}], PlotJoined -> True, PlotRange -> All]; ListPlot[Transpose[{2 ¹ w, Abs[s]}], PlotJoined -> True, PlotRange -> All]; For more accurate estimates I suggest looking at the literature on reconstruction of sampled signals. Regards, Ssezi

**References**:**fourier ( FFT )***From:*bar@ANTYSPAM.ap.krakow.pl

**Re: fourier ( FFT )***From:*bar@ANTYSPAM.ap.krakow.pl