2
$\begingroup$

There are lots of questions here about what the negative frequencies in fft mean, but I'm confused on why the second half of the fft calculation is the correct calculation for a negative frequency.

The equation is $$X[k]=\sum_{n=0}^{N-1}x[n]e^{-j2 \pi kn/N}$$

I interpret this as the correlation between a wave with 1 cycle over N, a wave with 2 cycle over N, a wave with 3 cycles over N.

Let say I'm using 10 bins, numpy will tell me the 10th bin is actually representing a negative frequency. But looking at the equation isn't it a correlation between the signal and a signal with 10 cycles over the full period? If they plugged in a negative k into this equation that would make sense. Why does plugging in big values of K give the correlation for a negative frequency?

$\endgroup$

1 Answer 1

3
$\begingroup$

If you say that plugging in a negative value for $k$ would make sense to you then have a look at this:

$$\begin{align}X[N-1]&=\sum_{n=0}^{N-1}x[n]e^{-j2\pi (N-1)n/N}\\&=\sum_{n=0}^{N-1}x[n]e^{-j2\pi n}e^{j2\pi n/N}\\&=\sum_{n=0}^{N-1}x[n]e^{j2\pi n/N}=X[-1]\end{align}$$

The DFT $X[k]$ is periodic with period $N$, so it doesn't matter if you consider the interval $k\in[0,N-1]$, or $k\in[-N/2+1,N/2]$ (assuming $N$ is even).

$\endgroup$
6
  • $\begingroup$ Thanks for the answer, how did you get from step 1 to 2? where did the (N-1) go? $\endgroup$
    – Keatinge
    Jul 13, 2018 at 8:59
  • $\begingroup$ @Keatinge: It's still there! $(N-1)n/N=n-n/N$ $\endgroup$
    – Matt L.
    Jul 13, 2018 at 9:00
  • $\begingroup$ Sorry but could you also explain step 2 to 3? Where did $e^{-j2 \pi n}$ go? $\endgroup$
    – Keatinge
    Jul 13, 2018 at 9:10
  • $\begingroup$ @Keatinge basic math! What is $e^{-j2\pi n}$, as a value, for any $n$?? $\endgroup$ Jul 13, 2018 at 9:18
  • $\begingroup$ @MarcusMüller Oh I see, it's always 1. I was looking for algebra instead of thinking of the unit circle $\endgroup$
    – Keatinge
    Jul 13, 2018 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.