# Difference in having even number and odd number of samples in DFT?

In the DFT we sample one period of the spectrum in the frequency domain. What is the difference between having an odd or an even number of samples?

We know that DFT is just a sampled version of the DTFT.

My thoughts are that if we use an odd number of samples of the DTFT in our DFT, the frequency content will go from $$-\frac{f_s}{2}$$ to $$\frac{f_s}{2}$$. So it is symmetric around $$0$$.

If we use an even number of samples, the frequency content will go from $$-\frac{f_s}{2}$$ to $$\frac{f_s}{2}-\frac{1}{f_s}$$. So it is not symmetric around $$0$$.

Is this correct or completely wrong? Furthermore, what will this mean for the impulse response?

We know that DFT is just a sampled version of the DTFT.

Only if there is no time-domain aliasing (see below)

My thoughts are that if we use an odd number of samples of the DTFT in our DFT, the frequency content will go from −fs/2 to fs/2. So it is symmetric around 0.

Sort of. The DFT samples the DTFT on the unit circle at angles $$k\frac{2\pi}{N}$$ where $$N$$ is the FFT length. Let's look at a simple example $$N=3$$ we sample at $$[-120,0,+120]$$ degrees so the sampling grid is indeed symmetric. However the grid does not range from $$-\pi$$ to $$+\pi$$. The max/min frequencies are at $$\pm \pi(1-1/N)$$. Please not that the DFT itself is NOT symmetric, so in general $$X[k] \neq X[-k]$$

If we use an even number of samples, the frequency content will go from −fs2 to fs2−1fs. So it is not symmetric around 0.

Sort of. Let's look at a simple example again $$N=4$$. You sample at [0,90, 180, 270] or [-90,0,90,180], or [-180,-90,0,90] or [-270,-180,-90,0] etc. Since the DTFT is periodic it makes no difference. The grid still symmetric around 0 in the sense of "If the grid includes $$\omega$$ it also includes $$-\omega$$ and they are equidistant from 0", you just may have to extend the index range past one period to do the inversion.

Furthermore, what will this mean for the impulse response?

Sampling in the time domain results in periodic repetition in the frequency domain. Sampling in the frequency domain results in periodic repetition in the time domain. The same thing happens: the impulse response will be periodically repeated. If the impulse response is longer than the FFT length, the repetitions will overlap and the samples will no longer represent the original impulse response. That's the very definition of "time domain aliasing".

• Thank you so much for this answer! Especially the thing about aliasing in the time domain.
– Carl
Aug 17, 2022 at 14:02

... if we use an odd number of samples of the DTFT in our DFT, the frequency content will go from $$-\frac{f_s}{2}$$ to $$\frac{f_s}{2}$$. So it is symmetric around $$0$$.

Correct.

If we use an even number of samples, the frequency content will go from $$-\frac{f_s}{2}$$ to $$\frac{f_s}{2}-\frac{1}{f_s}$$. So it is not symmetric around $$0$$.

Need to use fuzzy sets here: that proposition's membership in the set of all correct answers is tenuous, at best, but its membership in the set of all wrong answers isn't 100%, either.

The "natural" domain of the output of the DFT repeats modulo $$f_s$$. So $$f = -\frac{f_s}{2}$$ is congruent with $$f = \frac{f_s}{2}$$. This modulo $$f_s$$ thing is why you can take the output of the FFT (which for every software package I've used ranges from $$k = 0$$ to $$k = N - 1$$) and rearrange it to represent frequencies in the interval $$\left [-\frac{f_s}{2}, \frac{f_s}{2} \right)$$. But you can choose to represent it as $$\left (-\frac{f_s}{2}, \frac{f_s}{2} \right]$$, or $$\left [0, f_s \right)$$, or any other interval that's $$N$$ points long.

As Tim pointed out, your statement is mostly correct. I have made this little diagram that shows Fourier series coefficients obtained from the DFT for N = 10 (even) and N = 9 (odd). It might help visualize the symmetries for somebody that comes across this question: