CHAPTER2
TheDFT,Convolution,andWindowing
InChapter1,wesawthatsignalprocessingforcontinuoustime,bandlimitedwaveforms
andsystemscanbeaccomplishedbydiscretetimesignalprocessing. However,computers
canonlyevaluate
finite
sums.
Recallthatforaninfinitesequence
x
n
,itsDTFTis
X
(
f
)
:
=
∞
∑
m
=

∞
x
m
e

j
2
π
fm
≈
M
∑
m
=

M
x
m
e

j
2
π
fm
forlarge
M
. Thesumontherightcontains2
M
+
1terms. Lateritwillbemoreefficientto
usesumswithanevennumberofterms.Forthisreason,weusetheapproximation
X
(
f
)
≈
M

1
∑
m
=

M
x
m
e

j
2
π
fm
.
In order to write this as a sum starting from zero, we can make the change of variable
n
=
m
+
M
toget
X
(
f
)
≈
2
M

1
∑
n
=
0
x
n

M
e

j
2
π
f
(
n

M
)
.
Althoughtheforegoingapproximationinvolvesonlyafinitesum,acomputercannotevalu
ateitforallvaluesof
f
inoneperiod,say

f
≤
1
/
2.Instead,thecomputercanonlyevaluate
thesumforfinitelymanyvaluesof
f
.Let
N
:
=
2
M
,andlet
f
=
k
/
N
toget
1
X
(
k
/
N
)
≈
N

1
∑
n
=
0
x
n

M
e

j
2
π
k
(
n

M
)
/
N
=
e
j
2
π
kM
/
N
N

1
∑
n
=
0
x
n

M
e

j
2
π
kn
/
N
.
(2.1)
Regarding this last sum as a function of
k
, observe that it has period
N
; i.e., replacing
k
with
k
+
N
doesnotchangethevalueofthesum. Soweonlyneedtoevaluatethesumfor
k
=
0
,...,
N

1.
2.1. TheDiscreteFourierTransform(DFT)
Givenafinitesequence
y
0
,...,
y
N

1
,its
discreteFouriertransform
(DFT)is
Y
k
:
=
N

1
∑
n
=
0
y
n
e

j
2
π
kn
/
N
.
(2.2)
1
Since
N
=
2
M
,
e
j
2
π
kM
/
N
=
e
j
π
k
= (

1
)
k
.
12
2.1 TheDiscreteFourierTransform(DFT)
13
It is easy to show that
Y
k
is a periodic function of
k
with period
N
. We show below in
Section2.1.5thatthesequence
y
n
canberecoveredfromtheDFTsequence
Y
0
,...,
Y
N

1
by
the
inverseDFT
(IDFT)
y
n
=
1
N
N

1
∑
k
=
0
Y
k
e
j
2
π
kn
/
N
.
(2.3)
Ofcoursetherighthandsideisaperiodicfunctionof
n
withperiod
N
. Hence, although
y
n
is only defined for
n
=
0
,...,
N

1, we often think of it as being an infiniteduration
periodicsignalwithperiod
N
.
2.1.1. SummingaPeriodicSequenceoveraPeriod
Let
z
n
haveperiod
N
.Thenforany
m
,
m
+(
N

1
)
∑
n
=
m
z
n
=
N

1
∑
n
=
0
z
n
.
Thisismosteasilyseenpictorially. Forexample,if
z
n
hasperiod
N
=
5,weseefromthe
diagram
n
: 0 1 2
3 4 5 6 7
8 9
z
n
:
a
0
a
1
a
2
a
3
a
4
a
0
a
1
a
2
a
3
a
4
that
z
0
+
···
+
z
4
and
z
3
+
···
+
z
7
arebothequalto
a
0
+
···
+
a
4
.
AsimpleapplicationoftheforegoingistotheIDFTformula(2.3)when
N
=
2
M
+
1.
Then
y
n
=
1
N
M
∑
k
=

M
Y
k
e
j
2
π
kn
/
N
,
wherewehaveusedthefactthatsince
Y
k
and
e
j
2
π
kn
/
N
haveperiod
N
,sodoestheirproduct.
2.1.2. ComputationoftheDFTinM
ATLAB
If
y
=[
y
0
,...,
y
N

1
]
,thentheDFTof
y
,
Y
=[
Y
0
,...,
Y
N

1
]
,canbecomputedinM
ATLAB
withthecommand
Y = fft(y)
.Here
FFT
standsfor
fastFouriertransform
.TheFFT
isaspecialalgorithmthatcomputestheDFTveryquickly.
SincetheDFTisperiodic,
Y

1
=
Y

1
+
N
=
Y
N

1
Y

2
=
Y

2
+
N
=
Y
N

2
.
.
.
Y

N
/
2
=
Y

N
/
2
+
N
=
Y
N
/
2
.
So,toplot
Y
k
for
k
=

N
/
2to
k
=
N
/
2

1,weneedtotake
Y
= [
Y
0
,...,
Y
N
/
2

1
,
Y
N
/
2
,...,
Y
N

1
]
andconvertitto
[
Y
N
/
2
,...,
Y
N

1
,
Y
0
,
Y
1
,...,
Y
N
/
2

1
]
.
ThisisdonewiththeM
ATLAB
command
fftshift
. Thecorrespondingvectorof
k
val
uescanbegivenby
k=[0:N1]N/2
, andwecouldthenusethecommand
plot(k,
fftshift(Y))
. If we are approximating
X
(
k
/
N
)
in (2.1), then we would use
k/N
to
havethehorizontalaxisrunfrom

1
/
2to1
/
2.