我对理解FFT以及如何在python中应用它们感到困惑。根据我的理解,将fft应用到10像素的1D阵列应该包含10个数字的列表(“DC”组件的+2):int main(int argc, char*argv[]){
FILE * tube;
char chaine[10];
int errValue = mkfifo("glue", 0666);
perror("mkfifo");
if( errValue < 0){
printf("Error: %d\n", errValue);
exit(EXIT_FAILURE);
}
tube = fopen("glue", "r");
if(tube == NULL)
{
printf("error in opening file :\n");
return 0;
}
while(1){
fgets(chaine, 10, tube);
printf("%s\n", chaine);
}
}
(A_0, P_0, A_1, P_1, A_2, P_2, A_3, P_3, A_4, P_4, A_5, P_5)
其中A_0 = Amplitude of the average value, "DC" \lambda = \infty component
P_0 = Flat wave, so phase doesn't say anything meaningful
A_1 = Amplitude of the fundamental, \lambda = 1a
P_1 = Phase of the fundamental frequency component
A_2 = Amplitude of the first harmonic \lambda = 2a
P_2 = Phase of the first harmonic frequency component
A_3 = Amplitude of the second harmonic \lambda = 3a
P_3 = Phase of the second harmonic frequency component
A_4 = Amplitude of the third harmonic \lambda = 4a
P_4 = Phase of the third harmonic frequency component
A_5 = Amplitude of the Nyquist frequency
P_5 = Phase of the Nyquist
是句号。奈奎斯特频率是1D阵列中存在的最高频率分量。下面的数组长度为10,因此为10像素。可能的最快频率是最大值在像素a
中,最小值在像素i
中。换句话说,10个像素的奈奎斯特频率(i+1
)是5。
查看下面的代码,当我使用f_{Nyq} = pixel_{total}/2
时,我得到10个数字。这10个号码是什么?
np.fft.fft(array)
答案 0 :(得分:1)
不,你的解释是错误的。
a[0]
是卑鄙的。a[1] = np.conjugate(a[-1])
:表示基本a [1] * exp(jwt)+ a [-1] * exp(-jwt)。a[k],a[-k]
代表k-th
谐波。因此傅立叶表示为sum(a[k] exp (kwt)) , k = -n//2 .. n//2
。