TITLE: DFT - Why are the definitions for inverse and forward commonly switched?
QUESTION [13 upvotes]: Sometimes the forward DFT is defined with a negative sign in the exponent, sometimes with a positive one and occasionally with a $1/N$ coefficient. I see this all over the place online. I don’t see how the forward and the inverse are equivalent: at minimum they have opposite exponential signs and a $1/N$ factor in the inverse DFT.
What's the deal?

REPLY [7 votes]: Simply convention. The Wikipedia gets it quite right:

... the normalization factor multiplying the DFT and IDFT (here 1 and
  1/N) and the signs of the exponents are merely conventions, and differ
  in some treatments. The only requirements of these conventions are
  that the DFT and IDFT have opposite-sign exponents and that the
  product of their normalization factors be 1/N. 
A normalization of $1/\sqrt{N}$ for both the DFT and IDFT makes the transforms unitary, 
  which has some theoretical advantages, but it is often more practical in numerical
  computation to perform the scaling all at once as above (and a unit
  scaling can be convenient in other ways). 
(The convention of a negative sign in the exponent is often convenient because it means
  that X_k is the amplitude of a "positive frequency" 2πk / N.
  Equivalently, the DFT is often thought of as a matched filter: when
  looking for a frequency of +1, one correlates the incoming signal with
  a frequency of −1.)

Regarding the last paragraph, about exponent signs: that means that the common convention of having negative exponents in the DFT (which might appear a little unnatural) looks natural when we think our signal as a juxtaposition (linear combination) of sinusoids (complex exponentials). And this corresponds to the IDFT equation (which, in this convention, will have positive exponents) :
$$x[n] = \sum_k X(k) \; \exp{(i 2 \pi k n /N)}$$
... so that  $X(k)$ is the "weight" associated with the sinusoid of frequency $k$. In other words, the convention looks natural when we think in terms of synthesis rather than analysis.
Regarding the normalization factor: The convention is less universal here, in my experience. I actually tend to divide by $N$ in the DFT, so that the Fourier transform at frequency zero gives the average value of the signal (the "DC component"). It's true that using $1/\sqrt{N}$ makes everything more mathematically elegant (DFT is a unitary transform, and the inverse is just the Hermitian transpose), but this is seldom useful in numerical work.