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
2π2π 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 – time 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.
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
2π2π 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 (3.39) and (3.40)):
X(ω)=∑n=−∞∞x(n)e−jωnX(ω)=∑n=−∞∞x(n)e−jωn size 12{X \( ω \) = Sum cSub { size 8{n= - infinity } } cSup { size 8{ infinity } } {x \( n \) e rSup { size 8{ - jωn} } } } {}
(1)
x(n)=12π∫−ππX(ω)ejωndωx(n)=12π∫−ππX(ω)ejωndω size 12{x \( n \) = { {1} over {2π} } Int rSub { size 8{ - π} } rSup { size 8{π} } {X \( ω \) } e rSup { size 8{jωn} } dω} {}
(2)
For the sequence x(n) having N samples (time indices) we also discretize
ωω size 12{ω} {} into the same N points in the interal
[0,2π][0,2π] size 12{ \[ 0,2π \] } {}:
0,
2π
N
,
2
2π
N
,
3
2π
N
,
.
.
.
,
(
N
−
1
)
2π
N
0,
2π
N
,
2
2π
N
,
3
2π
N
,
.
.
.
,
(
N
−
1
)
2π
N
size 12{0, matrix {
} { {2π} over {N} } , matrix {
} 2 { {2π} over {N} } , matrix {
} 3 { {2π} over {N} } , matrix {
} "." "." "." , matrix {
} \( N - 1 \) { {2π} over {N} } } {}
These are the frequency samples .We take the summation from 0 to N-1 instead of from
−∞−∞ size 12{ - infinity } {}to
∞∞ size 12{ infinity } {} to get the DFT of x(n) :
X(k)=
∑
n=0
N−1
x(n)
e
−j
2π
N
kn
, k=0, 1, 2,..., N−1 (DFT) (synthesis equation)
X(k)=
∑
n=0
N−1
x(n)
e
−j
2π
N
kn
, k=0, 1, 2,..., N−1 (DFT) (synthesis equation)
MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaciaacaqabeaadaqaaqaaaOqaaiaadIfacaGGOaGaam4AaiaacMcacqGH9aqpdaaeWbqaaiaadIhacaGGOaGaamOBaiaacMcacaWGLbWaaWbaaSqabeaacqGHsislcaWGQbWaaSaaaeaacaaIYaGaeqiWdahabaGaamOtaaaacaWGRbGaamOBaaaakiaaywW7caGGSaGaaGzbVlaadUgacqGH9aqpcaaIWaGaaiilaiaaysW7caaIXaGaaiilaiaaysW7caaIYaGaaiilaiaac6cacaGGUaGaaiOlaiaacYcacaaMe8UaamOtaiabgkHiTiaaigdacaaMf8UaaiikaiaadseacaWGgbGaamivaiaacMcacaaMf8UaaiikaiaadohacaWG5bGaamOBaiaadshacaWGObGaamyzaiaadohacaWGPbGaam4CaiaaysW7caWGLbGaamyCaiaadwhacaWGHbGaamiDaiaadMgacaWGVbGaamOBaiaacMcaaSqaaiaad6gacqGH9aqpcaaIWaaabaGaamOtaiabgkHiTiaaigdaa0GaeyyeIuoaaaa@7ADE@
(3)
This is the DFT synthesis equation. X(k) is the spectral coefficients.
Since X(k) is discrete we don’t have to take the integral as in Equation (3.77) to recover the time sequence x(n) but rather a summation :
X(n)=
1
N
∑
k=0
N−1
X(k)
e
j
2π
N
kn
, n=0, 1, 2,..., N−1 (IDFT) (analysis equation)
X(n)=
1
N
∑
k=0
N−1
X(k)
e
j
2π
N
kn
, n=0, 1, 2,..., N−1 (IDFT) (analysis equation)
MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaciaacaqabeaadaqaaqaaaOqaaiaadIfacaGGOaGaamOBaiaacMcacqGH9aqpdaWcaaqaaiaaigdaaeaacaWGobaaamaaqahabaGaamiwaiaacIcacaWGRbGaaiykaiaadwgadaahaaWcbeqaaiaadQgadaWcaaqaaiaaikdacqaHapaCaeaacaWGobaaaiaadUgacaWGUbaaaOGaaGzbVlaacYcacaaMf8UaamOBaiabg2da9iaaicdacaGGSaGaaGjbVlaaigdacaGGSaGaaGjbVlaaikdacaGGSaGaaiOlaiaac6cacaGGUaGaaiilaiaaysW7caWGobGaeyOeI0IaaGymaiaaywW7caGGOaGaamysaiaadseacaWGgbGaamivaiaacMcacaaMf8UaaiikaiaadggacaWGUbGaamyyaiaadYgacaWG5bGaam4CaiaadMgacaWGZbGaaGjbVlaadwgacaWGXbGaamyDaiaadggacaWG0bGaamyAaiaad+gacaWGUbGaaiykaaWcbaGaam4Aaiabg2da9iaaicdaaeaacaWGobGaeyOeI0IaaGymaaqdcqGHris5aaaa@7B32@
(4)
X(k) and x(n) forms the transform pair :
x(n)
↔
DFT
X(k)
x(n)
↔
DFT
X(k)
MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaciaacaqabeaadaqaaqaaaOqaaiaadIhacaGGOaGaamOBaiaacMcadaGd0aWcbaGaamiraiaadAeacaWGubaabeGccaGLugcacaWGybGaaiikaiaadUgacaGGPaaaaa@406B@
The transform also applies to a system represented by its impulse response h(n):
H(k)=
∑
n=0
N−1
h(n)
e
−j
2π
N
kn
, k=0, 1, 2,..., N−1
H(k)=
∑
n=0
N−1
h(n)
e
−j
2π
N
kn
, k=0, 1, 2,..., N−1
MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaciaacaqabeaadaqaaqaaaOqaaiaadIeacaGGOaGaam4AaiaacMcacqGH9aqpdaaeWbqaaiaadIgacaGGOaGaamOBaiaacMcacaWGLbWaaWbaaSqabeaacqGHsislcaWGQbWaaSaaaeaacaaIYaGaeqiWdahabaGaamOtaaaacaWGRbGaamOBaaaaaeaacaWGUbGaeyypa0JaaGimaaqaaiaad6eacqGHsislcaaIXaaaniabggHiLdGccaaMf8UaaiilaiaaywW7caWGRbGaeyypa0JaaGimaiaacYcacaaMe8UaaGymaiaacYcacaaMe8UaaGOmaiaacYcacaGGUaGaaiOlaiaac6cacaGGSaGaaGjbVlaad6eacqGHsislcaaIXaaaaa@60C6@
h(n)=
1
N
∑
k=0
N−1
H(k)
e
j
2π
N
kn
, n=0, 1, 2,..., N−1
h(n)=
1
N
∑
k=0
N−1
H(k)
e
j
2π
N
kn
, n=0, 1, 2,..., N−1
MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaciaacaqabeaadaqaaqaaaOqaaiaadIgacaGGOaGaamOBaiaacMcacqGH9aqpdaWcaaqaaiaaigdaaeaacaWGobaaamaaqahabaGaamisaiaacIcacaWGRbGaaiykaiaadwgadaahaaWcbeqaaiaadQgadaWcaaqaaiaaikdacqaHapaCaeaacaWGobaaaiaadUgacaWGUbaaaaqaaiaadUgacqGH9aqpcaaIWaaabaGaamOtaiabgkHiTiaaigdaa0GaeyyeIuoakiaaywW7caGGSaGaaGzbVlaad6gacqGH9aqpcaaIWaGaaiilaiaaysW7caaIXaGaaiilaiaaysW7caaIYaGaaiilaiaac6cacaGGUaGaaiOlaiaacYcacaaMe8UaamOtaiabgkHiTiaaigdaaaa@6177@
Above is N-point DFT . For convenience, many authors write the exponent as
2πkn/N2πkn/N size 12{ {2π ital "kn"} slash {N} } {} but writing
2πNkn2πNkn size 12{ { {2π} over {N} } ital "kn"} {} is more meaningful.
It is interesting to compare the above N-point DFT with the DTFS of N samples (Equation (3.36) and (3.37)). Besides the factor
1/N1/N size 12{ {1} slash {N} } {} appended to differently , 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 this we must use the DTFT, we consider a 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
0≤k≤N−10≤k≤N−1 size 12{0 <= k <= N - 1} {}and
0≤n≤N−10≤n≤N−1 size 12{0 <= n <= N - 1} {}we will see 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), e.g.
N=256N=256 size 12{N="256"} {}. But then one question might arise, when the number of samples (data samples) is below 256 . In that case the technique called zero filling or zero padding is used, whereby we will fill up the vacant samples with zero.
Relating to the DFT we might ask if the sampling of the frequency
ωω size 12{ω} {} at N equal-distance points represents corectly the frequency variation . In parallel
t0t0 size 12{t rSub { size 8{0} } } {} the sampling theorem 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 3.4), 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=0N−1δ(n)e−j2πNkn=1e−j2πNk0=1,k=0,1,2,...,N−1X(k)=∑n=0N−1δ(n)e−j2πNkn=1e−j2πNk0=1,k=0,1,2,...,N−1 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=0N−11e−j2πNknX(k)=∑n=0N−11e−j2πNkn 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
k≠0k≠0 size 12{k <> 0} {}, thus
X
(
k
)
=
Nδ
(
k
)
X
(
k
)
=
Nδ
(
k
)
size 12{X \( k \) =Nδ \( k \) } {}
(c)
X(k)=∑n=0N−1ane−j2πNkn=∑n=0N−1(ae−j2πNk)nX(k)=∑n=0N−1ane−j2πNkn=∑n=0N−1(ae−j2πNk)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 we get
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
e−j2πNke−j2πNk 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
jω
0
n
+
e
−
ω
0
n
x
(
n
)
=
2
cos
ω
0
n
=
e
jω
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
2π
N
kn
=
∑
n
=
0
N
−
1
e
−
j
(
2π
N
k
−
ω
0
)
n
+
∑
n
=
0
N
−
1
e
−
j
(
2π
k
+
ω
0
)
n
X
(
k
)
=
∑
n
=
0
N
−
1
x
(
n
)
e
−
j
2π
N
kn
=
∑
n
=
0
N
−
1
e
−
j
(
2π
N
k
−
ω
0
)
n
+
∑
n
=
0
N
−
1
e
−
j
(
2π
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 :
2π
N
k
0
=
ω
0
or
k
0
=
N
2π
N
0
2π
N
k
0
=
ω
0
or
k
0
=
N
2π
N
0
MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqiVCI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaciaacaqabeaadaqaaqaaaOqaamaalaaabaGaaGOmaiabec8aWbqaaiaad6eaaaGaam4AamaaBaaaleaacaaIWaaabeaakiabg2da9iabeM8a3naaBaaaleaacaaIWaaabeaakiaaywW7caaMf8Uaam4BaiaadkhacaaMf8UaaGzbVlaadUgadaWgaaWcbaGaaGimaaqabaGccqGH9aqpdaWcaaqaaiaad6eaaeaacaaIYaGaeqiWdahaaiaad6eadaWgaaWcbaGaaGimaaqabaaaaa@4F02@
Rewrite the transform as
X
(
k
)
=
∑
n
=
0
N
−
1
e
−
j
2π
N
(
k
−
k
0
)
n
+
∑
n
=
0
N
−
1
e
−
j
2π
N
(
k
+
k
0
)
n
X
(
k
)
=
∑
n
=
0
N
−
1
e
−
j
2π
N
(
k
−
k
0
)
n
+
∑
n
=
0
N
−
1
e
−
j
2π
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
k≠k0k≠k0 size 12{k <> k rSub { size 8{0} } } {}. The second summation equals to N when
k=N−k0k=N−k0 size 12{k=N - k rSub { size 8{0} } } {}, and to zero when
k≠N−k0k≠N−k0 size 12{k <> N - k rSub { size 8{0} } } {}. Thus
X(k)=N , k=
k
0
and k=N−
k
0
=0 , otherwise