Discrete fourier transfomation and harmonics I have a very simple question that I would like to understand.
If you have a DFT of a function:
$$
X_k \stackrel{\mathrm{def}}{=}\sum_{n=0}^{N-1}x_n\cdot e^{-i2\pi kn/N},\qquad k\in\mathbb{Z}
$$
Did I understand correctly that that $N$th harmonic is the same as the $0$th - because of periodicity? I know this is probably a stupid question, but I would be grateful if someone could shed some light on it. Thank you!
 A: In a sense, that's exactly what it means because the (elements of the) periodic series that DFT computes are sometimes called... harmonics! Amusingly, the fairly well-developed Wikipedia article on the topic covers a lot of stuff, including proof of periodicity, but never mention "harmonics". And I'm not wooling you, see Oklobdzija's textbook for example, which really calls the DFT output harmonics.
On the other hand, there are several DFT textbooks (or textbook chapters) that don't call the DFT output harmonics. And if you look at an example of DFT applied to a sum of two sines for various N/periods, it's obvious why calling the DFT's output harmonics is problematic sometimes: such a name is only adequate if you match exactly the period of the signal analyzed with the DFT window. Otherwise, you'll get in DFT output some artefacts that aren't real harmonics of the signal. Actually with DFT you aren't even guaranteed to get the fundamental right if the window is too short. (N.B. Wikipedia discusses this "spectral leakage" issue too, albeit in a less easy to understand fashion at http://en.wikipedia.org/wiki/Discrete-time_Fourier_transform#Sampling_the_DTFT see graphs at the end of section.)
So if I may coin a term here, DFT gives you "wannabe harmonics". If the center frequencies of the DFT bins match the real harmonics of the signal, then you get the real harmonics of the signal, otherwise you get something resembling them but with lotsa spectral leakage added. 
A: First there is a terminology issue here, the term "harmonic" has its issues, as discussed in other answer.
Leaving that aside, assuming that by the "$k-$th harmonic" we just mean the $k$-th discretized frequency:
In some sense, you are right. $X_k$, in the DFT is periodic in $k$, with period $N$, so $X_0 = X_N$ (and $X_1 = X_{N-1}$). But that's rather trivial. And, actually, in a DFT, we normally think of the index $k$ as taking values in the range $0 \cdots N-1$.
Further, for a discretized finite signal of $N$ samples, the "highest harmonic" (better: highest frequency) you can meaningfully consider in a Fourier transform is that which corresponds to a period of 2 time steps (Nyquist theorem). And if you are using a DTF (as in your formula), that corresponds, not to $k=N$ but to $k=N/2$.
Furthermore: if the signal is real, then $|X_k|=|X_{N-k}|$  So, for example, $|X_1| = |X_{N-1}|$
