[Tutor] fourier transform

Pawel Kraszewski Pawel_Kraszewski at wp.pl
Sat Jul 30 13:31:11 CEST 2005


> Hello, I have a signal that I want to do a fourier transform on. I tried
> using FFT.fft(data).real but I don't understand the output.  what is output
> from this function, and why doesn't it require amplitude and time as
> inputs?

Please write the package you use for FFT. Standard Python doesn't have one. 
Perhaps you use some custom Python? Like Enthought Python? If so, the 
exhaustive guide is delivered with it in CHM (windows help) format.

1. In general FFT algorithms require you to supply just N complex values 
(complex contains both amplitude and phase of signal). If you supply real 
values, the system assumes phase=0 for each sample and takes given value for 
amplitude.

2. You DO supply a time information, you just didn't think of it this way: 
each consecutive sample is taken one fixed clock tick later, so position of 
sample in data gives you the time it was taken.

3. Results of FFT are in the form of complex vector of the same length as 
data. Starting from position 0 it gives you an constant (DC factor), position 
1 an amplitude and phase (remember - complex number gives you both amplitude 
and phase) of wave of the length table/2 and so on. If you take real value of 
this, you discard part of the information. AFAIR - taking real part gives you 
sine component, taking imaginary part gives you cosine component, taking 
absolute value gives you total amplitude and taking angle gives you phase.

4. The answer is symmetrical - usually you take only half of it. I don't 
remember the exact difference between the halves, but you may find it in any 
article on FFT.

Best regards,
 Pawel Kraszewski


More information about the Tutor mailing list