TITLE: How to prove the orthogonality of the Fourier basis from the dot product?
QUESTION [5 upvotes]: In order to prove the discrete fourier basis
$$ w^{(k)}_n = e^{-j\frac{2\pi}{N}nk}$$
is orthogonal, the following was stated

But I am confused why it is 0 when $k \neq h$, How can the sum from $n=0$ to $ N-1 $ be $0$ ? I tried substituting values for $h-k$ by $2$, and $N$ by $5$, but in the summation there is always that $e^0$ which equals to 1 and no negative term to cancel it. Can someone clear this please?

REPLY [2 votes]: Use the formula for a geometric sum $\sum_{n=0}^{N-1} \alpha^n = \frac{1-\alpha^N}{1-\alpha}$, where $\alpha \stackrel{\rm def}{=} e^{-j\frac{2\pi}{N}(h-k)}\neq 1$ (the last point because $h\neq k$).
It will be $0$ as $\alpha^N = e^{-j\frac{2\pi}{N}(h-k)\cdot N} = e^{-j 2\pi(h-k)} = e^0$ (recall that $h-k$ is an integer, and $x\mapsto e^{j2\pi x}$ is periodic with period $2\pi$).