Frequency spectrum with fft of a real valued array...?

Holger postbox.holger at
Thu Jan 11 17:11:27 CET 2007

Dear all,

I need to do a FFT on an array of 20k real values. Origin of the sampled  
data is a sinus wave with light harmonics.
The goal is an frequency spectrum with the magnitudes of the first 50.  

I addressed python like:

	test_arr = src_data_dict[ channel ][0:19599]
	target_data_dict[ channel ] = FFT.fft(test_arr,n=50,axis=-1)

This results in an array of complex values but with unexpected big  
(much higher than the original signal magnitudes)
How do I get the absolute magnitudes of the harmonics, which are much  
lower than the
resulting absolute values of the coefficients?

The result should be like this:

1.harmonic (50 Hz)		1,0
2.harmonic (100 Hz)	0,01
3.harmonic (100 Hz)	0,08
4.harmonic (100 Hz)	0,0035

at the moment I get a resulting array like:


What does it mean to me? How do I get to the wanted frequenca spectrum???

btw The maximum magnitudes of the original data are app. 70 peak

Thanks in advance for your help!!!

Regards Holger

More information about the Python-list mailing list