FFT magnitude & phase conventions used


Vercammen Jan
08-26-2002, 06:30 AM
I have found that I need to scale and adjust the phase (it's
sign) of the numerical recipes FFT routines to make it the same as
the complex exponential form of the Fourier series.

To be specific, I need to adjust the amplitude by 2/N and toggle the sign of the phase to get correct agreement.

I can understand that the amplitude can be scaled, almost often one uses ratioes of spectra and amplitude is not important.

The complex exponentional form positive and negative frequency have complex conjugate values. What I experience is that the numerical recipes FFT routines seem to get the sign of the phase exactly the opposite.

Is this due to conventions used in numerical processing of different disciplines (electrical engineering, signal processing).

It would be nice if someone could confirm this. Bye the way, I am an electricla engineer and I checked the FFT routines for a rectangular pulse (50% duty cycle). The harmonics amplitudes are OK if I divide by 2/N (using code realft) andthe harmonics phase needs a sign change.

I apprecialte any help or comments.

bsharma
01-13-2005, 02:14 PM
I may be seeing something similar. If you have access to MATLAB, can you try it out and see how it responds. FYI, this is what I get on MATLAB:


>> x = [0 1 2 3 ]'

x =

0
1
2
3

>> y = fft(x)

y =

6.0000
-2.0000 + 2.0000i
-2.0000
-2.0000 - 2.0000i

>>

The four1() seems to interchange +positive and negative frequencies.