Re: discrete Fourier transform
- To: mathgroup at smc.vnet.net
- Subject: [mg121068] Re: discrete Fourier transform
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Fri, 26 Aug 2011 05:22:48 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201108251105.HAA24899@smc.vnet.net>
On 08/25/2011 06:05 AM, tarun dutta wrote: > I have a text file (in my desktop)in which there are two columns one > is time and another is the result as > 0 0.956 > 2 0.265 > ...................etc > now I have to plot the data after doing discrete fourier transform of > this data.how will I do that ? > I used > > data=Import["output.txt", "Table"] > pt=Fourier[data] > ListLinePlot[pt] > but itz not working.can any one help me by giving a solution. > regards, > tarun > Might be you want to take the DFT of the second coordinates. Example: n = 20; data = Transpose[{Range[2, 2*n, 2], RandomReal[{-5, 5}, n]}]; pt = Fourier[data[[All, 2]]]; Next issue is the DFT will have elements with real and imaginary parts. So you'll want to plot them separately. ListLinePlot[{Re[pt], Im[pt]}] Another issue is that the DFT is not in any way accounting for our x coordinates being double the assumed 1,2,...,n. How this gets handled depends on what it is you really need from the transform. Very likely you won't do anything at all, unless and until taking the inverse transform. Daniel Lichtblau Wolfram Research
- References:
- discrete Fourier transform
- From: tarun dutta <tarunduttaz@gmail.com>
- discrete Fourier transform