Harmonic distortion of a input signal

Dave Angel davea at davea.name
Sun May 19 21:11:57 EDT 2013


On 05/19/2013 07:36 PM, killybeard91 at gmail.com wrote:
> One more question. Function np.argmax returns max of non-complex numbers ?
> Because FFT array of my signal is complex.
>

It'd be easier to track the thread if you actually replied to the 
message you're responding to, and also if you included some context. 
But I'll paste the latter in here:

Terry Reedy said:
 > Compute the magnitude spectrum:

 >>> spect = abs(np.fft.fft(x)[:25])
 >>> spect
 > array([  0.        ,  31.85194222,   0.        ,  10.67342282,
 >          0.        ,   6.47213595,   0.        ,   4.69726931,
 >          0.        ,   3.73254943,   0.        ,   3.13762901,
 >          0.        ,   2.7436023 ,   0.        ,   2.47213595,
 >          0.        ,   2.28230601,   0.        ,   2.15105461,
 >          0.        ,   2.06487174,   0.        ,   2.01589594,
 > 0.        ])

 > Find the index of the maximum element:

 >>> np.argmax(spect)
 > 1


Notice that argmax's argument is the result of an abs() call.  It's got 
real numbers representing the magnitude of the various complex numbers.

-- 
DaveA



More information about the Python-list mailing list