tags:

views:

143

answers:

2
>> fft([1 4 66])

ans =

  71.0000           -34.0000 +53.6936i -34.0000 -53.6936i

Can someone explain according the result above?

A: 

This is a vector of complex numbers representing your signal in frequency domain.

yuk
Which frequencies does it represent?
Gtker
+3  A: 

EDIT Well that's embarassing. I left out a factor of 2. Updated answer follows...

The Discrete Fourier Transform, which an FFT algorithm computes quickly, assumes the input data of length N is one period of a periodic signal. The period is 2*pi rad. The frequency of the output points is given by 2*n*pi/N rad/sec, where n is the index from 0 to N-1.

For your example, then, 71 is the value at 0 rad/sec, commonly called DC, -34+53.7i is the value at 2*pi/3 rad/sec, and its conjugate is the value at 4*pi/3 rad/sec. Note that by periodicity, 2*pi/3 rad/sec = -2*pi/3 rad/sec = 4*pi/3 rad/sec. So the second half of the spectrum can be regarded as the frequencies from -pi..0 or pi..2*pi.

If the data represents sampled data at a constant sampling rate, and you know that sampling rate, you can convert rad/sec to Hz. Let the sampling rate be deltaT. Its reciprocal is the sampling frequency Fs. Then the period is T = N*deltaT sec = 2*pi rad. 1/T gives the frequency resolution deltaF = Fs/N Hz. Therefore the frequency of the output points is n*Fs/N Hz.

mtrw
The frequency of the output points should be `2 * n*pi/N rad/sec` according to http://en.wikipedia.org/wiki/Discrete_Fourier_transform , right?
Gtker
@Runner - sorry about that, you're absolutely right.
mtrw

related questions