2. §5.2.1 The Discrete Fourier
Transform
Definition - The simplest relation between a
length-N sequence x[n], defined for 0≤n≤N-1,
and its DTFT X(ejω) is obtained by uniformly
sampling X(ejω) on the ω-axis between
0≤ω≤2π at ωk= 2πk/N, 0≤k≤N-1
From the definition of the DTFT we thus
have
1
0
,
]
[
)
(
]
[
1
0
/
2
/
2
N
k
e
n
x
e
X
k
X
N
n
N
k
j
N
k
j
3. §5.2.1 The Discrete Fourier
Transform
Note: X[k] is also a length-N sequence in the
frequency domain
The sequence X[k] is called the discrete
Fourier transform (DFT) of the sequence x[n]
Using the notation WN= e-j2π/N the DFT is
usually expressed as:
1
0
,
]
[
]
[
1
0
N
k
W
n
x
k
X
N
n
n
k
N
4. §5.2.1 The Discrete Fourier
Transform
The inverse discrete Fourier transform
(IDFT) is given by
To verify the above expression we multiply
both sides of the above equation by and
sum the result from n = 0 to n=N-1
W
n
N
1
0
,
]
[
1
]
[
1
0
N
n
W
k
X
N
n
x
N
k
kn
N
5. §5.2.1 The Discrete Fourier
Transform
resulting in
1
0
1
0
)
(
1
0
1
0
)
(
1
0
1
0
1
0
]
[
1
]
[
1
]
[
1
]
[
N
k
N
k
n
K
N
N
n
N
k
n
K
N
N
n
n
N
N
k
kn
N
N
n
n
N
W
k
X
N
W
k
X
N
W
W
k
X
N
W
n
x
6. §5.2.1 The Discrete Fourier
Transform
Making use of the identity
we observe that the RHS of the last
equation is equal to X[l]
]
[
]
[
X
W
n
x
N
n
n
N
1
0
otherwise
,
0
integer
an
,
for
,
1
0
)
( r
rN
k
N
W
N
n
n
k
N
Hence
7. §5.2.1 The Discrete Fourier
Transform
Example – Consider the length-N sequence
1
1
0
0
1
N
n
n
,
,
]
[n
x
1
0
1
]
0
[
]
[
]
[ 0
1
0
N
k
W
x
W
n
x
k
X N
N
n
kn
N ,
Its N-point DFT is given by
8. §5.2.1 The Discrete Fourier
Transform
Example – Consider the length-N sequence
1
1
,
1
0
,
0
,
1
]
[
N
n
m
m
n
m
n
n
y
1
0
]
[
]
[
]
[
1
0
N
k
W
W
m
y
W
n
y
k
Y km
N
km
N
N
n
kn
N ,
Its N-point DFT is given by
9. §5.2.1 The Discrete Fourier
Transform
Example – Consider the length-N sequence
defined for 0≤n≤N-1
1
0
),
/
2
cos(
]
[
N
r
N
rn
n
g
)
(
2
1
2
1
]
[ /
2
/
2
rn
N
rn
N
N
rn
j
N
rn
j
W
W
e
e
n
g
Using a trigonometric identity we can write
10. §5.2.1 The Discrete Fourier
Transform
The N-point DFT of g[n] is thus given by
1
0
2
1
]
[
]
[
1
0
1
0
)
(
)
(
1
0
N
k
W
W
W
n
g
k
G
N
n
N
n
n
k
r
N
n
k
r
N
N
n
kn
N
11. §5.2.1 The Discrete Fourier
Transform
Making use of the identity
otherwise
,
0
integer
an
,
for
,
1
0
)
( r
rN
k
N
W
N
n
n
k
N
we get
1
0
otherwis
0
for
,
2
/
for
,
2
/
]
[
N
k
r
N
k
N
r
k
N
k
G
,
12. §5.2.2 Matrix Relations
The DFT samples defined by
1
0
,
]
[
]
[
1
0
N
k
W
n
x
k
X
N
n
kn
N
T
T
N
x
x
x
x
N
X
X
X
X
]
1
[
]
1
[
]]
0
[
[
]]
1
[
]
1
[
]
0
[
[
can be expressed in matrix form as
X=Dnx
where
13. §5.2.2 Matrix Relations
and DN is the N×N DFT matrix given by
2
)
1
(
)
1
(
2
)
1
(
)
1
(
2
4
2
)
1
(
2
1
1
1
1
1
1
1
1
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
W
W
W
W
W
W
W
W
W
D
14. §5.2.2 Matrix Relations
Likewise, the IDFT relation given by
where is the N×N DFT matrix
DN
1
1
0
,
]
[
1
]
[
1
0
N
n
W
K
X
N
n
x
N
k
kn
N
X
D
x N
1
can be expressed in matrix form as
15. §5.2.2 Matrix Relations
where
Note:
D
D N
N
N
*
1 1
2
)
1
(
)
1
(
2
)
1
(
)
1
(
2
4
2
)
1
(
2
1
1
1
1
1
1
1
1
1
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
W
W
W
W
W
W
W
W
W
D
16. §5.2.3 DFT Computation Using
MATLAB
The functions to compute the DFT and the
IDFT are fft and ifft
These functions make use of FFT
algorithms which are computationally highly
efficient compared to the direct computation
Programs 5_1.m and 5_2.m illustrate the use
of these functions
17. §5.2.3 DFT Computation Using
MATLAB
Example –a Program 5_3.m can be used to
compute the DFT and the DTFT of the
sequence x[n]=cos(6πn/16), 0≤n≤15
as shown below
indicates DFT samples
18. §5.3.3 DTFT from DFT by
Interpolation
The N-point DFT X[k] of a length-N
sequence x[n] is simply the frequency
samples of its DTFT X(ejω) evaluated at N
uniformly spaced frequency points
1
0
,
/
2
N
k
N
k
k
Given the N-point DFT X[k] of a length-N
sequence x[n], its DTFT X(ejω) can be
uniquely determined from X[k]
19. §5.3.3 DTFT from DFT by
Interpolation
Thus
S
N
n
n
N
k
j
N
k
n
j
N
n
kn
N
N
k
N
n
n
j
j
e
e
W
e
e
k
X
N
k
X
N
n
x
X
1
0
)
/
2
(
1
0
1
0
1
0
1
0
]
[
1
]
]
[
1
[
]
[
)
(
20. §5.3.3 DTFT from DFT by
Interpolation
To develop a compact expression for the
sum S, let
)
/
2
( N
k
j
e
r
Then
From the above
1
0
N
n
n
r
S
1
1
1
1
1
0
1
1
1
N
N
N
n
n
N
N
n
N
n
n
n
r
S
r
r
r
r
r
rS
21. §5.3.3 DTFT from DFT by
Interpolation
Or, equivalently,
Hence
]
2
/
)
1
)][(
/
2
[
)]
/
2
(
[
)
2
(
2
2
sin
2
2
sin
1
1
1
1
N
N
k
j
N
k
j
k
N
j
N
e
N
k
N
k
N
e
e
r
r
S
N
r
S
r
rS
S
1
)
1
(
22. §5.3.3 DTFT from DFT by
Interpolation
therefore
]
2
/
)
1
)][(
/
2
[
1
0
2
2
sin
2
2
sin
]
[
1
)
(
N
N
k
j
N
k
j
e
N
k
N
k
N
k
X
N
e
X
23. §5.3.4 Sampling the DTFT
Consider a sequence x[n] with a DTFT
X(ejω)
We sample X(ejω) at N equally spaced
points ωk=2πk/N, 0≤k≤N-1 deleloping the N
frequency samples
These N frequency samples can be
considered as an N-point DFT Y[k] whose
N- point IDFT is a length-N sequence y[n]
)}
(
{ e
k
j
X
24. §5.3.4 Sampling the DTFT
Now
=-
j
j
e
x
e
X ]
[
)
(
=-
=-
k
N
N
k
j
N
k
j
j
W
x
e
x
e
X
e
X
k
Y k
]
[
]
[
)
(
)
(
]
[
/
2
/
2
kn
N
N
k
W
k
Y
N
n
y
1
0
]
[
1
]
[
=
Thus
An IDFT of Y[k] yields
25. §5.3.4 Sampling the DTFT
i.e.
1
0
)
(
1
0
1
]
[
]
[
1
]
[
N
k
n
k
N
kn
N
k
N
N
k
W
N
x
W
W
x
N
n
y
=
Making use of the identity
otherwise
,
0
for
,
1
1 1
0
)
( mN
n
r
W
N
N
n
r
n
k
N
=
26. §5.3.4 Sampling the DTFT
we arrive at the desired relation
m
N
n
mN
n
x
n
y 1
0
,
]
[
]
[
Thus y[n] is obtained from x[n] by adding an
infinite number of shifted replicas of x[n],
with each replica shifted by an integer
multiple of N sampling instants, and
observing the sum only for the interval
0≤n≤N-1
27. §5.3.4 Sampling the DTFT
To apply
1
0
,
]
[
]
[
N
n
mN
n
x
n
y
m
to finite-length sequences, we assume that
the samples outside the specified range are
zeros
Thus if x[n] is a length-M sequence with
M≤N, then y[n]= x[n] , for 0≤n≤N-1
28. §5.3.4 Sampling the DTFT
If M > N, there is a time-domain aliasing of
samples of x[n] in generating y[n], and x[n]
cannot be recovered from y[n]
Example – Let {x[n]}={0 1 2 3 4 5}
↑
By sampling its DTFT X(ejω) at ωk=2πk/4,
0≤k≤3 and then applying a 4-point IDFT to
these samples, we arrive at the sequence
y[n] given by
29. §5.3.4 Sampling the DTFT
y[n]= x[n]+ x[n+4]+x[n-4] 0≤n≤3
i.e. {y[n]}={4 6 2 3}
↑
{x[n]} cannot be recovered from {y[n]}
30. Numerical Computation of the
DTFT Using the DFT
A practical approach to the numerical
computation of the DTFT of a finite-length
sequence
Let X(ejω) be the DTFT of a length-N
sequence x[n]
We wish to evaluate X(ejω) at a dense grid of
frequencies ωk=2πk/M, 0≤k≤M-1,where M >>
N:
31. Numerical Computation of the
DTFT Using the DFT
Define a new sequence
M
kn
j
N
n
n
j
N
n
j
e
n
x
e
n
x
e
X k
k /
2
1
0
1
0
]
[
]
[
)
(
M
kn
j
M
n
e
j
e
n
x
e
X k /
2
1
0
]
[
)
(
1
,
0
1
0
,
]
[
]
[
M
n
N
N
n
n
x
n
xe
Then
32. Numerical Computation of the
DTFT Using the DFT
The DFT Xe[k] can be computed very
efficiently using the FFT algorithm if M is an
integer power of 2
The function freqz employs this approach to
evaluate the frequency response at a
prescribed set of frequencies of a DTFT
expressed as a rational function in e-jω
Thus is essentially an M-point DFT
Xe[k] of the length-M sequence xe[n]
)
(e
k
j
X
33. DFT Properties
Like the DTFT, the DFT also satisfies a
number of properties that are useful in
signal processing applications
Some of these properties are essentially
identical to those of the DTFT, while some
others are somewhat different
A summary of the DFT properties are given
in tables in the following slides
34. Table 5.1: DFT Properties: Symmetry
Relations
x[n] is a complex sequence
35. Table 5.2: DFT Properties: Symmetry
Relations
x[n] is a real sequence
37. §5.4.1 Circular Shift of a Sequence
This property is analogous to the time-
shifting property of the DTFT as given in
Table 3.4, but with a subtle difference
Consider length-N sequences defined for
0≤n≤N-1
Sample values of such sequences are equal
to zero for values of n<0 and n≥N
38. §5.4.1 Circular Shift of a Sequence
If x[n] is such a sequence, then for any
arbitrary integer n0, the shifted sequence
x1[n]= x(n-n0)
is no longer defined for the range 0≤n≤N-1
We thus need to define another type of a
shift that will always keep the shifted
sequence in the range 0≤n≤N-1
39. §5.4.1 Circular Shift of a Sequence
The desired shift, called the circular shift,
is defined using a modulo operation:
]
[
]
[ 0 N
c n
n
x
n
x
0
0
0
0
0
,
]
[
1
,
]
[
]
[
n
n
for
n
n
N
x
N
n
n
for
n
n
x
n
xc
For n0>0 (right circular shift), the above
equation implies
40. §5.4.1 Circular Shift of a Sequence
Illustration of the concept of a circular shift
]
5
[
]
1
[
6
6
n
x
n
x -
]
2
[
]
4
[
6
6
n
x
n
x -
]
[n
x
41. §5.4.1 Circular Shift of a Sequence
As can be seen from the previous figure, a
right circular shift by n0 is equivalent to a left
circular shift by N-n0 sample periods
A circular shift by an integer number n0
greater than N is equivalent to a circular shift
by N
n0
42. §5.4.2 Circular Convolution
This operation is analogous to linear
convolution, but with a subtle difference
Consider two length-N sequences, g[n] and
h[n], respectively
Their linear convolution results in a length-
(2N-1) sequence yL[n] given by
2
2
0
1
0
N
n
m
n
h
m
g
n
y
N
m
L ],
[
]
[
]
[
43. §5.4.2 Circular Convolution
In computing yL[n] we have assumed that
both length-N sequence have been zero-
padded to extend their lengths to 2N-1
The longer form of yL[n] results from the
time-reversal of the sequence h[n] and its
linear shift to the right
The first nonzero value of yL[n] is
yL[0]=g[0]h[0] ,and the last nonzero value is
yL[2N-2]=g[N-1]h[N-1]
44. §5.4.2 Circular Convolution
To develop a convolution-like operation
resulting in a length-N sequence yC[n] , we
need to define a circular time-reversal, and
then apply a circular time-shift
Resulting operation, called a circular
convolution, is defined by
1
0
],
[
]
[
]
[
1
0
N
n
m
n
h
m
g
n
y
N
m
N
C
45. §5.4.2 Circular Convolution
Since the operation defined involves two
length-N sequences, it is often referred to as
an N-point circular convolution, denoted as
The circular convolution is commutative, i.e.
]
[
]
[
]
[
]
[ n
g
n
h
n
h
n
g N
N
]
[
]
[
]
[ n
h
n
g
n
y N
46. §5.4.2 Circular Convolution
Example – Determine the 4-point circular
convolution of the two length-4 sequences:
as sketched below
}
1
1
2
2
{
]}
[
{
},
1
0
2
1
{
]}
[
{ n
h
n
g
47. §5.4.2 Circular Convolution
The result is a length-4 sequence yC[n]
given by
6
)
2
1
(
)
1
0
(
)
1
2
(
)
2
1
(
]
1
[
]
3
[
]
2
[
]
2
[
]
3
[
]
1
[
]
0
[
]
0
[
]
[
]
[
]
0
[ 4
3
0
h
g
h
g
h
g
h
g
m
h
m
g
m
C
y
,
]
[
]
[
]
[
]
[
]
[
3
0
4
m
C m
n
h
m
g
n
h
n
g
n
y 4
3
0
n
From the above we observe
48. §5.4.2 Circular Convolution
Likewise
7
)
1
1
(
)
1
0
(
)
2
2
(
)
2
1
(
]
2
[
]
3
[
]
3
[
]
2
[
]
0
[
]
1
[
]
1
[
]
0
[
]
1
[
]
[
]
1
[ 4
3
0
h
g
h
g
h
g
h
g
m
h
m
g
m
C
y
6
)
1
1
(
)
2
0
(
)
2
2
(
)
1
1
(
]
3
[
]
3
[
]
0
[
]
2
[
]
1
[
]
1
[
]
2
[
]
0
[
]
2
[
]
[
]
2
[ 4
3
0
h
g
h
g
h
g
h
g
m
h
m
g
m
C
y
49. §5.4.2 Circular Convolution
The circular convolution can also be
computed using a DFT-based approach as
indicated in Table 5.3
5
)
2
1
(
)
2
0
(
)
1
2
(
)
1
1
(
]
0
[
]
3
[
]
1
[
]
2
[
]
2
[
]
1
[
]
3
[
]
0
[
]
3
[
]
[
]
3
[ 4
3
0
h
g
h
g
h
g
h
g
m
h
m
g
m
C
y
yC[n]
and
50. §5.4.2 Circular Convolution
Example – Consider the two length-4
sequences repeated below for convenience:
The 4-point DFT G[k] of g[n] is given by
G[k]= g[0]+g[1]e-j2πk/4 +g[2]e-j4πk/4 +g[3]e-j6πk/4
=1+2e-jπk/2 +e-j3πk/2 , 0≤k≤3
52. §5.4.2 Circular Convolution
Hence, H[0]=2+2+1+1=6,
H [1]=2-j2-1+j=1-j,
H [2]=2-2+1-1=0,
H [3]=2+j2-1-j=1+j
The two 4-point DFTs can also be computed
using the matrix relation given earlier
54. §5.4.2 Circular Convolution
If YC[k] denotes the 4-point DFT of yC[n]
then from Table 3.5 we observe
YC[k]= G[k] H[k] , 0≤k≤3
2
0
2
24
]
3
[
]
3
[
]
2
[
]
2
[
]
1
[
]
1
[
]
0
[
]
0
[
]
3
[
]
2
[
]
1
[
]
0
[
j
j
H
G
H
G
H
G
H
G
Y
Y
Y
Y
C
C
C
C
Thus
55. §5.4.2 Circular Convolution
A 4-point IDFT of YC[k] yields
5
6
7
6
2
0
2
24
1
1
1
1
1
1
1
1
1
1
1
1
4
1
]
3
[
]
2
[
]
1
[
]
0
[
4
1
]
3
[
]
2
[
]
1
[
]
0
[
*
4
j
j
j
j
j
j
Y
Y
Y
Y
D
y
y
y
y
C
C
C
C
C
C
C
C
56. §5.4.2 Circular Convolution
Example – Now let us extended the two
length-4 sequences to length 7 by appending
each with three zero-valued samples, i.e.
6
4
,
0
3
0
,
]
[
]
[
6
4
,
0
3
0
,
]
[
]
[
n
n
n
h
n
h
n
n
n
g
n
g
e
e
57. §5.4.2 Circular Convolution
We next determine the 7-point circular
convolution of ge[n] and he[n] :
From the above
y[0]=ge[0]he[0]+ge[1]he[6]+ge[3]he[4]
+ge[4]he[3]+ge[5]he[2]+ge[6]he[1]
=ge[0]he[0]=1×2=2
6
0
,
]
[
]
[
]
[
6
0
7
n
m
n
h
n
g
n
y
m
e
e
58. §5.4.2 Circular Convolution
Continuing the process we arrive
y[1]=g[0]h[1]+g[1]h[0]=(1×2)+(2×2)=6,
y[2]=g[0]h[2]+g[2]h[0]
=(1×2)+(2×2)+(0×2)=5,
y[3]=g[0]h[3]+g[1]h[2]+g[2]h[1]+g[3]h[0]
=(1×1)+(2×1)+(0×2)+(1×2)=5,
y[4]=g[1]h[3]+g[2]h[2]+g[3]h[1]
=(2×1)+(0×1)+(1×2)=4,
60. §5.4.2 Circular Convolution
The N-point circular convolution can be
written in matrix form as
]
1
[
]
2
[
]
1
[
]
0
[
]
0
[
]
3
[
]
2
[
]
1
[
]
3
[
]
0
[
]
1
[
]
2
[
]
2
[
]
1
[
]
0
[
]
1
[
]
1
[
]
2
[
]
1
[
]
0
[
]
1
[
]
2
[
]
1
[
]
0
[
N
g
g
g
g
h
N
h
N
h
N
h
h
h
h
h
h
N
h
h
h
h
N
h
N
h
h
N
y
y
y
y
C
C
C
C
Note: The elements of each diagonal of the
N×N matrix are equal
Such a matrix is called a circulant matrix
61. §5.4.2 Circular Convolution
First, the samples of the two sequences are
multiplied using the conventional
multiplication method as shown on the next
slide
Consider the evaluation of y[n]=h[n] g[n]
where {g[n]} and {h[n]} are length-4
sequences
*
Tabular Method
We illustrate the method by an example
62. §5.4.2 Circular Convolution
The partial products generated in the 2nd, 3rd, and
4th rows are circularly shifted to the left as
indicated above
63. §5.4.2 Circular Convolution
The modified table after circular shifting is
shown below
The samples of the sequence { yc[n]} are
obtained by adding the 4 partial products in
the column above of each sample
65. §5.9 Computation of the DFT of
Real Sequences
In most practical applications, sequences of
interest are real
In such cases, the symmetry properties of
the DFT given in Table 5.2 can be exploited
to make the DFT computations more
efficient
66. §5.9.1 N-Point DFTs of Two Length-
N Real Sequences
Let g[n] and h[n] be two length-N real
sequences with G[k] and H[k] denoting their
respective N-point DFTs
These two N-point DFTs can be computed
efficiently using a single N-point DFT
Define a complex length-N sequence
x[n]=g[n]+jh[n]
Hence, g[n]=Re{x[n]} and h[n]=Im{x[n]}
67. §5.9.1 N-Point DFTs of Two Length-
N Real Sequences
Let X[k] denote the N-point DFT of x[n]
Then, from Table 5.1 we arrive at
]
[
]
[
2
1
]
[
]
[
]
[
2
1
]
[
*
*
N
N
k
X
k
X
j
k
H
k
X
k
X
k
G
]
[
]
[ *
*
N
N k
N
X
k
X
Note that for 0≤k≤N-1,
68. §5.9.1 N-Point DFTs of Two Length-
N Real Sequences
Example – We compute the 4-point DFTs of
the two real sequences g[n] and h[n] given
below
1
1
2
2
]
[
,
1
0
2
1
]
[ n
h
n
g
Then {x[n]}={g[n]}+j{h[n]} is given by
j
j
j
j
n
x 1
2
2
2
1
]
[
70. §5.9.1 N-Point DFTs of Two Length-
N Real Sequences
Therefore
{G[k]}=[4 1-j -2 1+j]
{G[k]}=[6 1-j 0 1+j]
verifying the results derived earlier
71. §5.9.2 2N-Point DFT of a Real
Sequence Using an N-point DFT
Let v[n] be a length-2N real sequence with
an 2N-point DFT V[k]
Define two length-N real sequences g[n]
and h[n] as follows:
N
n
n
v
n
h
n
v
n
g
0
,
]
1
2
[
]
[
,
]
2
[
]
[
Let G[k] and H[k] denote their respective N-
point DFTs
72. §5.9.2 2N-Point DFT of a Real
Sequence Using an N-point DFT
Define a length-N complex sequence
{x[n]}={g[n]}+j{h[n]}
with an N-point DFT X[k]
Then as shown earlier
]}
[
]
[
{
2
1
]
[
]}
[
]
[
{
2
1
]
[
N
N
k
X
k
X
j
k
H
k
X
k
X
k
G
73. §5.9.2 2N-Point DFT of a Real
Sequence Using an N-point DFT
Now
1
2
0
,
]
[
]
[
]
[
]
[
]
1
2
[
]
2
[
]
[
]
[
1
0
2
1
0
2
1
0
1
0
)
1
2
(
2
1
0
2
2
1
0
2
1
2
0
N
k
n
h
n
g
n
h
n
g
n
v
n
v
n
v
k
V
W
W
W
W
W
W
W
W
W
nk
N
N
n
k
N
nk
N
N
n
k
N
nk
N
N
n
nk
N
N
n
k
n
N
N
n
nk
N
N
n
nk
N
N
n
74. §5.9.2 2N-Point DFT of a Real
Sequence Using an N-point DFT
i.e.,
1
2
0
,
]
[
]
[
]
[ 2
N
k
k
H
W
k
G
k
V N
k
N
N
}
1
1
1
0
2
2
2
1
{
]}
[
{ n
v
We form two length-4 real sequences as
follows
Example – Let us determine the 8-point
DFT V[k] of the length-8 real sequence
75. §5.9.2 2N-Point DFT of a Real
Sequence Using an N-point DFT
Now
7
0
,
]
[
]
[
]
[ 4
8
4
k
k
H
W
k
G
k
V k
Substituting the values of the 4-point DFTs
G[k] and H[k] computed earlier we get
}
1
1
2
2
{
]}
1
2
[
{
]}
[
{
}
1
0
2
1
{
]}
2
[
{
]}
[
{
n
v
n
h
n
v
n
g
76. §5.9.2 2N-Point DFT of a Real
Sequence Using an N-point DFT
2
6
4
]
0
[
]
0
[
]
4
[
4142
.
0
1
)
1
(
)
1
(
]
3
[
]
3
[
]
3
[
2
0
2
]
2
[
]
2
[
]
2
[
4142
.
2
1
)
1
(
)
1
(
]
1
[
]
1
[
]
1
[
10
6
4
]
0
[
]
0
[
]
0
[
4
8
4
/
3
3
8
2
/
2
8
4
/
1
8
j
j
j
j
e
H
W
G
V
j
j
e
j
H
W
G
V
e
H
W
G
V
j
j
e
j
H
W
G
V
H
G
V
77. §5.9.2 2N-Point DFT of a Real
Sequence Using an N-point DFT
4142
.
2
1
)
1
(
)
1
(
]
3
[
]
3
[
]
7
[
2
0
2
]
2
[
]
2
[
]
6
[
4142
.
0
1
)
1
(
)
1
(
]
1
[
]
1
[
]
5
[
4
/
7
7
8
2
/
3
6
8
4
/
5
5
8
j
j
e
j
H
W
G
V
e
H
W
G
V
j
j
e
j
H
W
G
V
j
j
j
78. §5.10 Linear Convolution Using
the DFT
Linear convolution is a key operation in
many signal processing applications
Since a DFT can be efficiently implemented
using FFT algorithms, it is of interest to
develop methods for the implementation of
linear convolution using the DFT
79. §5.10.1 Linear Convolution of Two
Finite-Length Sequences
Let g[n] and h[n] be two finite-length
sequences of length N and M, respectively
Denote L=N+M-1
Define two length-L sequences
1
,
0
1
0
,
]
[
]
[
1
,
0
1
0
,
]
[
]
[
L
n
M
N
n
n
h
n
h
L
n
N
N
n
n
g
n
g
e
e
80. §5.10.1 Linear Convolution of Two
Finite-Length Sequences
The corresponding implementation scheme
is illustrated below
Then
Zero-padding
with
(M-1) zeros
Zero-padding
with
(N-1) zeros
(N+M-1)
point DFT
(N+M-1)
point DFT
(N+M-1)
point IDFT
g[n]
h[n]
ge[n]
he[n]
yL[n]
Length-N
Length-M Length-(N+M-1)
L
yL[n]=g[n] h[n]=yC[n]=ge[n] he[n]
﹡
81. §5.10.2 Linear Convolution of a
Finite- Length Sequence with an
Infinite-Length Sequence
We next consider the DFT-based
implementation of
]
[
]
[
]
[
]
[
]
[
1
0
n
x
n
h
n
x
h
n
y
M
where h[n] is a finite-length sequence of
length M and x[n] is an infinite length (or a
finite length sequence of length much
greater than M)
82. §5.10.2 Overlap-Add Method
We first segment x[n], assumed to be a
causal sequence here without any loss of
generality, into a set of contiguous finite-
length subsequences xm [n] of length N each:
0
]
[
]
[
m
m mN
n
x
n
x
where
otherwise
,
0
1
0
,
]
[
]
[
N
n
mN
n
x
n
xm
83. §5.10.2 Overlap-Add Method
Thus we can write
where
0
]
[
]
[
]
[
]
[
m
m mN
n
y
n
x
n
h
n
y ﹡
Since h[n] is of length M and xm [n] is of
length N, the linear convolution
is of length N+M-1
﹡ ]
[
]
[ n
x
n
h m
]
[
]
[
]
[ n
x
n
h
n
y m
m ﹡
84. §5.10.2 Overlap-Add Method
As a result, the desired linear convolution
has been broken up into a
sum of infinite number of short-length linear
convolutions of length N+M-1
each: ]
[
]
[
]
[ n
h
n
x
n
y m
m ﹡
]
[
]
[
]
[ n
x
n
h
n
y ﹡
Each of these short convolutions can be
implemented using the DFT-based method
discussed earlier, where now the DFTs (and
the IDFT) are computed on the basis of
N+M-1 points
85. §5.10.2 Overlap-Add Method
There is one more subtlety to take care of
before we can implement
0
]
[
]
[
m
m mN
n
y
n
y
Now the first convolution in the above sum,
, is of length N+M-1 and
is defined for 0≤ N+M-2
﹡ ]
[
]
[
]
[ 0
0 n
x
n
h
n
y
using the DFT-based approach
86. §5.10.2 Overlap-Add Method
There is an overlap of M-1samples
between these two short linear convolutions
The second short convolution
, is also of length N+M-1
but is defined for N≤n≤2N+M-2
]
[
]
[
]
[ 1
1 n
x
n
h
n
y ﹡
Likewise, the third short convolution
, is also of length N+M-1 but
is defined for 2N≤n≤3N+M-2
﹡ ]
[
]
[
]
[ 2
2 n
x
n
h
n
y
87. §5.10.2 Overlap-Add Method
This process is illustrated in the figure on
the next slide for M=5 and N=70
In general, there will be an overlap of M-1
samples between the samples of the short
convolutions h[n] xr-1[n] and h[n] xr [n] for
(r-1)N≤n≤rN+M-2
﹡
﹡
Thus there is an overlap of M-1 samples
between h[n] x1[n] and h[n] x2[n]
﹡
﹡
90. §5.10.2 Overlap-Add Method
Therefore, y[n] obtained by a linear
convolution of x[n] and h[n] is given by
y[n]=y0[n], 0≤n≤6
y[n]=y0[n]+ y1[n-7], 7≤n≤10
y[n]=y1[n-7], 11≤n≤13
y[n]= y1[n-7]+ y2[n-14], 14≤n≤17
y[n]= y2[n-14], 18≤n≤20
91. §5.10.2 Overlap-Add Method
The above procedure is called the overlap-
add method since the results of the short
linear convolutions overlap and the
overlapped portions are added to get the
correct final result
The function fftfilt can be used to implement
the above method
92. §5.10.2 Overlap-Add Method
Program 5_5 illustrates the use of fftfilt in the
filtering of a noise-corrupted signal using a
length-3 moving average filter
The plots generated by running this program
is shown below
93. §5.10.2 Overlap-Save Method
In implementing the overlap-add method
using the DFT, we need to compute two
(N+M-1)-point DFTs and one (N+M-1)-point
IDFT since the overall linear convolution
was expressed as a sum of short-length
linear convolutions of length (N+M-1) each
It is possible to implement the overall linear
convolution by performing instead circular
convolution of length shorter than (N+M-1)
94. §5.10.2 Overlap-Save Method
To this end, it is necessary to segment x[n]
into overlapping blocks xm[n], keep the terms
of the circular convolution of h[n] with xm[n]
that corresponds to the terms obtained by a
linear convolution of h[n] and xm[n], and
throw the other parts of the circular
convoluition
95. §5.10.2 Overlap-Save Method
To understand the correspondence between
the linear and circular convolutions, consider
a length-4 sequence x[n] and a length-3
sequence h[n]
Let yL[n] denote the result of a linear
convolution of x[n] with h[n]
The six samples of yL[n] are given by
97. §5.10.2 Overlap-Save Method
If we append h[n] with a single zero-valued
sample and convert it into a length-4
sequence he[n], the 4-point circular
convolution yC[n] of he[n] and x[n] is given by
yC[0]=h[0]x[0]+h[1]x[3]+h[2]x[2]
yC[1]=h[0]x[1]+h[1]x[0]+h[2]x[3]
yC[2]=h[0]x[2]+h[1]x[1]+h[2]x[0]
yC[3]=h[0]x[3]+h[1]x[2]+h[2]x[1]
98. §5.10.2 Overlap-Save Method
If we compare the expressions for the
samples of yL[n] with the samples of yC[n],
we observe that the first 2 terms of yC[n] do
not correspond to the first 2 terms of yL[n],
whereas the last 2 terms of yC[n] are
precisely the same as the 3rd and 4th terms
of yL[n], i.e.,
yL[0]≠yC[0], yL[1]≠yC[1]
yL[2]≠yC[2], yL[3]≠yC[3]
99. §5.10.2 Overlap-Save Method
General case: N-point circular convolution of
a length-M sequence h[n] with a length-N
sequence x[n] with N > M
First M-1samples of the circular convolution
are incorrect and are rejected
Remaining N - M+1 samples correspond to
the correct samples of the linear convolution
of h[n] with x[n]
100. §5.10.2 Overlap-Save Method
Now, consider an infinitely long or very long
sequence x[n]
Break it up as a collection of smaller length
(length-4) overlapping sequences xm[n] as
xm[n]= x [n+2m], 0≤n≤3, 0≤m≤∞
Next,form
wm[n]=h[n] xm[n]
4
101. §5.10.2 Overlap-Save Method
Or, equivalently,
wm[0]=h[0]xm[0]+h[1]xm[3]+h[2]xm[2]
wm[1]=h[0]xm[1]+h[1]xm[0]+h[2]xm[3]
wm[2]=h[0]xm[2]+h[1]xm[1]+h[2]xm[0]
wm[3]=h[0]xm[3]+h[1]xm[2]+h[2]xm[1]
Computing the above for m = 0, 1, 2, 3, . . . ,
and substituting the values of xm[n] we arrive
at
102. §5.10.2 Overlap-Save Method
w0[0]=h[0]x[0]+h[1]x[3]+h[2]x[2] ← Reject
w0[1]=h[0]x[1]+h[1]x[0]+h[2]x[3] ← Reject
w0[2]=h[0]x[2]+h[1]x[1]+h[2]x[0]=y[2]← Save
w0[3]=h[0]x[3]+h[1]x[2]+h[2]x[1]=y[2]← Save
w1[0]=h[0]x[2]+h[1]x[5]+h[2]x[4] ← Reject
w1[1]=h[0]x[3]+h[1]x[2]+h[2]x[5] ← Reject
w1[2]=h[0]x[4]+h[1]x[3]+h[2]x[2]=y[4]← Save
w1[3]=h[0]x[5]+h[1]x[4]+h[2]x[3]=y[5]← Save
104. §5.10.2 Overlap-Save Method
It should be noted that to determine y[0] and
y[1], we need to form x-1[n] :
x-1[0]=0, x-1[1]=0,
x-1[2]=x[0], x-1[3]=x[1]
]
[
]
[
]
[ 1
1 n
x
n
h
n
w
4
and compute for 0≤n≤3
reject w-1[0] and w-1[1] ,and save w-1[2]= y[0]
and w-1[3]= y[1]
105. §5.10.2 Overlap-Save Method
General Case: Let h[n] be a length-N
sequence
Let xm[n] denote the m-th section of an
infinitely long sequence x[n] of length N and
defined by
xm[n]= x [n+m(N-m+1)], 0≤n≤N-1
with M<N
106. §5.10.2 Overlap-Save Method
Then, we reject the first M-1 samples of
wm[n] and “abut” the remaining N-M+1
samples of wm[n] to form yL[n], the linear
convolution of h[n] and x[n]
If ym[n] denotes the saved portion of wm[n],
i.e.
Let wm[n]=h[n] xm[n]
N
2
1
,
]
[
2
0
,
0
]
[
N
n
M
n
w
M
n
n
y
m
m
107. §5.10.2 Overlap-Save Method
Then
yL [n+m(N-M+1)]=ym[n] , M-1≤n≤N-1
The approach is called overlap-save method
since the input is segmented into
overlapping sections and parts of the results
of the circular convolutions are saved and
abutted to determine the linear convolution
result