How do I obtain the frequencies of each value in an FFT?

前端 未结 5 1266
轮回少年
轮回少年 2020-11-21 07:48

I have an FFT result. These are stored in two double arrays: a real part array and an imaginary part array. How do I determine the frequencies that correspond t

5条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-21 08:23

    The FFT output coefficients (for complex input of size N) are from 0 to N - 1 grouped as [LOW,MID,HI,HI,MID,LOW] frequency.

    I would consider that the element at k has the same frequency as the element at N-k since for real data, FFT[N-k] = complex conjugate of FFT[k].

    The order of scanning from LOW to HIGH frequency is

    0,
    
     1,
     N-1,
    
     2,
     N-2
    
     ...
    
     [N/2] - 1,
     N - ([N/2] - 1) = [N/2]+1,
    
     [N/2]
    

    There are [N/2]+1 groups of frequency from index i = 0 to [N/2], each having the frequency = i * SamplingFrequency / N

    So the frequency at bin FFT[k] is:

    if k <= [N/2] then k * SamplingFrequency / N
    if k >= [N/2] then (N-k) * SamplingFrequency / N
    

提交回复
热议问题