Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to do a Fourier Transform of the following Data, but I'm completely stuck.

Here's what I've done so far:

data = Drop[data, 1];
dat = data /. {x_, y_, z_, w_} -> {x + y/12., 10 z};
ListLinePlot[Abs[Fourier[dat]], PlotRange -> {Automatic, {0, 40}}]

I don't understand why it keeps displaying this weird plot enter image description here

Anyone have any clue what I'm doing wrong? I'm just learning this Fourier thing so I'm real lost.

share|improve this question
Try ListPlot[Abs[Fourier[dat]], PlotRange -> {Automatic, {0, 350}}] Result – Dr. belisarius Mar 12 '14 at 2:47

Fourier does not accept a list of {time, sample} pairs - if you give it a 2D list it will do a 2D transform. Therefore you need to use Fourier on just the list of samples. To get the correct frequency scale on the plot you can use DataRange.

data = Import["", "Table"];

dat = Rest[data] /. {x_, y_, z_, _} :> {x + y/12., 10 z};

n = Length[dat];
t = dat[[2, 1]] - dat[[1, 1]];
fourierdata = Abs @ Fourier[dat[[All, 2]]];

ListLinePlot[fourierdata[[;; 1 + n/2]],
 DataRange -> {0, 1/(2 t)},
 PlotRange -> {{0, 0.5}, {0, 10000}}]

enter image description here

share|improve this answer
+1 I can't figure out how I was able to avoid seeing DateRange in the docs. – bobthechemist Mar 12 '14 at 14:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.