Jim's
Tutorials

Fall 2014
course
navigation

Oct 31

The Discrete Fourier Transform

Or "putting it all together".
See for example http://en.wikipedia.org/wiki/Discrete_Fourier_transform .
The formulas are
\[ A_k = \sum\limits_{n=0}^{N-1} x_n \, e^{\frac{2 \pi i}{N} n \, k } \]
\[ x_n = \frac{1}{N} \sum\limits_{k=0}^{N-1}{} A_k \, e^{- \frac{2 \pi i}{N} n \, k } \]
There are several variations depending on how you define the normalization of A, which changes where the \( 1/N \) goes. (Some people put \(\sqrt{\frac{1}{N}}\) on both equations to make them symmetric.)
N number of points, typically a power of 2 (8, 128, 1024) x[n] [x0, x1, ...] time (or distance) samples, 0 <= n < N A[k] [A0, A1, ...] frequency amplitudes, 0 <= k < N
(I will use A[k]=\( A_k \) instead of the wikipedia article's X[k], since I think trying to keep "x" vs "X" as different variables in the same equation is too confusing.)
Both \(x_n\) = x[n] and \(A_k\) = A[k] are cyclic in (n,k), wrapping around at n=N and k=N. For example x[0]=x[N], x[-1]=x[N-1], A[0]=A[N], A[-1]=A[N-1].
The frequencies go from a low at k=0 to a high at k=N/2, with two (cos,sin) phases packed into the two complex amplitudes on either side of N/2. For example with N=8 the frequency indices are
--- N = 8 --- k = 0 (DC component, corresponds to x=[1,1,1,1,...] k = 1 one full cycle from x[n=0] to x[n=N] k = 2 two cycles k = 3 three cycles k = 4 (N/2, highest frequency, corresponds to x=[1,-1,1,-1,...]) k = 5 (k=-3, other phase of k=3) k = 6 (k=-2, other phase of k=2) k = 7 (k=-1, other phase of k=1)
Both x and A can be complex in these formulas. If x is real, then the complex numbers in A have a particular symmetry, namely \(A_k = A_{-k}^*\) where the * means "complex conjugate", and where (-k) is (N-k).

homework

Your mission for next week:
This should give some notebooks like those we did in the first few weeks of the term, but this time the transform matrix is coming from the formula, with the complex exponentials giving the basis functions oscillating at different rates.
http://cs.marlboro.edu/ courses/ fall2014/jims_tutorials/ fourier/ Oct_31
last modified Friday October 31 2014 12:10 pm EDT