1
$\begingroup$

I have a question with reference to this Table. enter image description here

With even N, the frequency axis extremes should be $\pm$Fs/2, where Fs is the sampling frequency. However in the array we have only one value corresponding to the Nyquist frequency. Following the notation of the table in the first column, N=10, we have

[$c_{0}$ $c_{1}$ $c_{2}$ $c_{3}$ $c_{4}$ $c_{-5}$ $c_{-4}$ $c_{-3}$ $c_{-2}$ $c_{-1}$]

which after fftshift should become

[$c_{-5}$ $c_{-4}$ $c_{-3}$ $c_{-2}$ $c_{-1}$ $c_{0}$ $c_{1}$ $c_{2}$ $c_{3}$ $c_{4}$ ]

The $c_{-5}$ value corresponds to the Nyquist frequency. So how is our double sided frequency spectrum symmetric when N is even? For real valued function it will be zero, but is there a reason that MATLAB calculates the negative frequency first as shown in the Table?

Example: A_even=[ 0 0 0 1 1 1 1 0 0 0],

N=10

B=fft(A_even)'

C=fftshift(B)

Then C is equal to

$$\begin{matrix} 0.0000 + 0.0000i\\ -0.3090 - 0.9511i\\ 0.4271 + 0.5878i\\ 0.8090 + 0.5878i\\ -2.9271 - 0.9511i\\ 4.0000 + 0.0000i\\ -2.9271 + 0.9511i\\ 0.8090 - 0.5878i\\ 0.4271 - 0.5878i\\ -0.3090 + 0.9511i\\ \end{matrix}$$

This implies $c_{-5}$ = 0.0000 + 0.0000i and $c_{0}$= 4.0000+0000i Thanks.

$\endgroup$

1 Answer 1

4
$\begingroup$

If the size $N$ of the DFT is even, only one "extremal" point (after fftshift) is Nyquist. If $N$ is even, you cannot have an arbitary $c_{-5}$ and $c_5$. They must add to be whatever your $c_{-5}$ term is.

If the input to the DFT is purely real and if $N$ is even, consider the Nyquist point, at $c_{N/2}$ to be split in half. One half is the negative-frequency component and the other half is the positive-frequency component. Since the negative and positive frequency components must be complex conjugates of each other, and since $c_{-N/2}=c_{N/2}$ after splitting, that means that $c_{N/2}$ must be purely real just as $c_0$ must also be real.

$\endgroup$
9
  • 1
    $\begingroup$ Yes, that is correct about the DFT after you apply fftshift(). but in reality, that $c_{-5}$ is really split into two. half at the negative frequency and half at the positive frequency. this is not an issue for the case when $N$ is odd. $\endgroup$ Jun 4, 2019 at 20:22
  • 1
    $\begingroup$ Try an input of [ 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1] and you will see some energy in the Nyquist component. $\endgroup$ Jun 4, 2019 at 20:25
  • 1
    $\begingroup$ The reason I said "that $c_{−5}$ is really split into two. half at the negative frequency and half at the positive frequency" is in response to what you said: "With even N, the frequency axis extremes should be ±Fs/2." When $N$ is even and the input is real, your $c_{−N/2}$ is actually the sum of the actual $c_{N/2}$ and $c_{−N/2}$. But $c_{N/2}$ is not returned by the DFT. $\endgroup$ Jun 4, 2019 at 22:15
  • 1
    $\begingroup$ This is more fundamentally about the Discrete-Fourier Transform than about MATLAB. All MATLAB does is the DFT in the traditional sense, but fucks up the indices with an offset of 1. $X(1)$ is the DC value and that is friggin' inexcusable. This thing about the Nyquist bin at $X[\tfrac{N}{2}]$ is really about how the DFT is connected to the true double-sided spectrum for a real input $x[n]$. And, yes, you got that right. you split $c_{-8}$ into two equal parts and the other half goes to $c_{+8}$ if you're considering these $c_k$ to be Fourier series coefficients. $\endgroup$ Jun 5, 2019 at 0:21
  • 1
    $\begingroup$ this answer discusses this a little. $\endgroup$ Jun 5, 2019 at 0:31

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.