Download Efficient DFT Computation of Real Sequences with Overlap-Save and more Slides Digital Signal Processing in PDF only on Docsity!
1 Copyright © 2001, S. K. Mitra
Computation of the DFT ofComputation of the DFT of
Real SequencesReal Sequences
- In most practical applications, sequences of
interest are real
- In such cases, the symmetry properties of
the DFT given in Table 3.7 can be exploited
to make the DFT computations more
efficient
2 Copyright © 2001, S. K. Mitra
NN - -PointPoint DFTsDFTs of Two Lengthof Two Length-- NN
Real SequencesReal 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
- Hence, g [ n ] = Re { x [ n ]} and h [ n ] = Im { x [ n ]}
x [ n ]= g [ n ]+ jh [ n ]
3 Copyright © 2001, S. K. Mitra
NN - -PointPoint DFTsDFTs of Two Lengthof Two Length-- NN
Real SequencesReal Sequences
- Let X [ k ] denote the N -point DFT of x [ n ]
- Then, from Table 3.6 we arrive at
- Note that
[ ] { [ ] *[ ]}
2
1 N
G k = Xk + X 〈− k 〉
[ ] { [ ] *[ ]}
2
1
j N
H k = Xk − X 〈− k 〉
X *[ 〈− k 〉 N ]= X *[〈 N − k 〉 N ]
4 Copyright © 2001, S. K. Mitra
NN - -PointPoint DFTsDFTs of Two Lengthof Two Length-- NN
Real SequencesReal Sequences
- Example - We compute the 4-point DFTs of
the two real sequences g [ n ] and h [ n ] given
below
{ g [ n ]}= { 1 2 0 1 }, { h [ n ]}={ 2 2 1 1 }
↑ ↑
{ x [ n ]}={ g [ n ]}+ j { h [ n ]}
{ x [ n ]}= { 1 + j 2 2 + j 2 j 1 + j }
↑
5 Copyright © 2001, S. K. Mitra
NN - -PointPoint DFTsDFTs of Two Lengthof Two Length-- NN
Real SequencesReal Sequences
- Its DFT X [ k ] is
- From the above
- Hence
j
j
j
j
j
j
j j
j j
X
X
X
X
[ ]
[ ]
[]
[ ]
X * [ k ]=[ 4 − j 6 2 − 2 − j 2 ]
X *[ 〈 4 − k 〉 4 ]=[ 4 − j 6 − j 2 − 2 2 ]
6 Copyright © 2001, S. K. Mitra
NN - -PointPoint DFTsDFTs of Two Lengthof Two Length-- NN
Real SequencesReal Sequences
verifying the results derived earlier
{ G [ k ]}= { 4 1 − j − 2 1 + j }
{ H [ k ]}= { 6 1 − j 0 1 + j }
7 Copyright © 2001, S. K. Mitra
22 NN - -Point DFT of a RealPoint DFT of a Real
Sequence Using anSequence Using an NN - -point DFTpoint DFT
- Let v [ n ] be a length-2 N real sequence with
an 2 N -point DFT V [ k ]
- Define two length- N real sequences g [ n ]
and h [ n ] as follows:
- Let G [ k ] and H [ k ] denote their respective N -
point DFTs
g [ n ]= v [ 2 n ], h [ n ]= v [ 2 n + 1 ], 0 ≤ n ≤ N
8 Copyright © 2001, S. K. Mitra
22 NN - -Point DFT of a RealPoint DFT of a Real
Sequence Using anSequence Using an NN - -point DFTpoint DFT
- Define a length- N complex sequence
with an N -point DFT X [ k ]
{ x [ n ]}={ g [ n ]}+ j { h [ n ]}
[ ] { [] *[ ]}
2
1 G k = Xk + X 〈− k 〉 N
[ ] { [] *[ ]}
2
1 H k = j Xk − X 〈− k 〉 N
9 Copyright © 2001, S. K. Mitra
22 NN - -Point DFT of a RealPoint DFT of a Real
Sequence Using anSequence Using an NN - -point DFTpoint DFT
−
=
2 1
0
2
N
n
nk N
V [ k ] v [ n ] W
−
=
−
=
= + +
1
0
1
0
2 1 2
2 2 2 2 1
N
n
N
n
n k N
nk v nWN v n W
( ) [ ] [ ]
−
=
−
=
1
0
1
0
2
N
n
N
n
k N
nk N
nk g [ n ] WN h [ n ] W W
−
=
−
=
1
0
1
0
N
n
N
n
nk N
k N
nk g [ n ] WN W h [ n ] W , k N
10 Copyright © 2001, S. K. Mitra
22 NN - -Point DFT of a RealPoint DFT of a Real
Sequence Using anSequence Using an NN - -point DFTpoint DFT
- i.e.,
- Example - Let us determine the 8-point
DFT V[k] of the length-8 real sequence
- We form two length-4 real sequences as
follows
V [ k ]= G [〈 k 〉 ]+ W 2 H [〈 k 〉 N ], 0 ≤ k ≤ 2 N − 1
k N N
{ v [ n ]}={ 1 2 2 2 0 1 1 1 }
↑
11 Copyright © 2001, S. K. Mitra
22 NN - -Point DFT of a RealPoint DFT of a Real
Sequence Using anSequence Using an NN - -point DFTpoint DFT
- Now
- Substituting the values of the 4-point DFTs
G [ k ] and H [ k ] computed earlier we get
{ g [ n ]}= { v [ 2 n ]}={ 1 2 0 1 }
↑
{ h [ n ]}= { v [ 2 n + 1 ]}={ 2 2 1 1 }
↑
V [ k ]= G [〈 k 〉 4 ]+ W 8 H [〈 k 〉 4 ], 0 ≤ k ≤ 7
k
12 Copyright © 2001, S. K. Mitra
22 NN - -Point DFT of a RealPoint DFT of a Real
Sequence Using anSequence Using an NN - -point DFTpoint DFT
V [ 0 ]= G [ 0 ]+ H [ 0 ]= 4 + 6 = 10
[ 1 ] [ 1 ] [ 1 ]
1
V = G + W 8 H
4 ( ) ( ).
/ j e j j
j = − + − = −
− π
2 2 8
− /
[ ] [ ] [ ]
jπ
V G W H e
[ 3 ] [ 3 ] [ 3 ]
3 8
V = G + WH
3 4
/
j e j j
j
− π
4 8
− jπ
V [] G [] WH [] e
19 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
where
- Since h [ n ] is of length M and is of
length N , the linear convolution
is of length
xm [ n ]
h [ n ]* xm [ n ]
y m [ n ]= h [ n ]* xm [ n ]
∞
=
m 0
y [ n ] h [ n ]* x [ n ] y m [ n mN ]
N + M − 1
20 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd 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
each:
- 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
points
N + M − 1
( N + M − 1 )
y (^) m [ n ]= xm [ n ] h [ n ]
y [ n ]= h [ n ] x [ n ]
21 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
- There is one more subtlety to take care of
before we can implement
using the DFT-based approach
- Now the first convolution in the above sum,
, is of length
and is defined for
∞
=
m 0
y [ n ] y m [ n mN ]
N + M − 1
0 ≤ n ≤ N + M − 2
[ ] [] [ ]
0 0
y n = hn x n
22 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
- The second short convolution
, is also of length
but is defined for
- There is an overlap of samples
between these two short linear convolutions
- Likewise, the third short convolution
, is also of length
but is defined for
N + M − 1
N ≤ n ≤ 2 N + M − 2
0 ≤ n ≤ N + M − 2
M − 1
h [ n ]* x 2 [ n ]
h [ n ]* x 1 [ n ]
y 2 [ n ] =
y 1 [ n ] =
N + M − 1
23 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
- Thus there is an overlap of samples
between and
- In general, there will be an overlap of
samples between the samples of the short
convolutions and
for
- This process is illustrated in the figure on
the next slide for M = 5 and N = 7
h [ n ]* xr − 1 [ n ] h [^^ n ]* xr [ n ]
M − 1
M − 1
h [ n ]* x 1 [ n ] h [ n ]* x 2 [ n ]
24 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
25 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
Add
Add
26 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
- Therefore, y [ n ] obtained by a linear
convolution of x [ n ] and h [ n ] is given by
y [ n ]= y 0 [ n ],
y [ n ]= y 0 [ n ]+ y 1 [ n − 7 ],
y [ n ]= y 1 [ n − 7 ],
y [ n ]= y 1 [ n − 7 ] + y 2 [ n − 14 ],
[ ] [ 14 ],
2
y n = y n −
0 ≤ n ≤ 6
7 ≤ n ≤ 10
11 ≤ n ≤ 13
14 ≤ n ≤ 17
18 ≤ n ≤ 20
27 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd 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
28 Copyright © 2001, S. K. Mitra
OverlapOverlap--Add MethodAdd Method
- Program 3_6 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
0
2
4
6
8
Time index n
Amplitude
s[n] y[n]
29 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- In implementing the overlap-add method
using the DFT, we need to compute two
-point DFTs and one -
point IDFT since the overall linear
convolution was expressed as a sum of
short-length linear convolutions of length
each
- It is possible to implement the overall linear
convolution by performing instead circular
convolution of length shorter than
( N + M − 1 ) ( N + M − 1 )
( N + M − 1 )
( N + M − 1 ) 30
Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- To this end, it is necessary to segment x [ n ]
into overlapping blocks , keep the
terms of the circular convolution of h [ n ]
with that corresponds to the terms
obtained by a linear convolution of h [ n ] and
, and throw away the other parts of
the circular convolution
xm [ n ]
xm [ n ]
x [ n ] m
37 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- Or, equivalently,
- Computing the above for m = 0, 1, 2, 3,... ,
and substituting the values of we
arrive at
wm [ 0 ]= h [ 0 ] xm [ 0 ]+ h [ 1 ] xm [ 3 ]+ h [ 2 ] xm [ 2 ]
[ 1 ] [ 0 ] [ 1 ] [ 1 ] [ 0 ] [ 2 ] [ 3 ]
m m m m
w = h x + h x + h x
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 ]
xm [ n ]
38 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
[ 0 ] [ 0 ][ 0 ] [ 1 ][ 3 ] [ 2 ][ 2 ]
0
w = h x + h x + h x
w 0 (^) [ 1 ]= h [ 0 ] x [ 1 ]+ h [ 1 ] x [ 0 ]+ h [ 2 ] x [ 3 ]
w 0 (^) [ 2 ]= h [ 0 ] x [ 2 ]+ h [ 1 ] x [ 1 ]+ h [ 2 ] x [ 0 ]= y [ 2 ]
w 0 (^) [ 3 ]= h [ 0 ] x [ 3 ]+ h [ 1 ] x [ 2 ]+ h [ 2 ] x [ 1 ]= y [ 3 ]
← Reject
← Reject
← Save
← Save
w 1 [ 0 ]= h [ 0 ] x [ 2 ]+ h [ 1 ] x [ 5 ]+ h [ 2 ] x [ 4 ]
[ 1 ] [ 0 ][ 3 ] [ 1 ][ 2 ] [ 2 ][ 5 ]
1
w = h x + h x + h x
w 1 [ 2 ]= h [ 0 ] x [ 4 ]+ h [ 1 ] x [ 3 ]+ h [ 2 ] x [ 2 ]= y [ 4 ]
w 1 [ 3 ]= h [ 0 ] x [ 5 ]+ h [ 1 ] x [ 4 ]+ h [ 2 ] x [ 3 ]= y [ 5 ]
← Reject
← Reject
←Save
← Save
39 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
w 2 [ 0 ]= h [ 0 ] x [ 4 ]+ h [ 1 ] x [ 5 ]+ h [ 2 ] x [ 6 ] ←^ Reject
w 2 [ 1 ]= h [ 0 ] x [ 5 ]+ h [ 1 ] x [ 4 ]+ h [ 2 ] x [ 7 ] ←^ Reject
w 2 [ 2 ]= h [ 0 ] x [ 6 ]+ h [ 1 ] x [ 5 ]+ h [ 2 ] x [ 4 ]= y [ 6 ]← Save
w 2 (^) [ 3 ]= h [ 0 ] x [ 7 ]+ h [ 1 ] x [ 6 ]+ h [ 2 ] x [ 5 ]= y [ 7 ]← (^) Save
40 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- It should be noted that to determine y [0] and
y [1], we need to form :
and compute for
reject and , and save
and
x (^) − 1 [ n ]
x − 1 [ 0 ] = 0 , x − 1 [ 1 ]= 0 ,
w [ n ] h [ n ] x [ n ]
− 1 − 1
= 4 0 ≤ n ≤ 3
w − 1 [ 0 ] w −^ 1 [^1 ] w − 1 [ 2 ]= y [ 0 ]
w − 1 [ 3 ]= y [ 1 ]
x (^) − 1 [ 2 ]= x [ 0 ], x − 1 [ 3 ]= x [ 1 ]
41 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- General Case: Let h [ n ] be a length- N
sequence
- Let denote the m -th section of an
infinitely long sequence x [ n ] of length N
and defined by
with M < N
x [ n ]= x [ n + m ( N − m + 1 )], 0 ≤ n ≤ N − 1 m
xm [ n ]
42 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- Let
- Then, we reject the first samples of
and “abut” the remaining samples of
to form , the linear convolution of
h [ n ] and x [ n ]
- If denotes the saved portion of ,
i.e.
w [ n ] m
wm [ n ]
w (^) m [ n ]= h [ n ] Nxm [ n ]
M − 1
N − M + 1
yL [ n ]
ym [ n ] wm [ n ]
[], 1 2
[ ]
w n M n N
n M y n
m
m
43 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- Then
- 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
y (^) L [ n + m ( N − M + 1 )]= ym [ n ], M − 1 ≤ n ≤ N − 1
44 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method
- Process is illustrated next
45 Copyright © 2001, S. K. Mitra
OverlapOverlap--Save MethodSave Method