MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: discrete Fourier transform

  • To: mathgroup at
  • Subject: [mg121068] Re: discrete Fourier transform
  • From: Daniel Lichtblau <danl at>
  • Date: Fri, 26 Aug 2011 05:22:48 -0400 (EDT)
  • Delivered-to:
  • References: <>

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 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.


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

  • Prev by Date: Re: Better use of PolynomialReduce?
  • Next by Date: Re: Replace
  • Previous by thread: discrete Fourier transform
  • Next by thread: Re: discrete Fourier transform