3
$\begingroup$

Assume FFT of $x[n]$ is $X(k)$ and I would like to find $X(-k)$. I have implemented two techniques:

  1. I am calculating the X(k) = fftshift(fft(x)) and then find X(-k) to be fliplr(X(k)) ;
  2. I write the for loop to correspond each symbol of in $X(k)$ to $X(N-K+1)$ where $N$ is the number of points used for FFT.

I get kind of similar answer but in the second approach I am mapping $X(N)$ to $X(1)$ which is DC, which should not be the case. Therefore I am suspecting I am doing something wrong.

Can anyone tell me what is the correct way to implement $X(-k)$ when you have the $X(k)$ ?

$\endgroup$
2
  • $\begingroup$ Is $x(t)$ real or complex? $\endgroup$
    – Tendero
    Jul 17, 2017 at 22:37
  • $\begingroup$ x(t) is complex $\endgroup$
    – math
    Jul 17, 2017 at 23:18

1 Answer 1

3
$\begingroup$

FFT (DFT) is defined as

$$\mathsf{DFT}\{x[n]\}=X[k]=\sum_{n=0}^{N-1}x[n]e^{-jk2\pi n/N}$$

Hence, $X[-k]$ is $$X[-k]=\sum_{n=0}^{N-1}x[n]e^{jk2\pi n/N}$$

By investigating the formula of inverse DFT (and a quick change of variable $n\leftrightarrow k$ for more clarity),

$$\mathsf{IDFT}\{X[k]\}=x[n]=\frac1N\sum_{k=0}^{N-1}X[k]e^{jk2\pi n/N}\Rightarrow x[k]=\frac1N\sum_{n=0}^{N-1}X[n]e^{jk2\pi n/N}$$

We can see that $$X[-k]=N\cdot\mathsf{IDFT}\{x[n]\}$$ So instead of calculating the FFT and then converting the result, you can directly calculate $X[-k]$ by taking the IFFT.

$\endgroup$

Your Answer

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

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