Re: Fourier frequencies
- To: mathgroup at smc.vnet.net
- Subject: [mg43428] Re: [mg43401] Fourier frequencies
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Wed, 17 Sep 2003 07:58:44 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Friday, August 29, 2003, at 07:16 AM, akpovo wrote:
> Hello to all,
> How possible is it to compute a fourier transform of a data set {t,x}
> in
> order to have the fourier coefficient and the corresponding frequency?
> Tahnks
>
>
The Fourier Transform is computed as normal
Fourier[x]
Traditionally the 0 frequency is placed in the center of the spectrum,
after an FFT though it is at the left so we rotate the data:
RotateRight[Fourier[x],Quotient[Length[x],2]
The frequencies are determined from the time with the following function
freq[t_]:=With[{tau=t[[2]]-t[[1]],n=Length[t]},Table[-tau/2+i/(n
tau),{i,0,n-1}]
You can the use ListPlot to get the spectrum, assuming the data is in
the list x and the times in the list t
ListPlot[Transpose[{freq[t],RotateRight[Fourier[x],Quotient[Length[x],2]
]}],PlotJoined->True]
Regards,
Ssezi