你如何在python中规范化FFT?

时间:2016-06-17 21:37:17

标签: python numpy fft

我试图在复数值数据数组的python中绘制频率与功率的关系。但是,我似乎无法完全正确地得到这些值。我相信某处存在规范化错误。使用numpy,我拥有的是

datafft = np.fft.fft(dataArray)                 #FFT of the data array (units of volts)
datafft = datafft/np.sqrt(len(datafft))/2/np.pi #Sad attempt at normalization and not correct
datafft = np.fft.fftshift(datafft)              #Shifts the zero-frequency component to the center of the spectrum.

N = len(datafft)                                #Number of data points#

V2 = [datafft[i].real**2+datafft[i].imag**2 for i in range(N)]  #Getting units of volts^2
powdbm  = [10*np.log10(V2[i]*20) for i in range(N)]             #The 20 comes in from a 50Ohm resistor and units of mW overall (1000/50) 

有谁知道规范化应该是什么?

0 个答案:

没有答案