views:

304

answers:

4

Hey,

I have performed an fft (fast fourier transform) on a time series waveform in Matlab, but I seem to have a weird wave actually in the fourier transform plot, although there are spikes this wave looks like something I'd expect to see only in the time domain. Is there any programming reason why this could happen?

+5  A: 

The Fourier transform is quite similar to the Inverse Fourier Transform. A spike in one is a wave in the other. Hence, if you have one outlier datapoint in your series, you'll have a wave component in the frequency domain.

A possible programming-related issue could be an uninitialized data point, e.g. providing 1023 datapoints to a 1024-point FFT.

MSalters
but Matlab should pad the fft with zeroes if it's not the correct length?
Jon
If the data is, say, a cosine wave, which is 1 at both ends, then an extra zero at the end would be an outlier.
Jason Orendorff
how can I remove outliers then, they seem to be corrupting it.
Jon
+7  A: 

The fft assumes the signal is periodic so you can get some artefacts if the first and last values differ by enough to make that transition look like a step function. You are frequently better off windowing the data to avoid that phenomenon.

--Loren

Loren
+2  A: 

Steve's currently doing a nice series on Fourier transforms on his blog. He's specifically talking about 2D transforms, but you might find his discussion of windowing helpful.

MPG
+5  A: 

Note that the continuous-time Fourier transform of a finite-length signal can have things that look like "spikes" in the frequency domain. See the plots in this post of the continuous-time Fourier transform of a single period of a cosine signal and of ten periods of a cosine signal.

For example, an infinite extent cosine signal has a simple Fourier transform that's a pair of impulses at +/- the cosine frequency. But if you've only got ten periods of the cosine signal, the Fourier transform looks like this:

alt text

Steve Eddins
Exactly. Ringing.
Steve