Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4570

Re: discrete Fourier transform

From Daniel Lichtblau <danl@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: discrete Fourier transform
Date 2011-08-26 09:25 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j37oqq$4gd$1@smc.vnet.net> (permalink)
References <201108251105.HAA24899@smc.vnet.net>

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: discrete Fourier transform Daniel Lichtblau <danl@wolfram.com> - 2011-08-26 09:25 +0000

csiph-web