You are here: Home » Content » INTRODUCTORY DISCRETE FOURIER TRANSFORM (DFT)

INTRODUCTORY DISCRETE FOURIER TRANSFORM (DFT)

Module by: Nguyen Huu Phuong

INTRODUCTORY DISCRETE FOURIER TRANSFORM (DFT)

In this chapter we have seen that the Continuous-Time Fourier Series (CTFS) relates the continuous periodic time to the discrete frequencies, and the Continuous-Time Fourier transform (CTFT) relates the continuous time to the continuous frequency, then the Discrete Time Fourier Series (DTFS) relates the discrete periodic time to the discrete frequencies, and, finally, the Discrete Time Fourier Transform (DTFT) relates the discrete time to the continuous frequency. The two latter representations differ from the two former in that they are size 12{2π} {} - periodic in the frequency domain due to the effect of the sampling in the time domain.
Although the DTFT is very useful for examing the frequency characteristic of discrete – time signals and systems, but there is a computational problem with it, i.e. its frequency representation is continuous. The Discrete Fourier Transform (DFT) fills up the time-frequency picture, it relates the discrete time to the discrete frequency. There is still the Fast Fourier Transform (FFT) which is the algorithm to compute the DFT. Both the DFT and FFT are really important tools to tackle many problems is DSP(DTSP). In this last section we present just a brief introduction to the DFT. They will be presented more fully in chapter 8.

From the DTFT to the DFT

While the discrete sequence x(n) is discrete in time , its DTFT X(ω)X(ω) size 12{X \( ω \) } {}is continuous and size 12{2π} {}-periodic in frequency ωω size 12{ω} {}, which is not convenient for computation on computers. So, the frequency variable ωω size 12{ω} {} must be discretized in one period [0,2π][0,2π] size 12{ \[ 0,2π \] } {} and we then take the transform of these discrete frequencies.
First let’s repeat the DTFT pair here for comvenience ((Equation) and (Equation)):
X(ω)= n= x(n) e jωn (DTFT) X(ω)= n= x(n) e jωn (DTFT) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIfacaGGOaGaeqyYdCNaaiykaiabg2da9maaqahabaGaamiEaiaacIcacaWGUbGaaiykaiaadwgadaahaaWcbeqaaiabgkHiTiaadQgacqaHjpWDcaWGUbaaaaqaaiaad6gacqGH9aqpcqGHsislcqGHEisPaeaacqGHEisPa0GaeyyeIuoakiaaywW7caaMf8UaaiikaiaadseacaWGubGaamOraiaadsfacaGGPaaaaa@53AB@ (1)
x(n)= 1 2π π π X(ω) e jωn dω x(n)= 1 2π π π X(ω) e jωn dω MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIhacaGGOaGaamOBaiaacMcacqGH9aqpdaWcaaqaaiaaigdaaeaacaaIYaGaeqiWdahaamaapedabaGaamiwaiaacIcacqaHjpWDcaGGPaaaleaacqGHsislcqaHapaCaeaacqaHapaCa0Gaey4kIipakiaadwgadaahaaWcbeqaaiaadQgacqaHjpWDcaWGUbaaaOGaamizaiabeM8a3baa@4F98@ (2)
For the sequence x(n) having N samples (time indices) we discretize at equal spaces the continuous frequency ωω size 12{ω} {} into the same N points in the interval [0,2π][0,2π] size 12{ \[ 0,2π \] } {}:
ω k = 2π N k,k=0,1,2,...,N1 ω k = 2π N k,k=0,1,2,...,N1 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqaaeaabaGaciaacaqaaeaadaqaaqaaaOqaaiabeM8a3naaBaaaleaacaWGRbaabeaakiabg2da9maalaaabaGaaGOmaiabec8aWbqaaiaad6eaaaGaam4AaiaacYcacaaMc8UaaGjbVlaaywW7caWGRbGaeyypa0JaaGimaiaacYcacaaMe8UaaGymaiaacYcacaaMe8UaaGOmaiaacYcacaGGUaGaaiOlaiaac6cacaGGSaGaamOtaiabgkHiTiaaigdaaaa@520C@ (3)
These are the frequency samples .We take the summation from 0 to N-1 instead of from size 12{ - infinity } {}to size 12{ infinity } {} as in the DTFS, to get the DFT of x(n) :
X(k)= n=0 N1 x(n) e j 2π N kn ,k=0,1,2,...,N1(DFT)(analysisequation) X(k)= n=0 N1 x(n) e j 2π N kn ,k=0,1,2,...,N1(DFT)(analysisequation) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqaaeaabaGaciaacaqaaeaadaqaaqaaaOqaaiaadIfacaGGOaGaam4AaiaacMcacqGH9aqpdaaeWbqaaiaadIhacaGGOaGaamOBaiaacMcaaSqaaiaad6gacqGH9aqpcaaIWaaabaGaamOtaiabgkHiTiaaigdaa0GaeyyeIuoakiaadwgadaahaaWcbeqaaiabgkHiTiaadQgadaWcbaadbaGaaGOmaiabec8aWbqaaiaad6eaaaWccaWGRbGaamOBaaaakiaaywW7caGGSaGaaGzbVlaadUgacqGH9aqpcaaIWaGaaiilaiaaysW7caaIXaGaaiilaiaaysW7caaIYaGaaiilaiaac6cacaGGUaGaaiOlaiaacYcacaaMe8UaamOtaiabgkHiTiaaigdacaaMf8UaaiikaiaadseacaWGgbGaamivaiaacMcacaaMf8UaaiikaiaadggacaWGUbGaamyyaiaadYgacaWG5bGaam4CaiaadMgacaWGZbGaaGjbVlaadwgacaWGXbGaamyDaiaadggacaWG0bGaamyAaiaad+gacaWGUbGaaiykaaaa@79EF@ (4)
This is the N- point DFT (analysis equation). X(k) is the spectral components. Notice that we write X(k) to mean X(ωk)X(ωk) size 12{X \( ω rSub { size 8{k} } \) } {}, for short as many authors do . The exponent of the exponential is written as j(/N)knj(/N)kn size 12{ - j \( 2π/N \) ital "kn"} {}. Many authors write it as j2πkn/Nj2πkn/N size 12{ - j2π ital "kn"/N} {} for convenience, but our writing is more meaningful.
Since X(k) is discrete we don’t have to take the integral as in Equation 3 to recover the time sequence x(n), but rather a summation :
x(n)= 1 N k=0 N1 X(k)e j N kn ,n=0,1,2,...,N1(IDFT)(synthesisequation) x(n)= 1 N k=0 N1 X(k)e j N kn ,n=0,1,2,...,N1(IDFT)(synthesisequation) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqaaeaabaGaciaacaqaaeaadaqaaqaaaOqaaiaabIhacaqGOaGaaeOBaiaabMcacqGH9aqpdaWcaaqaaiaabgdaaeaacaqGobaaamaaqahabaGaaeiwaiaabIcacaqGRbGaaeykaiaabwgadaahaaWcbeqaaiaabQgadaWcbaadbaGaaeOmaiaabc8aaeaacaqGobaaaSGaae4Aaiaab6gaaaaabaGaae4Aaiabg2da9iaabcdaaeaacaqGobGaeyOeI0IaaeymaaqdcqGHris5aOGaaGjbVlaacYcacaaMf8UaamOBaiabg2da9iaaicdacaGGSaGaaGjbVlaaigdacaGGSaGaaGjbVlaaikdacaGGSaGaaiOlaiaac6cacaGGUaGaaiilaiaaysW7caWGobGaeyOeI0IaaGymaiaaywW7caGGOaGaamysaiaadseacaWGgbGaamivaiaacMcacaaMf8UaaiikaiaadohacaWG5bGaamOBaiaadshacaWGObGaamyzaiaadohacaWGPbGaam4CaiaaysW7caWGLbGaamyCaiaadwhacaWGHbGaamiDaiaadMgacaWGVbGaamOBaiaacMcaaaa@7BB4@ (5)
This is the inverse DFT (IDFT) (synthesis equation). X(k) and x(n) form the transform pair
x(n) DFT X(k) x(n) DFT X(k) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqaaeaabaGaciaacaqaaeaadaqaaqaaaOqaaiaadIhacaGGOaGaamOBaiaacMcadaGd0aWcbaGaamiraiaadAeacaWGubaabeGccaGLugcacaWGybGaaiikaiaadUgacaGGPaaaaa@4065@
The transform also applies to a systems represented by their impulse responses h(n):
H(k)= n=0 N1 h(n) e j 2π N kn ,k=0,1,2,...,N1 H(k)= n=0 N1 h(n) e j 2π N kn ,k=0,1,2,...,N1 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaam4AaiaacMcacqGH9aqpdaaeWbqaaiaadIgacaGGOaGaamOBaiaacMcacaWGLbWaaWbaaSqabeaacqGHsislcaWGQbWaaSqaaWqaaiaaikdacqaHapaCaeaacaWGobaaaSGaam4Aaiaad6gaaaaabaGaamOBaiabg2da9iaaicdaaeaacaWGobGaeyOeI0IaaGymaaqdcqGHris5aOGaaiilaiaaywW7caaMf8Uaam4Aaiabg2da9iaaicdacaGGSaGaaGjbVlaaigdacaGGSaGaaGjbVlaaikdacaGGSaGaaiOlaiaac6cacaGGUaGaaiilaiaaysW7caWGobGaeyOeI0IaaGymaaaa@60DB@ (6)
h(n)= 1 N k=0 N1 H(k) e j 2π N kn ,n=0,1,2,...,N1 h(n)= 1 N k=0 N1 H(k) e j 2π N kn ,n=0,1,2,...,N1 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIgacaGGOaGaamOBaiaacMcacqGH9aqpdaWcaaqaaiaaigdaaeaacaWGobaaamaaqahabaGaamisaiaacIcacaWGRbGaaiykaiaadwgadaahaaWcbeqaaiaadQgadaWcbaadbaGaaGOmaiabec8aWbqaaiaad6eaaaWccaWGRbGaamOBaaaaaeaacaWGRbGaeyypa0JaaGimaaqaaiaad6eacqGHsislcaaIXaaaniabggHiLdGccaGGSaGaaGjbVlaad6gacqGH9aqpcaaIWaGaaiilaiaaysW7caaIXaGaaiilaiaaysW7caaIYaGaaiilaiaac6cacaGGUaGaaiOlaiaacYcacaaMe8UaamOtaiabgkHiTiaaigdaaaa@5FFD@ (7)
It is interesting to compare the above N-point DFT with the DTFS of N samples ( Equation and Equation). Besides the factor 1/N1/N size 12{ {1} slash {N} } {} appended to different equations , we see that they are just the same with the coefficients akak size 12{a rSub { size 8{k} } } {} in the place of the coefficients X(k)X(k) size 12{X \( k \) } {}. The idea is that for a nonperiodic discrete sequence x(n) of N time samples , for which we must use the DTFT, we consider an infinitely long periodic sequence having the original x(n) as its period and then use the DTFS but with the new name DFT. If we compute the DFT equations outside the interval 0kN10kN1 size 12{0 <= k <= N - 1} {}and 0nN10nN1 size 12{0 <= n <= N - 1} {}we will have repeated values.
By reason of computational convenience the number N is usually taken as the integer power of 2 (i.e. N=2nN=2n size 12{N=2 rSup { size 8{n} } } {} with n integer). When the number of samples (data samples) is below such a number we use a technique called zero filling or zero padding , whereby we will fill up the vacant samples with zero so that the total samples will be equal to that integer power of 2.
Relating to the DFT we might wonder if the sampling of the frequency ωω size 12{ω} {} at N equal-distance points represents correctly the frequency variation . In parallel to the sampling theorem in time domain ( section ) , we have the sampling theorem in frequency domain which is stated as follows.
The continuous frequency spectrum of a signal existing in a finite time interval T0T0 size 12{T rSub { size 8{0} } } {} seconds can be represented completely by the frequency samples separated by a distance no more than 1/T01/T0 size 12{ {1} slash {T rSub { size 8{0} } } } {} Hertzs. The frequency sepectrum can then be recovered completely from the samples.
It can be checked that the previons sampling of N points does satisfy this theorem. Another way to check the legitimacy of the DFT pair is from the given transform X(k)X(k) size 12{X \( k \) } {}we can recover x(n)x(n) size 12{x \( n \) } {}. The problem is very similar to the case of CTFT ( section ), the difference is that in this case we use the orthogonality of discrete-time exponentials.
Example 1 
Find the N-point DFT of the following signal
(a) x(n)=δ(n)x(n)=δ(n) size 12{x \( n \) =δ \( n \) } {}
(b) x(n)=1x(n)=1 size 12{x \( n \) =1} {}
(c) x(n)=anx(n)=an size 12{x \( n \) =a rSup { size 8{n} } } {}
(d) x(n)=2cosω0nx(n)=2cosω0n size 12{x \( n \) =2"cos"ω rSub { size 8{0} } n} {}
Solution
(a) X(k)=n=0N1δ(n)ejNkn=1ejNk0=1,k=0,1,2,...,N1X(k)=n=0N1δ(n)ejNkn=1ejNk0=1,k=0,1,2,...,N1 size 12{X \( k \) = Sum cSub {n=0} cSup {N - 1} {δ \( n \) e rSup { size 8{ - j { { size 6{2π} } over { size 6{N} } } ital "kn"} } } size 12{ {}=1e rSup { - j { { size 6{2π} } over { size 6{N} } } k rSub { size 6{0} } } } size 12{ {}=1, matrix { {} # {} } k=0,1,2, "." "." "." ,N - 1}} {}
(b) X(k)=n=0N11ejNknX(k)=n=0N11ejNkn size 12{X \( k \) = Sum cSub {n=0} cSup {N - 1} {1e rSup { size 8{ - j { { size 6{2π} } over { size 6{N} } } ital "kn"} } } } {}
The summation has a value of N for k=0 and of zero for k0k0 size 12{k <> 0} {}, thus
X ( k ) = ( k ) X ( k ) = ( k ) size 12{X \( k \) =Nδ \( k \) } {}
(c) X(k)=n=0N1anejNkn=n=0N1(aejNk)nX(k)=n=0N1anejNkn=n=0N1(aejNk)n size 12{X \( k \) = Sum cSub {n=0} cSup {N - 1} {a rSup { size 8{n} } e rSup { size 8{ - j { { size 6{2π} } over { size 6{N} } } ital "kn"} } } size 12{ {}= Sum cSub {n=0} cSup {N - 1} { \( ital "ae" rSup { - j { { size 6{2π} } over { size 6{N} } } k} size 12{ \) rSup {n} }} }} {}
Using the formula of finite geometric series ( Equation) we obtain
X ( k ) = 1 b n 1 b , k = 0,1,2, . . . , N 1 X ( k ) = 1 b n 1 b , k = 0,1,2, . . . , N 1 size 12{X \( k \) = { {1 - b rSup { size 8{n} } } over {1 - b} } , matrix { {} # {} } k=0,1,2, "." "." "." ,N - 1} {}
Where b stands for ejNkejNk size 12{e rSup { size 8{ - j { { size 6{2π} } over { size 6{N} } } k} } } {}.
(d) As usual, we express the cosinusoid in terms of exponentials:
x ( n ) = 2 cos ω 0 n = e 0 n + e ω 0 n x ( n ) = 2 cos ω 0 n = e 0 n + e ω 0 n size 12{x \( n \) =2"cos"ω rSub { size 8{0} } n=e rSup { size 8{jω rSub { size 6{0} } n} } +e rSup { - ω rSub { size 6{0} } n} } {}
The DFT is
X ( k ) = n = 0 N 1 x ( n ) e j N kn = n = 0 N 1 e j ( N k ω 0 ) n + n = 0 N 1 e j ( k + ω 0 ) n X ( k ) = n = 0 N 1 x ( n ) e j N kn = n = 0 N 1 e j ( N k ω 0 ) n + n = 0 N 1 e j ( k + ω 0 ) n size 12{X \( k \) = Sum cSub {n=0} cSup {N - 1} {x \( n \) e rSup { size 8{ - j { { size 6{2π} } over { size 6{N} } } ital "kn"} } } size 12{ {}= Sum cSub {n=0} cSup {N - 1} {e rSup { - j \( { { size 6{2π} } over { size 6{N} } } k - ω rSub { size 6{0} } \) n} } } size 12{+ Sum cSub {n=0} cSup {N - 1} {e rSup { - j \( { { size 6{2π} } over { size 6{k} } } +ω rSub { size 6{0} } \) n} } }} {}
For convenience, let’s call a spectral coefficient k0k0 size 12{k rSub { size 8{0} } } {}corresponding to the given frequency ω0ω0 size 12{ω rSub { size 8{0} } } {}, satisfying :
N k 0 = ω 0 or k 0 = N N 0 N k 0 = ω 0 or k 0 = N N 0 size 12{ { {2π} over {N} } k rSub { size 8{0} } =ω rSub { size 8{0} } matrix { {} # {} # {} } ital "or" matrix { {} # {} # {} } k rSub { size 8{0} } = { {N} over {2π} } N rSub { size 8{0} } } {}
Rewrite the transform as
X ( k ) = n = 0 N 1 e j N ( k k 0 ) n + n = 0 N 1 e j N ( k + k 0 ) n X ( k ) = n = 0 N 1 e j N ( k k 0 ) n + n = 0 N 1 e j N ( k + k 0 ) n size 12{X \( k \) = Sum cSub {n=0} cSup {N - 1} {e rSup { size 8{ - j { { size 6{2π} } over { size 6{N} } } \( k - k rSub { size 6{0} } \) n} } } size 12{+ Sum cSub {n=0} cSup {N - 1} {e rSup { - j { { size 6{2π} } over { size 6{N} } } \( k+k rSub { size 6{0} } \) n} } }} {}
The first summation equals to N when k=k0k=k0 size 12{k=k rSub { size 8{0} } } {}, and to zero when kk0kk0 size 12{k <> k rSub { size 8{0} } } {}. The second summation equals to N when k=Nk0k=Nk0 size 12{k=N - k rSub { size 8{0} } } {}, and to zero when kNk0kNk0 size 12{k <> N - k rSub { size 8{0} } } {}. Thus
X(k)=N,k= k 0 andk=N k 0 =0,otherwise X(k)=N,k= k 0 andk=N k 0 =0,otherwise MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeaabiGaciaacaqaaeaadaqaaqaaaOabaeqabaGaamiwaiaacIcacaWGRbGaaiykaiabg2da9iaad6eacaGGSaGaaGzbVlaadUgacqGH9aqpcaWGRbWaaSbaaSqaaiaaicdaaeqaaOGaaGzbVlaadggacaWGUbGaamizaiaaywW7caWGRbGaeyypa0JaamOtaiabgkHiTiaadUgadaWgaaWcbaGaaGimaaqabaaakeaacaaMf8UaaGzbVlaaysW7cqGH9aqpcaaIWaGaaiilaiaaywW7caWGVbGaamiDaiaadIgacaWGLbGaamOCaiaadEhacaWGPbGaam4Caiaadwgaaaaa@5D9E@
For example with ω0=π/4