# Dealing with bias in an FFT for frequency correction

I'm working on using an FFT for frequency correction of a generic modulation signal. My algorithm basically attempts to balance the energy in the positive and negative frequencies of the FFT to be equal. One thing I'm wondering is if I have an inherent bias. Noting the following ordering returned by the bins of the FFT with N even:

After computing the FFT, my algorithm splits up the positive side into the bins $$X_{up} = X[0] +...+ X[N/2 - 1]$$ and the negative side into the bins $$X_{low} = X[N/2] +...+ X[N-1]$$ and then form an error signal as $$e = X_{up} - X_{low}$$

However, I realized this might be resulting in some bias because my positive frequencies are actually including DC, while my negative frequencies are including the nyquist component. So I'm wondering if the correct solution here is to drop both the DC and nyquist bins (I could add them to both the upper and lower terms but since I substract them they'd just cancel anyways) and instead do the following: $$X_{up} = X[1] + ... + X[N/2 - 1]$$ and $$X_{low} = X[N/2 + 1] +...+ x[N-1]$$. This results in an equal number of bins, N/2-1, for both the lower and upper terms and I assume will be unbiased?

• right. Both the DC bin as well as the $N/2$ bin don't have a negative frequency countepart. The $N/2$ bin represents the center of symmetry for your FFT. – dsp_user Nov 20 '20 at 10:35

Your approach is sensible: if $$N$$ is even, you can discard the DC and Nyquist bins, which results in $$N/2-1$$ values at positive and negative frequencies. This will result in a fair comparison.
If $$N$$ is odd, there is no Nyquist bin, and you just discard the DC bin, resulting in $$(N-1)/2$$ values at positive and negative frequencies.