If theta is any real number, the exponential ei theta is a complex number that lies on the unit circle centered at the origin of the Cartesian plane. The point ei theta lies at an angle of theta (radians) relative to the positive x axis. For example, the value ei π/2 corresponds to a point on the unit circle located at an angle of π/2 radians relative to the positive x axis. This means that the point is located one unit from the origin along the positive y axis. In other words, the value of ei π/2 is just i, the square root of -1.
Because of the above, the x and y coordinates of the point that represents the complex exponential ei theta may be computed using cosine and sine projections onto the coordinate axes:
ei theta = cos(theta) + i*sin(theta)
The Fourier basis function with frequency f is a function of "time" t. Time here is just the integer subindex used to distinguish among the terms of a sequence. Thus, s3 is the "value of the s sequence at time 3", for example.
The value at time t of the Fourier basis function with frequency f is:
ei 2π/N f tThe terms in the exponent are understood to be multiplied together. Using the cosine and sine formulas for the x and y components of a complex exponential, it's easy to see why this function is referred to as having frequency f. As a function of time t, each of the components (x and y) carries out f full oscillations as t increases from 0 to N-1.
st = Σ f=0...N-1 s^f ei 2π/N f tNote that this equation states the equality of two functions of time. The values of the two sides of the equation must be equal for every value of the time variable t.
Σ p=0...N-1 ei 2π/N diff pequals N if diff is 0, and it equals 0 if diff s non-zero. To see that this is true, argue by cases. If diff is 0, then each of the N terms in the sum is 1 (because the exponent is 0), so the sum is N. If diff is a non-zero integer, then the terms of the sum are points on the unit circle that are uniformly distributed on the circle at a constant spacing of 2π/N radians; the vector sum of the set of points exactly cancels out to 0.
With the fundamental identity in hand, it's straightforward to figure out how to compute the Fourier coefficients s^f from the original sequence st for t=0...N-1. First assume that the sequence may indeed be written in the desired form for suitable (unknown) values of the coefficients:
st = Σ f=0...N-1 of s^f ei 2π/N f tMultiply both sides of the equation by e- i 2π/N f0 t, where f0 is a fixed frequency between 0 and N-1. This produces:
st e-i 2π/N f0 t = Σ f=0...N-1 s^f ei 2π/N (f-f0) tNow sum both sides over all values of t between 0 and N-1. This yields:
Σt=0...N-1 st e-i 2π/N f0 t = Σt=0...N-1 Σf=0...N-1 s^f ei 2π/N (f-f0) tChange the order of the summations on the right-hand side:
Σt=0...N-1 st e-i 2π/N f0 t = Σf=0...N-1 Σt=0...N-1 s^f ei 2π/N (f-f0) tBy the fundamental identity, the right-hand side of the above equation may be seen to equal exactly N times the coefficent s^f0 corresponding to the frequency f0.
s^f = (1/N) Σt=0...N-1 st e-i 2π/N f tSimilarly, one may see that the original sequence may be obtained from its Fourier coefficients as follows:
st = Σf=0...N-1 s^f ei 2π/N f tThe latter equation may be taken as the definition of the DFT of the original sequence. A normalizing factor of 1/sqrt(N) is sometimes used here; in that case, a factor of 1/sqrt(N) will also appear in the formula for the inverse DFT given as the former of the two equations shown here, instead of the factor 1/N as shown. One reason for introducing this factor is the result described below.
Σf=0...N-1 |s^f|2 = Σt=0...N-1 |st|2The vertical bars | | here denote the modulus of the enclosed complex number (just the absolute value if the number is real). Parseval's theorem holds only if the sum that defines the DFT is normalized by using a multiplicative factor of 1/sqrt(N). To see the truth of Parseval's theorem, the Fundamental Identity stated above is used.
Let s2 be obtained from s by shifting s by the amount delta. That is, s2t = st+delta (the indices are to be interpreted modulo N, so that N+2 really means 2, for example)). Then the following equality holds:
s2^f = (1/N) Σt=0...N-1 st+delta e-i 2π/N f t = (1/N) Σt=0...N-1 st e-i 2π/N f (t-delta) = ei 2π/N f delta s^f