07 DFT FFT Release
07 DFT FFT Release
07 DFT FFT Release
-
=-
=
( ) [ ]
j jn
n
X e x n e (1)
In practice, record length of [ ] x n usually finite. Suppose [ ] x n has length N,
and with no loss of generality, suppose = - . 0, , 1 n N . It then follows
q q
-
-
=
=
1
0
( ) [ ]
N
j jn
n
X e x n e (2)
Next, suppose we know
q
( )
j
X e but not [ ] x n . It can be shown, since [ ] x n
has length N, it is sufficient to know only
q
( )
j
X e , at N distinct frequency points
q q
-
.
0 1
, ,
N
in the interval [ ) 0, 2 q p , to determine [ ] x n
1
Discrete Fourier transform (DFT) defined by choosing q p = 2
k
k N , i.e.,
1
2
0
[ ] [ ] , 0, , 1
N
j nk N
n
X k x n e k N
p
-
-
=
= = -
. (3)
Inverse DFT (IDFT) given by
1
2
0
1
[ ] [ ] , 0, , 1
N
j nk N
k
x n X k e n N
N
p
-
+
=
= = -
. (4)
DFT is simply DTFT of a length N sequence, evaluated at
N equally-spaced frequency points
1
Basically, we need N equations to find N unknowns where the unknowns are [ ] x n . The resulting
system of equations is assured to be consistent if q q
-
.
0 1
, ,
N
are distinct
Curtin University, Australia 7-2
YH Leung (2005, 2006, 2007, 2008, 2012)
DFT is just another sequence of numbers. We put its argument in square
brackets
Appendix I shows DTFT
q
( )
j
X e can be recovered from DFT [ ] X k by
interpolation:
( )
( )
2 1
2
1
2 2
2
0
2
sin
1
( ) [ ]
sin
k N
N k
N
j
j N
N k
k
N
X e X k e
N
p
q p
q
q
q p
-
- -
- -
-
=
=
(5)
WARNING
A fundamental result in signal theory states a signal cannot be bandlimited
and time-limited at the same time
\ If ( ) x t is time limited, then its sampling rate should be infinite. Alternatively,
if ( ) x t is bandlimited, then its sample sequence must have infinite length
Great care must be exercised in using and interpreting the DFT
The DFT Eq. (3) can be written in vector-matrix notation as follows
2 2 2
2 2 2
2 2 2
2 ( 1)
2 4 2( 1)
( 1) 2( 1) ( 1)( 1)
1 1 1 1
[0] [0]
1
[1] [1]
[2] [2]
1
[ 1] [ 1]
1
N N N
N N N
N N N
j j j N
j j j N
j N j N j N N
X x
e e e
X x
X x
e e e
X N x N
e e e
p p p
p p p
p p p
- - - -
- - - -
- - - - - - -
=
- -
. .
. . . .
(6)
Matrix above called DFT matrix
Above representation useful in analysis of signal processing systems which
involve on-line calculation of the DFT (e.g. filterbanks and OFDM)
Exercise. Express the IDFT Eq. (4) in vector-matrix notation. Corresponding
matrix is called IDFT matrix
Curtin University, Australia 7-3
YH Leung (2005, 2006, 2007, 2008, 2012)
Recall definition of DFT Eq. (3)
p
-
-
=
= = -
1
2
0
[ ] [ ] , 0, , 1
N
j nk N
n
X k x n e k N
Suppose [ ] x n is specified for , ( 1), , ( 1)
o o o
n n n n N = + + - . . Definition of
N-point DFT can be generalised as follows
p
+ -
-
=
= = -
1
2
[ ] [ ] , 0, , 1
o
o
n N
j nk N
n n
X k x n e k N (7)
But
p p
+
+ -
-
- -
= =
= +
( )
1
1
2 2
0
[ ] [ ]
n m k
o o nk
N N
o
n N
N
j j
o
n n m
x n e x n m e
p p p
+
- -
-
-
-
= =
= +
1
2
1
0
2 2
[ ] [ ]
o nk
n k
o n
N
o
k
N N
N
j j
o
n
n N
j
n n
e x n n e x n e
Therefore
2
[ ] [ ]
n k
o
N
j
X k e X k
p -
= (8)
where
{ }
1
2
0
[ ] DFT [0], , [ 1] [ ]
nk
N
N
j
n
X k x x N x n e
p
-
-
=
= - =
. (9)
and
= + = - . [ ] [ ], 0, , 1
o
x n x n n n N (10)
It can be readily verified inverse of generalised DFT given by
{ }
1
2
0
1
[ ] [ ] [ ]
N
j nk N
o
k
x n n x n X k e
N
p
-
+
=
+ = =
1
2
2
0
[ ] [
1
[ ] , 0 ] , , 1
n k
o
N
N
j
j
o
nk N
k
X k e e N x n n x n
N
n
p
p
-
+
=
= = -
+ =
. (11)
In view of Eq. (8), in the sequel we shall assume, with no loss of generality, that
all sequences start at 0 n =
Curtin University, Australia 7-4
YH Leung (2005, 2006, 2007, 2008, 2012)
2 Properties of the DFT
DFT is a finite sum, therefore always converge
Since [ ] x n is finite-valued by assumption, [ ] X k also finite-valued
DFT of a sequence is unique, i.e., given a length N sequence [ ] x n , there is
one and only one N-point DFT [ ] X k
Since DTFT is periodic, so [ ] X k also periodic, with period N
+ = Z [ ] [ ], X k mN X k m (12)
In practice, range of [ ] X k restricted to { } - . 0, 1, , 1 k N
Inverse DFT also periodic with period N . Define
p
-
+
=
=
Z
1
2
0
1
[ ] [ ] ,
N
j nk N
k
x n X k e n
N
(13)
Can readily verify that
+ =
Z [ ] [ ], x n mN x n m (14)
and by uniqueness
= = -
. [ ] [ ], 0, , 1 x n x n n N (15)
[ ] x n is periodic extension of [ ] x n
Fig. 1 Periodic extension
0 N-1
0 N-1
[ ] x n
[ ] x n
Curtin University, Australia 7-5
YH Leung (2005, 2006, 2007, 2008, 2012)
Denote mod a b by
b
a such that
=
[ ] [ ]
N
x n x n (16)
Suppose [ ] x n and [ ] y n both have length N with DFTs [ ] X k and [ ] Y k
respectively
DFT
[ ] [ ] x n X k
DFT
[ ] [ ] y n Y k
Linearity + +
DFT
[ ] [ ] [ ] [ ] ax n by n aX k bY k
Time shifting
p -
-
DFT 2
[ ] [ ]
o
j kn N
o
N
x n n X k e
Frequency shifting
p
-
DFT 2
[ ] [ ]
o
j k n N
o
N
x n e X k k
Conjugation
* *
-
DFT
[ ] [ ]
N
x n X k
Time reversal
* *
-
DFT
[ ] [ ]
N
x n X k
Circular convolution
-
=
-
1
DFT
0
[ ] [ ] [ ] [ ]
N
N
m
x m y n m X k Y k
Multiplication
-
=
-
1
DFT
0
1
[ ] [ ] [ ] [ ]
N
N
m
x n y n X m Y k m
N
x n [ ] real
*
= - [ ] [ ]
N
X k X k
x n [ ] real { } { }
= - Re [ ] Re [ ]
N
X k X k
x n [ ] real { } { }
= - - Im [ ] Im [ ]
N
X k X k
Parsevals relation
- -
= =
=
1 1
2 2
0 0
1
[ ] [ ]
N N
n k
x n X k
N
Duality -
DFT
[ ] [ ]
N
X n Nx k
Note, for - 0 ( 1) n N , - = -
N
n N n
Curtin University, Australia 7-6
YH Leung (2005, 2006, 2007, 2008, 2012)
3 Circular Convolution
Suppose [ ] x n and [ ] y n both have length N
The N-point circular convolution (or cyclic convolution) of [ ] x n and [ ] y n is
defined by
1
0
[ ] [ ] [ ] [ ] [ ] N
N
N
m
w n x n y n x m y n m
-
=
= = -
(17)
where N
(19)
where [ ] y n
is periodic extension of [ ] y n
Circular convolution equivalent to finding linear convolution of [ ] x n with periodic
extension of [ ] y n and then keeping only first N points
Fig. 2 Circular convolution as linear convolution with periodic extension
As can be seen, for any given n, [ ]
N
y n m - and [ ] y n m -
[1 ] y m -
[ ]
N
y m - [ ] y m -
0 n =
1 n =
m
m
m
m
m
m
m
[ 2 ]
N
y m - [2 ] y m -
2 n =
m m
0
0 0
0
0
0 0
0
0 1 N-
1 N- 1 N-
1 N-
1 N-
1 N-
1 N- 1 N-
1 N-
Curtin University, Australia 7-8
YH Leung (2005, 2006, 2007, 2008, 2012)
We next derive direct relationship between linear and circular convolutions
Suppose [ ] x n and [ ] y n both have length N. Denote by [ ] w n
/
and [ ]
c
w n their
linear and N-point circular convolutions, respectively. Then
[ ] [ ]
c
r
w n w n rN
=-
= -
/
(20)
Proof
Let ( )
j
X e
q
and ( )
j
Y e
q
be DTFTs of [ ] x n and [ ] y n , and [ ] X k and [ ] Y k be their N-point DFTs
From properties of DTFTs, we have
( ) ( ) ( )
j j j
W e X e Y e
q q q
=
/
(21)
Suppose we sample ( )
j
W e
q
/
at N equally-spaced points from 0 q = to 2p and denote this
N-point DFT by [ ]
o
W k
Clearly,
2 2 2
[ ] ( ) ( ) ( ) [ ] [ ]
j k N j k N j k N
o
W k W e X e Y e X k Y k
p p p
= = = (22)
and so IDFT of [ ]
o
W k is just N-point circular convolution of [ ] x n with [ ] y n , i.e.
{ } IDFT [ ] [ ]
o c
W k w n = (23)
But, linear convolution of [ ] x n and [ ] y n has length 2 1 N- . Therefore, points of [ ]
o
W k
represent a sub-sampling of ( )
j
W e
q
/
Proof completes after application of the Time Aliasing result Eq. (40), to be discussed later
Alternatively, it can be shown directly (Problem 18), that Eqs. (19) and (20) are
equivalent
i.e.
1
0
[ ] [ ] [ ]
N
m r
x m y n m w n rN
-
= =-
- = -
/
(24)
Curtin University, Australia 7-9
YH Leung (2005, 2006, 2007, 2008, 2012)
4 Zero-Padding
Suppose
1
[ ] x n is a
1
N -point sequence. DTFT of
1
[ ] x n given by, see Eq. (2)
q q
-
-
=
=
1
1
1 1
0
( ) [ ]
N
j jn
n
X e x n e (25)
Next extend
1
[ ] x n to
2
N points by appending (padding) -
2 1
N N zeros to its
end
= -
= -
.
.
1 1
2
1 2
[ ] , 0, , 1
[ ]
0 , , , 1
x n n N
x n
n N N
(26)
Fig. 3 Zero padding
DTFT of
2
[ ] x n given by
q q q q
- - -
- - -
= = =
= = =
2 1 1
1 1 1
2 2 2 1
0 0 0
( ) [ ] [ ] [ ]
N N N
j jn jn jn
n n n
X e x n e x n e x n e (27)
Thus
q q
=
2 1
( ) ( )
j j
X e X e (28)
i.e.
1
[ ] x n and
2
[ ] x n both have same underlying DTFT. Call this DTFT
q
( )
j
X e
DFT of
1
[ ] x n (
2
[ ] x n ) is simply
q
( )
j
X e evaluated at
1
N (
2
N ) equi-angular
points about unit circle
\ Since >
2 1
N N , so frequency resolution of
2
[ ] X k greater than
1
[ ] X k
Can increase frequency resolution by zero padding
Note, by frequency resolution, we mean how closely spaced in q we compute
DFT. Therefore, for an N-point DFT, its frequency resolution is given by
2
N
p
q D = (29)
0
x
2
[n] x
1
[n]
N
1
-1 N
2
-1
0
Curtin University, Australia 7-10
YH Leung (2005, 2006, 2007, 2008, 2012)
Do not confuse frequency resolution with spectral resolution, to discuss later
Example 2
7
( ) 0.0083
c
X j
w p
w
=
= . Therefore, can sample ( )
c
x t at w p p = = 2 8 16
s
with acceptable aliasing.
With p p = = 2 16 0.125
s
T , we get = 2 0.125 16 sample points
16-point DFT plotted below on left. Right plot is 51-point DFT obtained by zero-padding [ ] x n
Remarks
(i) As discussed,
1
[ ] x n and its zero-padded version
2
[ ] x n both have same
DTFT, i.e.
1 2
( ) ( )
j j
X e X e
q q
=
In contrast,
1 2
[ ] [ ] X k X k , as can be seen from above example. In any
event,
1
[ ] X k has length
1
N while
2
[ ] X k has length
2
N
(ii) Zero-padding as described above also called post-pending. This differs
from pre-pending which appends zeros to the front of a sequence and
then shifts the extended sequence right such that it starts at 0 n =
Suppose N is length of extended sequence and
o
n is number of zeros
pre-pended or post-pended. By time-shifting property of DFTs, one gets
2
pre-pend post-pend
[ ] [ ]
n k
o
N
j
X k e X k
p -
= (30)
0
t
2 1
1
x
c
(t)
w
w
w
=
2
sin( 2)
( )
2
c
X j
=-
= -
(31)
Suppose next ( )
c
x t is sampled with sampling periods
1
T and
2 1
T T <
Let
1
[ ] x n and
2
[ ] x n be resulting sample sequences, and
1
( )
j
X e
q
and
2
( )
j
X e
q
their respective DTFTs
Figure below compares the DTFTs
Fig. 4 DTFTs of sequences obtained with two different sampling periods
Now, suppose ( )
c
x t is being sampled over the time interval 0 t t . It then
follows that
1 1 2 2
NT N T t = = (32)
where
1
N is length of
1
[ ] x n and
2
N is length of
2
[ ] x n
( )
c
X j w
w
0
1
( )
j
X e
q
0
1
1
1 T
0
2
( )
j
X e
q
2 1
T T <
2p
q
q
2
1 T
2p
N
w
1
q
2
q
Curtin University, Australia 7-13
YH Leung (2005, 2006, 2007, 2008, 2012)
Let
1
[ ] X k be
1
N -point DFT of
1
[ ] x n and
2
[ ] X k be
2
N -point DFT of
2
[ ] x n
Also, let
1 1
2 T w p = and
2 2
2 T w p = be sampling rates of
1
[ ] x n and
2
[ ] x n
respectively
We have seen
1
[ ] X k is just
1
( )
j
X e
q
sampled at
1
N equally-spaced points
from 0 q = to 2 q p = . Similarly for
2
[ ] X k
It thus follows that in Fig. 4,
1
q occurs at
1 1 1
1 1 1
( ) 2
2 2 2 2
N N N
N
T
k N N N k
q w w p w w t
p p p p
= = = = = (33)
and
2
q occurs at
2 2 2
2 2 2
( ) 2
2 2 2 2
N N N
N
T
k N N N k
q w w p w w t
p p p p
= = = = = (34)
In other words,
1 1 2 2
1 1 1 2 2 2
[ ] [ ]
[ 1 ] [ 1 ]
T X k T X k
T X N k T X N k
- - = - -
for 0
N
k k (35)
and for
1
[ ] X k , there are
1 1
( 1 1) ( 1) 1 ( 2 2)
N N N
N k k N k - - - - + + = - - zeros
between
1
q q = and
1
(2 ) q p q = -
Similarly,
2
[ ] X k has
2
( 2 2)
N
N k - - zeros between
2
q q = and
2
(2 ) q p q = -
Since
2 1
N N > see Eq. (32) so
2
[ ] X k has more zeros than
1
[ ] X k
Indeed, together with Eq. (35), we see that:
To go from
1
[ ] X k to the higher sampling rate
2
[ ] X k , we scale
1
[ ] X k by
1 2 2 1
T T N N = and zero-pad it in the middle mid-pending
3
We next consider situation when
1
[ ] X k does not have zeros in its middle
3
Mid-pending also ensures the expanded DFT satisfies [ ] X k = [ ]
N
X k
*
- , which is required by an
N-point real sequence
Curtin University, Australia 7-14
YH Leung (2005, 2006, 2007, 2008, 2012)
We begin by noting that since
1
[ ] X k has
1
N points between 0 q = and 2 q p = ,
its kth point corresponds to
1
1
2
, 0, 1, , ( 1)
k
k
k N
N
p
q = = - . (36)
1
N is odd
Solving Eq. (36) for
k
q p = , the mid-point of the interval 0 2 q p , we get
1
2 k N = which is not an integer, i.e.
1
[ ] X k does not have a point at q p =
Therefore, to mid-pend
1
[ ] X k , we simply insert zeros between
1 1
[( 1) 2] X N -
and
1 1
[( 1) 2] X N + which are DFT points immediately on either side of q p =
Example 3
1
( 5) N =
{ }
4
1
0
, , , ,
k
X a b c c b
* *
=
=
{ }
2
2
1
2
0
, , , 0, , 0, ,
N
N
N
k
X a b c c b
* *
=
= .
1
N is even
Solving Eq. (36) for
k
q p = , we get
1
2 k N = which is now an integer, i.e.
1
[ ] X k has a point at q p =
A method to mid-pend
1
[ ] X k is to first observe that
1 1
[ 2] X N is always real,
whereupon we define
1 1 1 1
[ 2] [ 2] X N X N
- +
= =
1
1 1
2
[ 2] X N , and insert zeros
between
1 1
[ 2] X N
-
and
1 1
[ 2] X N
+ 4
Observe above technique preserves requirement that
2
2 2
[ ] [ ]
N
X k X k
*
= -
Example 4
1
( 6) N =
{ }
5
1
0
, , , , ,
k
X a b c d c b
* *
=
=
{ }
2
2
1
2
2 2
0
, , , , 0, , 0, , ,
N
N
d d
N
k
X a b c c b
* *
=
= .
4
Because of the splitting of
1 1
[ 2] X N into
1 1
[ 2] X N
-
and
1 1
[ 2] X N
+
, the number of zeros we actually
insert is one less than the number we originally wanted to insert
Curtin University, Australia 7-15
YH Leung (2005, 2006, 2007, 2008, 2012)
Example 5
2 2
3
2
( ) ( ) ( )
(2 )
t
c c
x t t e u t X j
j
w
w
-
= =
+
As can be seen, duration of ( )
c
x t is about 5 sec and its bandwidth is about 2.5 Hz
Accordingly, we set sampling frequency to 5 Hz, or a sampling period of 0.2 sec, and we acquire
(5 0.2) 1 26 + = samples. Denote these samples by
1
[ ] x n
In the following figure, we zero pad the DFT of
1
[ ] x n to 80 points, and take the IDFT of the scaled
and zero-padded DFT
As can be seen, except for a slight erratic behaviour near 5 t = , the interpolated sequence
2
[ ] x n does
give us a closer look at ( )
c
x t
The erratic behaviour near 5 t = can be explained in terms of the fact that strictly, ( )
c
x t is not time-
limited and what we have done is effectively apply a rectangular window to ( )
c
x t . More will be said
about this temporal windowing in Section 9
Finally, to conform with common usage, unless otherwise stated, in the sequel
zero-padding shall mean zero-padding in time
0 1 2 3 4 5
0
0.03
0.06
0.09
0.12
0.15
t (sec)
x
c
(
t
)
0 0.5 1 1.5 2 2.5
0
0.05
0.1
0.15
0.2
0.25
0.3
f (Hz)
|
X
c
(
j
2
f
)
|
0 1 2 3 4 5
0
0.03
0.06
0.09
0.12
0.15
t (sec)
x1[n]
x2[n]
Curtin University, Australia 7-16
YH Leung (2005, 2006, 2007, 2008, 2012)
6 Time Aliasing
Suppose [ ] x n is an N-point sequence with DFT [ ] X k and DTFT
q
( )
j
X e
Suppose we zero pad [ ] x n to
1
N points and denote zero-padded sequence
by
1
[ ] x n and its DFT by
1
[ ] X k
We have seen
1
[ ] X k can be thought of as DFT obtained by sampling
q
( )
j
X e at
>
1
N N equally-spaced frequency points
Question What happens if we under-sample
q
( )
j
X e at <
2
N N points?
Suppose [ ] x n , with DTFT
q
( )
j
X e , is defined for -< < n which may
result from appending zeros to the front and end of a finite length sequence
Let
2
[ ] X k be DFT obtained by sampling
q
( )
j
X e at
2
N equally-spaced
frequency points, and
2
[ ] x n be IDFT of
2
[ ] X k
It follows from Eq. (4) that
p
p p
p p
p p
-
+
=
-
+
=
-
- +
= =-
-
- +
=- =
=
=
=
=
2
2
2
2 2
2
2 2
2
2 2
1
2
2 2
2
0
1
2 2
2
0
1
2 2
2
0
1
2 2
2
0
1
[ ] [ ]
1
( )
1
[ ]
1
[ ]
N
j nk N
k
N
j k N j nk N
k
N
j m k N j nk N
k m
N
j mk N j nk N
m k
x n X k e
N
X e e
N
x m e e
N
x m e e
N
p
-
-
=- =
=
2
2
1
2 ( )
2
2
0
1
[ ] [ ]
N
j n m k N
m k
x e
N
x n m (37)
Curtin University, Australia 7-17
YH Leung (2005, 2006, 2007, 2008, 2012)
p
- -
-
= =
=
2
2
1 1
2 ( )
2
2 0 0
1
[ ] [ ]
N N
j n m k N
m k
x n x m e
N
Now,
p
d
-
= =-
=
= = -
Z
2
2
1
2 2
2
2
0
1, , 1
[ ]
0, otherwise
N
j n k N
k r
n rN r
e n rN
N
(38)
d d
=- =- =-
\ = - - = * -
2 2 2
[ ] [ ] [( ) ] [ ] [ ]
m r r
x n x m n m rN x n n rN (39)
i.e.
=-
= -
2 2
[ ] [ ]
r
x n x n rN (40)
An application of Eq. (40) is shown below
Fig. 5 Time aliasing
As can be seen
(i) If [ ] x n has (non-zero padded) finite length N and <
2
N N , then effect
of under-sampling
q
( )
j
X e is to introduce time aliasing
5
(ii) Time aliasing can be avoided only if
2
N N (which is zero-pad in time)
(iii) If [ ] x n is causal and <
2 2
2 N N N , then Eq. (40) simplifies to
= + + = - .
2 2 2
[ ] [ ] [ ], 0, , ( 1) x n x n N x n n N (41)
5
In other words, if N is infinite, then time aliasing can never be avoided by sampling
q
( )
j
X e
n
[ ] x n
0
n
-
2
[ ] x n N
0
2
N
n
0
+
2
[ ] x n N
-
2
N
0 -
2
1 N
2
[ ] x n
n
Curtin University, Australia 7-18
YH Leung (2005, 2006, 2007, 2008, 2012)
Example 6 { }
5
0
[ ]
n
x x n
=
=
0 1 5
( ) [0] [1] [5]
j j j j
X e x e x e x e
q q q q - - -
\ = + + + .
Suppose we sample ( )
j
x e
q
at four frequency points to obtain the DFT:
2 0 4
2
[0] ( ) [0] [1] [2] [3] [4] [5]
j
X X e x x x x x x
p
= = + + + + +
2 1 4 2 4 2 2 4 5 2 4
2
[1] ( ) [0] [1] [2] [5]
[0] [1] [2] [3] [4] [5]
j j j j
X X e x x e x e x e
x jx x jx x jx
p p p p - - -
= = + + + +
= - - + + -
.
2 2 4 4 4 2 4 4 5 4 4
2
[2] ( ) [0] [1] [2] [5]
[0] [1] [2] [3] [4] [5]
j j j j
X X e x x e x e x e
x x x x x x
p p p p - - -
= = + + + +
= - + - + -
.
2 3 4 6 4 2 6 4 5 6 4
2
[3] ( ) [0] [1] [2] [5]
[0] [1] [2] [3] [4] [5]
j j j j
X X e x x e x e x e
x jx x jx x jx
p p p p - - -
= = + + + +
= + - - + +
.
IDFT of the resulting 4-point DFT is given by the 4 4 IDFT matrix
2 2
2 4 4 4 6 4
2 2
4 4 8 4 12 4
2 2
6 4 12 4 18 4
2 2
[0] [0] 1 1 1 1
1 1 1 1
[1] [1] 1 1
1
1 1
4 4
[2] [2] 1 1 1 1
1
[3] [3] 1 1
1
j j j
j j j
j j j
x X
x X j j
e e e
x X
e e e
x X j j
e e e
p p p
p p p
p p p
- -
= =
- -
- -
2
2
2
2
[0]
[1]
[2]
[3]
X
X
X
X
Thus
{ }
{ }
{ }
{ }
2 2 2 2 2
4 [0] [0] [1] [2] [3] [0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
4 [0] 4 [4]
x X X X X x x x x x x
x jx x jx x jx
x x x x x x
x jx x jx x jx
x x
= + + + = + + + + +
+ - - + + -
+ - + - + -
+ + - - + +
= +
{ }
{ }
{ }
{ }
2 2 2 2 2
4 [1] [0] [1] [2] [3] [0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
4 [1] 4 [5]
x X jX X jX x x x x x x
j x jx x jx x jx
x x x x x x
j x jx x jx x jx
x x
= + - - = + + + + +
+ - - + + -
- - + - + -
- + - - + +
= +
{ }
{ }
{ }
{ }
2 2 2 2 2
4 [2] [0] [1] [2] [3] [0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
4 [2]
x X X X X x x x x x x
x jx x jx x jx
x x x x x x
x jx x jx x jx
x
= - + - = + + + + +
- - - + + -
+ - + - + -
- + - - + +
=
{ }
{ }
{ }
{ }
2 2 2 2 2
4 [3] [0] [1] [2] [3] [0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
[0] [1] [2] [3] [4] [5]
4 [3]
x X jX X jX x x x x x x
j x jx x jx x jx
x x x x x x
j x jx x jx x jx
x
= - - + = + + + + +
- - - + + -
- - + - + -
+ + - - + +
=
Curtin University, Australia 7-19
YH Leung (2005, 2006, 2007, 2008, 2012)
Remark
Time aliasing can be viewed as another consequence of the duality that
exists between the time and frequency domains in Fourier analysis
Frequency Aliasing Time Aliasing
( )
c
X j w is bandlimited to
N
w w [ ] x n is time limited to 0 ( 1) n N -
Freq aliasing if ( )
c
x t sampled at
2 (2 )
N
T p w >
Time aliasing if ( )
j
X e
q
sampled at
2 N q p D >
1
( ) ( )
s c s
k
X j X j jk
T
w w w
=-
= -
2
s
T w p =
2 2
[ ] [ ]
r
x n x n rN
=-
= -
2
2 N p q = D
Curtin University, Australia 7-20
YH Leung (2005, 2006, 2007, 2008, 2012)
7 The Fast Fourier Transform (FFT)
As noted earlier, DFT does not give true spectrum. So why bother with DFT?
Ans. The Fast Fourier Transform (FFT)
FFT is just a computationally efficient way of calculating the DFT. Also, com-
paring Eqs. (3) and (4), we see it can be easily modified to compute the IDFT
It is the speed of the FFT that makes it a popular and powerful signal
processing tool
Recall N-point DFT Eq. (3)
p
-
-
=
=
1
2
0
[ ] [ ]
N
j nk N
n
X k x n e , = - . 0, , 1 k N
To compute above directly will require
2
N complex multiplications
- ( 1) N N complex additions
where 1 complex multiply = 4 real multiplies and 2 real adds
1 complex add = 2 real adds
In contrast, Cooley-Tukey radix-2 FFT algorithm, as implemented in MATLAB
and many other similar software packages, requires only
2
( 2)log N N complex multiplications
2
log N N complex additions
DFT FFT
N real real + real real +
8 256 240 48 72
32 4,096 4,032 320 480
128 65,536 65,280 1,792 2,688
512 1,048,576 1,047,552 9,216 13,824
2048 16,777,216 16,773,120 45,056 67,584
Curtin University, Australia 7-21
YH Leung (2005, 2006, 2007, 2008, 2012)
Cooley-Tukey requires N to be an integer power of 2
There exist many other FFT algorithms, some even faster than Cooley-Tukey,
but Cooley-Tukey remains most popular because of its ease in programming
DFT/FFT (i) evaluates DTFT at N frequency points simultaneously
(ii) requires all of [0] x to - [ 1] x N to be available before computation
can start
If interested in only a few frequency points, or if want to spread computational
load over time interval when [0] x to - [ 1] x N are acquired, use Goertzel
algorithm (see Appendix II)
Curtin University, Australia 7-22
YH Leung (2005, 2006, 2007, 2008, 2012)
8 Linear Convolution with the DFT/FFT
Question: Can we use DFT/FFT to compute, efficiently, the linear convolution of
two sequences [ ] x n and [ ] y n ?
8.1 Full Linear Convolution with Circular Convolution
Figure below compares linear convolution with circular convolution
Fig. 6 Linear vs circular convolution
As can be seen, circular shifting in circular convolution introduces time aliasing
(dashed green ovals)
Time aliasing can be overcome by zero-padding (see Fig. 7 next page)
Idea is to force a gap between the repeated patterns of [ ] y m in [ ] y m
[ ] x m
[ ] y m
[1 ] y m -
[ ] y m
[1 ] y m -
[ ] y m - [ ] y m -
0 n =
1 n =
m
m
m
m
m
m
m
[ ] y N m - [ ] y N m -
n =
m
[ ] x m
m
1
0
[ ] [ ] [ ] [ ]
N
m
x n y n x m y n m
-
=
* = -
1
0
[ ] [ ] [ ] [ ] N
N
m
x n y n x m y n m
-
=
= -
m
0
0 0
0
0
0 0
0
0 1 N-
1 N- 1 N-
1 N-
1 N-
1 N-
1 N- 1 N-
1 N- 0 1 N-
Curtin University, Australia 7-23
YH Leung (2005, 2006, 2007, 2008, 2012)
Fig. 7 Linear convolution from circular convolution with zero-padding
It follows from Fig. 7 that
If [ ] x n and [ ] y n both have length N, then to compute their linear convolution
using DFT/FFT, we must zero pad them to at least (2 1) N- points
[ ] x m
[ ] y m
[1 ] y m -
zp
[ ] y m
zp
[1 ] y m -
[ ] y m -
zp
[ ] y m -
0 n =
1 n =
m
m
m
m
m
m
m
[ ] y N m - zp
[ ] y N m -
n N =
m
zp
[ ] x m
m
1
0
[ ] [ ] [ ] [ ]
N
m
x n y n x m y n m
-
=
* = -
2 2
zp zp zp zp
0
[ ] [ ] [ ] [ ]
2 1
N
N
m
x n y n x m y n m
N N
-
=
= -
= -
m
0
0 0 1 N- 1 N-
1 N- 0 1 N- 2 2 N-
0 0 1 N- 1 N-
0 0 1 N- 1 N-
0 0 1 N- 1 N-
2 2 N-
2 2 N-
2 2 N-
2 2 N-
2 2 n = -
[2 2 ] y N m - - zp
[2 2 ] y N m - -
m m
0 0 1 N- 1 N- 2 2 N-
Curtin University, Australia 7-24
YH Leung (2005, 2006, 2007, 2008, 2012)
Key points to explain why zero-padding works:
(i) It follows from Discrete-Time Signals and Systems, Problem 2, that:
{ } { } { }
1 1 2( 1)
0 0 0
[ ] , [ ] [ ]
N N N
n n n
x x n y y n w x y w n
- - -
= = =
= = = * =
i.e. if x and y both have length N, then x y * has length (2 1) N-
(ii) Circular convolution of two length (2 1) N- sequences will result in a length
(2 1) N- sequence
(iii) Points of
zp
[ ] y n m -
for 0 ( 1) m N - (yellow regions)
7
. More specifically, number of zeros
appended to [ ] y n must cover length of [ ] x n , less 1
In view of above discussion, it is not difficult to see that, more generally
If [ ] x n has length P and [ ] y n has length L, then if we are to compute
their linear convolution using the DFT, we must zero pad them to at least
( 1) L P + - points
6
Thus in Fig. 7,
1 1 1
zp zp zp zp zp zp zp
0 0 0
[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] N
N N N
m m m
x n y n x m y n m x m y n m x m y n m
- - -
= = =
= - = - = -
7
Thus in Fig. 7,
1 1
zp
0 0
[ ] [ ] [ ] [ ], 0 2 2
[ ] [ ]
N N
m m
x m y n m x m y n m n N
x n y n
- -
= =
- = - -
= *
Curtin University, Australia 7-25
YH Leung (2005, 2006, 2007, 2008, 2012)
Example 7 Linear Convolution with DFT
{ }
3
0
1, 1, 0, 2
n
x
=
= - { }
=
=
3
0
1, 0, 3, 2
n
y
{ }
6
zp
0
1, 1, 0, 2, 0, 0, 0
n
x
=
= - { }
6
zp
0
1, 0, 3, 2, 0, 0, 0
n
y
=
=
It can be readily verified that
{ }
6
0
[ ] [ ] 1, 1, 3, 1, 2, 6, 4
n
x n y n
=
* = - -
Now
{
}
zp
6
0
[ ] 2, 1.4254 0.0859, 2.4695 2.5386, 1.4559 1.5160,
1.4559 1.5160, 2.4695 2.5386, 1.4254 0.0859
k
X k j j j
j j j
=
= - - + -
+ - - -
{
}
zp
6
0
[ ] 6, 1.4695 3.7926, 0.4559 2.8653, 2.4254 0.3956,
2.4254 0.3956, 0.4559 2.8653, 1.4695 3.7926
k
Y k j j j
j j j
=
= - - - + +
- - - - +
{
}
zp zp
6
0
[ ] [ ] [ ]
12, 1.7687 5.5323, 8.3998 5.9185, 4.1310 3.1009,
4.1310 3.1009, 8.3998 5.9185, 1.7687 5.5323
k
W k X k Y k
j j j
j j j
=
\ =
= + - + -
+ - - -
and { } { }
6
0
[ ] IDFT [ ] 1, 1, 3, 1, 2, 6, 4
n
w n W k
=
= = - -
In above example, [ ] x n and [ ] y n were both zero-padded to 7 points. This is
not commensurate with FFT. However, result in pp. 4 says we can also zero
pad them to
3
2 8 7 = > points
Example 8 { }
3
0
1, 1, 0, 2
n
x
=
= - { }
=
=
3
0
1, 0, 3, 2
n
y
{ }
7
zp
0
1, 1, 0, 2, 0, 0, 0, 0
n
x
=
= - { }
7
zp
0
1, 0, 3, 2, 0, 0, 0, 0
n
y
=
=
{
}
zp
7
0
[ ] 2, 1.1213 0.7071, 1 3, 3.1213 0.7071,
0, 3.1213 0.7071, 1 3, 1.1213 0.7071
k
X k j j j
j j j
=
= - - + -
+ - - +
{
}
zp
7
0
[ ] 6, 0.4142 4.4142, 2 2, 2.4142 1.5858,
2, 2.4142 1.5858, 2 2, 0.4142 4.4142
k
Y k j j j
j j j
=
= - - - + +
- - - - +
{
}
zp zp
7
0
[ ] [ ] [ ]
12, 2.6569 5.2426, 8 4, 8.6569 3.2426,
0, 8.6569 3.2426, 8 4, 2.6569 5.2426
k
W k X k Y k
j j j
j j j
=
=
= - + - - +
- - + - -
{ } { }
7
0
[ ] IDFT [ ] 1, 1, 3, 1, 2, 6, 4, 0
n
w n W k
=
= = - -
Curtin University, Australia 7-26
YH Leung (2005, 2006, 2007, 2008, 2012)
Next example illustrate more general result
Example 9 { }
1
0
1, 1
n
x
=
= - { }
=
=
3
0
1, 0, 3, 2
n
y
Thus 2 P = , 4 L = , and we zero pad [ ] x n and [ ] y n to 1 5 L P + - = points:
{ }
4
zp
0
1, 1, 0, 0, 0
n
x
=
= - { }
4
zp
0
1, 0, 3, 2, 0
n
y
=
=
Next, following the procedure
{
}
zp
4
0
[ ] 0, 0.6910 0.9511, 1.8090 0.5878,
1.8090 0.5878, 0.6910 0.9511
k
X k j j
j j
=
= + +
- +
{
}
zp
4
0
[ ] 6, 3.0451 0.5878, 2.5451 0.9511,
2.5451 0.9511, 3.0451 0.5878
k
Y k j j
j j
=
= - - +
- - +
{
}
zp zp
4
0
[ ] [ ] [ ] 0, 1.5451 3.3022, 4.0451 3.2164,
4.0451 3.2164, 1.5451 3.3022
k
W k X k Y k j j
j j
=
= = - - +
- - +
{ } { }
4
0
[ ] IDFT [ ] 1, 1, 3, 1, 2
n
w n W k
=
= = - - -
It can be readily verified that
[ ] [ ] [ ] x n y n w n * =
Curtin University, Australia 7-27
YH Leung (2005, 2006, 2007, 2008, 2012)
8.2 Partial Linear Convolution with Circular Convolution
Suppose [ ] x n has length P and [ ] y n has length L P >
Figure below compares linear with L-point circular convolution of [ ] x n and
[ ] y n where, for circular convolution, [ ] x n has been zero-padded to L points
Fig. 8 Linear convolution vs L-point circular convolution
(i) Zero-padding [ ] x n sum in [ ]
c
w n applies only over first P points
(ii) For 0, , ( 2) n P = - . , [ ] [ ]
c
w n w n
/
because of time aliasing (dashed
green oval) in summation region (yellow)
(iii) For ( 1), , ( 1) n P L = - - . , [ ] [ ]
c
w n w n =
/
since [ ] y n m - and [ ] y n m -
have same data points in (truncated) summation region
(iv) For n L = , [ ]
c
w n again suffers from time aliasing but we do not compute
[ ]
c
w L
0
1 P -
[ ] x m
m
[ ] y m
0
m
1
0
[ ] [ ] [ ]
P
m
w n x m y n m
-
=
= -
/
1 L-
1 1
zp zp
0 0
[ ] [ ] [ ] [ ] [ ]
L P
c
m m
w n x m y n m x m y n m
- -
= =
= - = -
0
1 P -
zp
[ ] x m
m
0
m
1 L -
[ ] y m
m
[ ] y m -
0
m
0
[ ] y m -
0 = n
m
[( 1) ] y P m - -
0
m
0
[( 1) ] y P m - -
1 = - n P
m
[ ] y P m -
0
m
0
[ ] y P m -
= n P
m
[( 1) ] y L m - -
0
m
0
[( 1) ] y L m - -
1 = - n L
1 L- 1 L - 1 P - 1 P -
Curtin University, Australia 7-28
YH Leung (2005, 2006, 2007, 2008, 2012)
In summary
First ( 1) P - points of circular convolution do not equal linear convolution
Remaining ( 1) L P - + points of circular convolution equal linear convolution
Partial linear convolution method does not find last ( 1) 1 L P L P + - - = -
points of linear convolution
Example 10 { }
1
0
1, 1
n
x
=
= - { }
=
=
3
0
1, 0, 3, 2
n
y
Thus 2 P = and 4 L = . Zero-padding [ ] x n to 4 L = points:
{ }
3
zp
0
1, 1, 0, 0
n
x
=
= -
Accordingly
{ }
3
zp
0
[ ] 0, 1 1, 2, 1 1
k
X k j j
=
= + -
{ }
3
0
[ ] 6, 2 2, 2, 2 2
k
Y k j j
=
= - + - -
{ }
3
zp
0
[ ] [ ] [ ] 0, 4, 4, 4
k
W k X k Y k
=
= = - -
{ } { }
3
0
[ ] IDFT [ ] 1, 1, 3, 1
n
w n W k
=
= = - - -
It can be readily verified that
{ }
4
0
[ ] [ ] 1, 1, 3, 1, 2
n
x n y n
=
* = - - -
Thus:
1. Frst ( 1) 2 1 1 P - = - = point of [ ] w n and [ ] [ ] x n y n * are not equal
2. Next ( 1) 4 2 1 3 L P - + = - + = points of [ ] w n and [ ] [ ] x n y n * are equal
3. Last ( 1) 2 1 1 P - = - = point of [ ] [ ] x n y n * is not found
Curtin University, Australia 7-29
YH Leung (2005, 2006, 2007, 2008, 2012)
9 Implementation of LTI Systems with DFT/FFT
Let [ ] x n be input to an LTI system with impulse response [ ] h n . Suppose [ ] h n
has length P and [ ] x n has length Q P >
May not be possible to use full linear convolution method to find output [ ] y n :
(i) Computation can start only when all of [ ] x n has been gathered. This may
lead to unacceptable delay
(ii) DFT length can be very large if Q is large and such DFTs may be
impractical to compute
(iii) [ ] x n may have infinite length
Two basic methods: Overlap-Add and Overlap-Save
Overlap-add discussed below
Overlap-save discussed in Appendix IV
Curtin University, Australia 7-30
YH Leung (2005, 2006, 2007, 2008, 2012)
Overlap-Add Method
First partition [ ] x n into R segments of length L each
1
0
[ ] [ ]
R
r
r
x n x n rL
-
=
= -
(42)
where [ ] x n has been zero-padded to RL points, [ ]
r
x n is rth segment
[ ], 0 ( 1)
[ ]
0, otherwise
r
x n rL n L
x n
+ -
(43)
P L Q (44)
and
=
R Q L (45)
It follows that
{ }
1 1
0 0
[ ] [ ] [ ] [ ] [ ] [ ] [ ]
R R
r r
r r
y n x n h n x n rL h n x n rL h n
- -
= =
= * = - * = - *
(46)
Or
1
0
[ ] [ ]
R
r
r
y n y n rL
-
=
= -
(47)
where [ ] [ ] [ ]
r r
y n x n h n = * (48)
and linear convolution of Eq. (48) can be computed using full linear con-
volution method
(i) rth input segment [ ]
r
x n starts at 0 n = while [ ]
r
x n rL - starts at n rL =
(ii) rth output segment [ ]
r
y n starts at 0 n = while [ ]
r
y n rL - starts at n rL =
(iii) [ ]
r
x n , and so [ ]
r
x n rL - , has length L
(iv) [ ]
r
y n , and so [ ]
r
y n rL - , has length ( 1) L P + - where P is length of [ ] h n
Relationship between [ ] x n , [ ]
r
x n rL - , [ ]
r
y n rL - and [ ] y n illustrated in Fig. 9
Curtin University, Australia 7-31
YH Leung (2005, 2006, 2007, 2008, 2012)
1
0
[ ] [ ]
R
r
r
x n x n rL
-
=
= -
[ ], 0 ( 1)
[ ]
0, otherwise
r
x n rL n L
x n
+ -
1
0
[ ] [ ]
R
r
r
y n y n rL
-
=
= -
[ ] [ ] [ ]
r r
y n x n h n = *
Fig. 9 Overlap-add method
Observe output segments longer than input segments and they overlap. They
are added together as per Eq. (47) to form [ ] y n
0
1 P -
[ ] h n
n
[ ] x n
n
L 0 2L 3L
0
[ ] x n
1
[ ] x n L -
2
[ 2 ] x n L -
n
0
0
[ ] y n
2 P L + -
n
0
L
1
[ ] y n L -
n
2
[ 2 ] y n L -
2L
0
0
[ ] y n
L 2L
n
3L
2 2 P L + -
Curtin University, Australia 7-32
YH Leung (2005, 2006, 2007, 2008, 2012)
Example 11
n 0 1 2
[ ] h n 1 0 -1
n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
[ ] x n 1 1 -1 0 -2 2 0 -1 1 0 2 -1 -1 0 1
Thus, length of [ ] h n is 3 P = ,
length of [ ] x n is 15 Q = ,
and length of [ ] y n is ( 1) P Q + - = 3 15 1 17 + - =
Suppose segment length is 6 L = . Then,
number of segments is R Q L
= =
15 6 3
=
length of output segments is ( 1) 6 3 1 8 L P + - = + - =
and we zero pad [ ] x n to 3 6 18 RL = = points.
n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[ ] x n 1 1 -1 0 -2 2 0 -1 1 0 2 -1 -1 0 1 0 0 0
0
[ ] x n 1 1 -1 0 -2 2
0
[ ] n y 1 1 -2 -1 -1 2 2 -2
-
1
[ ] x n L 0 -1 1 0 2 -1
-
1
[ ] n L y 0 -1 1 1 1 -1 -2 1
-
2
[ 2 ] x n L -1 0 1 0 0 0
-
2
[ 2 ] n L y -1 0 2 0 -1 0 0 0
[ ] y n 1 1 -2 -1 -1 2 2 -3 1 1 1 -1 -3 1 2 0 -1
Curtin University, Australia 7-33
YH Leung (2005, 2006, 2007, 2008, 2012)
Appendix I Derivation of DFT to DTFT Interpolation Formula
Recall definition of DTFT Eq. (1)
q q
-
=-
=
( ) [ ]
j jn
n
X e x n e
If [ ] x n has finite length N, then
q q
-
-
=
=
1
0
( ) [ ]
N
j jn
n
X e x n e (49)
Now, from Eq. (4)
p
p
q q q
q
- - -
- -
= = =
- -
-
= =
= =
=
2
2
1 1 1
0 0 0
1 1
0 0
1
( ) [ ] [ ]
1
[ ]
nk
N
nk
N
N N N
j
j jn jn
n n k
N N
j
jn
k n
X e x n e X k e e
N
X k e e
N
(50)
But
( )
( )
( )
( )
( )
( ) ( )
( ) ( )
( )
( )
( )
( )
( ) ( ) { }
p
p p
p p q
p q p q p q
p q p q p q
p q p q
q
p q
q
q
q
p q
p q
-
- - -
- - -
- -
-
- - -
-
-
-
= =
-
-
-
-
-
- -
= = =
- -
-
=
-
-
=
-
2
2 2
2 2
2 2 2
2 2 2
2 2 2
2 2 2
2 2
2 2
2 1 1
0 0
2
2
2
2
1 1
1 1
sin
sin
k
N k nk
N N
k k N
N N
k N k N k N
k N k N k N
N N N
k N k N
N
j N
j k N N N
j n j
jn
j j
n n
j j j
j j j
k N
j
k N
N
e e
e e e
e e
e e e
e e e
j
e
j
(51)
Substituting Eq. (51) into Eq. (50), yields Eq. (5)
( )
( )
2 1
2
1
2 2
2
0
2
sin
1
( ) [ ]
sin
k N
N k
N
j
j N
N k
k
N
X e X k e
N
p
q p
q
q
q p
-
- -
- -
-
=
=
Curtin University, Australia 7-34
YH Leung (2005, 2006, 2007, 2008, 2012)
Appendix II Goertzel Algorithm
A.1 Basic Principle
Consider following single-pole (complex) IIR filter (Goertzel cell)
Fig. 10 Goertzel cell
p
= + -
(2 )
[ ] [ ] [ 1]
o
j k N
y n x n e y n (52)
p -
=
-
(2 ) 1
1
( )
1
o
j k N
H z
e z
(53)
p
=
(2 )
[ ] [ ]
o
j k N n
h n e u n (54)
Appendix III shows that if (i) filter is initially at rest, i.e., - = [ 1] 0 y
(ii) [ ] x n is causal, i.e., = [ ] 0 x n for <0 n
and (iii) = [ ] 0 x N
then
p
=
2
[ ] [ ]
o
j k
o
y N e X k (55)
i.e., above filter can be used to compute [ ]
o
X k (and only
o
k ) which is not
surprising given its pole-zero structure
Remarks
(i) Goertzel cell spits out
p 2
[ ]
o
j k
o
e X k at time = n N, and not = -1 n N
(ii) At = n N, we must set = [ ] 0 x N
(iii) Derivation in Appendix III indicates
o
k does not have to be an integer
(iv) If
o
k Z, then
p
=
2
1
o
j k
e and = [ ] [ ]
o
y N X k
y[n] x[n]
p 2
o
j k N
e
p 2
o
k
N
z-plane
-1
z
Curtin University, Australia 7-35
YH Leung (2005, 2006, 2007, 2008, 2012)
A.2 Efficient Implementation
Recall Eq. (52)
p
= + -
(2 )
[ ] [ ] [ 1]
o
j k N
y n x n e y n
1 real add and 1 complex multiply, or 3 real adds and 4 real multiplies, per
sampling period
Now, Eq. (53) gives transfer function of Goertzel cell
p -
=
-
(2 ) 1
1
( )
1
o
j k N
H z
e z
\
{ }
p p
p p p
- - - -
- - - - -
- -
=
- - + +
(2 ) (2 ) 1 1
(2 ) 1 (2 ) (2 ) 1 2
1 1
( )
1 1
o o
o o o
j k N j k N
j k N j k N j k N
e z e z
H z
e z e e z z
or
p
p
- -
- -
-
=
- +
(2 ) 1
2
1 2
1
( )
1 2cos
o
o
j k N
k
N
e z
H z
z z
(56)
y[n] x[n]
p 2
o
j k N
e
-1
z
Curtin University, Australia 7-36
YH Leung (2005, 2006, 2007, 2008, 2012)
p
p
- -
- -
-
=
- +
(2 ) 1
2
1 2
1
( )
1 2cos
o
o
j k N
k
N
e z
H z
z z
Fig. 11 Goertzel cell as 2nd order IIR filter
LCCDE
AR:
p
= + - - -
2
[ ] [ ] 2cos [ 1] [ 2]
o
k
N
w n x n w n w n (57)
MA:
p
-
= - -
2
[ ] [ ] [ 1]
k
o
N
j
y n w n e w n
p p
= - - + -
2 2
[ ] cos [ 1] sin [ 1] [ ]
o o
k k
N N
w n w n j w n y n (58)
Sampling periods 0 to N1:
Goertzel cell in real form requires only 2 real adds/subtracts and 1 real
multiply per sampling period to maintain AR section ( [ ] w n is real)
Sampling period N:
AR section now requires 1 less real add since = [ ] 0 x N but MA section kicks
in and requires 1 real add and 2 real multiplies
2 real adds and 3 real multiplies
y[n] x[n]
p 2
2cos
o
k
N
p -
-
2
o
j k N
e
-1
z
-1
z
w[n]
Curtin University, Australia 7-37
YH Leung (2005, 2006, 2007, 2008, 2012)
A.3 Continuous Operation
Block Mode [ ]
o
X k every Nth sampling period
Output response of Goertzel cell given by Eq. (65) of Appendix III
p -
=
=
(2 )( )
0
[ ] [ ]
o
n
j k N n m
m
y n x m e
\
p p p - -
- - - -
= =
- = =
2 2 2 1 1
( 1 ) ( 1)
0 0
[ 1] [ ] [ ]
k k k
o o o
N N N
N N
j N m j N j m
m m
y N x m e e x m e
i.e.,
p
- -
- =
2
( 1)
[ 1] [ ]
k
o
N
j N
o
e y N X k (59)
Can extract [ ]
o
X k at 1 n N = - by scaling output
Fig. 12 Goertzel cell continuous operation, block mode
At = n N, we reset filter, wait for [ ] x N , and proceed as before
Next valid [ ]
o
X k available at 2 1, 3 1, , n N N = - - . etc.
n = N1, 2N1, 3N1,
x[n]
n = 0, 1, 2,
X[k
o
]
p
- -
2
( 1)
k
o
N
j N
e
N
N p 2
2cos
o
k
N
-1
z
-1
z
p -
-
2
o
j k N
e
n = N1, 2N1, 3N1,
x[n]
n = 0, 1, 2, p 2
o
j k N
e
N
N p 2
2cos
o
k
N
-1
z
-1
z
X[k
o
]
p - 2
o
j k
e
Curtin University, Australia 7-38
YH Leung (2005, 2006, 2007, 2008, 2012)
Sampling periods 0 to N2: 2 real adds/subtracts and 1 real multiply
Sampling period N1: 3 real adds/subtracts and 3 real multiplies ( Z
o
k )
5 real adds/subtracts and 7 real multiplies ( Z
o
k )
Sliding Mode [ ]
o
X k every sampling period
Define
p -
-
=
= - - +
2 1
0
[ , ] [ ( 1) ]
k
o
N
N
j m
o o o
m
X k n x n N m e (60)
i.e. [ , ]
o o
X k n is DFT of the N successive samples - - . [ ( 1)], , [ ]
o o
x n N x n
Fig. 13 Grouping of data samples in sliding mode operation
Now, from Eq. (65) of Appendix III
p -
=
=
(2 )( )
0
[ ] [ ]
o
n
j k N n m
m
y n x m e
Therefore
p p
p p
p
p
p p
-
- - -
= =
-
- -
= =
-
= - +
-
- -
=
- - = -
= -
=
= - + + = - - +
2 2
2 2
2
2
( ) ( )
2 2
0 0
( ) ( )
0 0
( )
1
1
( 1 )
0
[ ] [ ] [ ] [ ]
[ ] [ ]
[ ]
[ 1 ] , ( 1)
k k
o o
o o N N
k k
o o
N N
k
o
N
k
o
N
n n N
j n m j n N m
j k j k
m m
n n N
j n m j n m
m m
n
j n m
m n N
N
j N k
k
y n e y n N x m e e x m e
x m e x m e
x m e
x n N k e k m n N
i.e.,
p p
p
-
- -
=
- - = - - +
2 2 1
( 1)
2
0
[ ] [ ] [ ( 1) ]
k k
o o
o N N
N
j N j k
j k
k
y n e y n N e x n N k e (61)
n
n
o
-(N-1)
N points
x[n]
n
o
X[k
o
,n
o
]
X[k
o
,n
o
-1]
Curtin University, Australia 7-39
YH Leung (2005, 2006, 2007, 2008, 2012)
Substituting Eq. (60) into Eq. (61), we get
p
p
-
- - =
2
( 1)
2
[ ] [ ] [ , ]
k
o
o N
j N
j k
o
y n e y n N e X k n (62)
i.e.
p p
- -
- - =
2 2
( 1)
[ ] [ ] [ , ]
k k
o o
N N
j N j
o
e y n e y n N X k n (63)
Fig. 14 Goertzel cell continuous operation, sliding mode
Remarks
(i) Sliding mode structure is basically FIR since it simply computes an N-point
DFT
\ Stable in theory
But Goertzel cell embeds a recursive filter with a pole on unit circle, so can
be unstable if pole actually outside unit circle due to coefficient round-offs
A remedy is to put pole at
p
=
2
o
j k N
z r e where r is just less than 1
(ii) Block mode structure always stable because of periodic resets
(iii) If Z
o
k , such that
p
=
2
1
o
j k
e , then Eq. (62) yields the more efficient
structure shown in Fig. 15
p
- -
2
( 1)
k
o
N
j N
e
p 2
2cos
o
k
N
-1
z
-1
z
- +2 N
z
x[n]
X[k
o
,n]
-1
z
p 2
o
j k N
e
p - 2
o
j k
e
Curtin University, Australia 7-40
YH Leung (2005, 2006, 2007, 2008, 2012)
Fig. 15 Goertzel cell continuous operation, sliding mode, Z
o
k
x[n]
p 2
o
j k N
e
p 2
2cos
o
k
N
-1
z
-1
z
X[k
o
,n]
N
z
-
Curtin University, Australia 7-41
YH Leung (2005, 2006, 2007, 2008, 2012)
Appendix III Derivation of Goertzel Algorithm
Recall
p
= + -
(2 )
[ ] [ ] [ 1]
o
j k N
y n x n e y n
p -
=
-
(2 ) 1
1
( )
1
o
j k N
H z
e z
and
p
=
(2 )
[ ] [ ]
o
j k N n
h n e u n
Suppose filter is initially at rest. Then
p
-
=- =-
= - = -
(2 )( )
[ ] [ ] [ ] [ ] [ ]
o
j k N n m
m m
y n x m h n m x m e u n m (64)
But [ ] x n is causal, i.e., = [ ] 0 x m for <0 m . Also - = [ ] 0 u n m for > m n
Therefore
p -
=
=
(2 )( )
0
[ ] [ ]
o
n
j k N n m
m
y n x m e (65)
and
p -
=
=
(2 )( )
0
[ ] [ ]
o
N
j k N N m
m
y N x m e
p p -
=
=
2 (2 )
0
[ ] [ ]
o o
N
j k j k N m
m
e x m e y N (66)
Now, if = [ ] 0 x N (67)
then
p p p
-
-
=
= =
1
2 (2 ) 2
0
[ ] [ ] [ ]
o o o
N
j k j k N m j k
o
m
y N e x m e e X k (68)
where [ ]
o
X k is th
o
k output of an N-point DFT
y[n] x[n]
p 2
o
j k N
e
-1
z
Curtin University, Australia 7-42
YH Leung (2005, 2006, 2007, 2008, 2012)
Appendix IV Overlap-Save Method
Method based on partial linear convolution method
Idea is to partition [ ] x n into overlapping equal-length segments and use partial
linear convolution method to determine from these segments, contiguous blocks
of correct linear convolution terms
The method: (Recall [ ] h n has length P and [ ] x n has length Q P > )
1. Choose segment length L such that
P L Q (69)
2. Pre- and post-pend [ ] x n with ( 1) P - and { } ( 1) R L P Q - + - zeros,
respectively, where R is number of segments
( 1) ( 1) R Q L L P = + - - +
(70)
i.e. construct the extended sequence
ext
[ ] x n where
= = - =
ext ext
[0] [ 2] 0 x x P (71)
+ - = -
ext
[ 1] [ ], 0 ( 1) x n P x n n Q (72)
and + - = = - + + - =
ext ext
[ 1] [ ( 1) 2] 0 x Q P x R L P P (73)
3. Partition
ext
[ ] x n into overlapping L-point segments where successive
segments overlap by ( 1) P - points. Thus, rth segment is
+ - + -
ext
[ ( 1)], 0 ( 1)
[ ]
0, otherwise
r
x n r L P n L
x n (74)
4. Compute L-point circular convolution of [ ] h n (zero-padded to L points)
with [ ]
r
x n , discard first ( 1) P - points of convolution and retain last
( 1) L P - + points. Denote retained points by [ ]
r
y n , 0 ( ) n L P -
5. Abut [ ]
r
y n s to form output
1
0
[ ] [ ( 1)]
R
r
r
y n y n r L P
-
=
= - - +
(75)
Curtin University, Australia 7-43
YH Leung (2005, 2006, 2007, 2008, 2012)
Fig. 16 Overlap-save method
Method called overlap-save since we overlap input segments and we save
last ( 1) P - points of input segment [ ]
r
x n to use them as first ( 1) P - points
of next input segment
1
[ ]
r
x n
+
[ ] x n
n
0
0
[ ] x n
- - +
1
[ ( 1)] x n L P
- - +
2
[ 2( 1)] x n L P
ext
[ ] x n
n
L
0
n
0
0
y
0
1 P -
[ ] h n
n
- +1 L P - + 2( 1) L P
n
0
1
y
n
0
2
y
n
0
[ ] y n
-2 P
0
h x 1 0 1 1 -2 -1
0
[ ] y n 1 1 -2 -1
-
1
[ 4] x n -1 0 -2 2 0 -1
1
h x -1 1 -1 2 2 -3
-
1
[ 4] y n -1 2 2 -3
-
2
[ 8] x n 0 -1 1 0 2 -1
2
h x -2 0 1 1 1 -1
-
2
[ 8] y n 1 1 1 -1
-
3
[ 12] x n 2 -1 -1 0 1 0
3
h x 1 -1 -3 1 2 0
-
3
[ 12] y n -3 1 2 0
-
4
[ 16] x n 1 0 0 0 0 0
4
h x 1 0 -1 0 0 0
-
4
[ 16] y n -1 0 0 0
n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[ ] y n 1 1 -2 -1 -1 2 2 -3 1 1 1 -1 -3 1 2 0 -1
Curtin University, Australia 7-45
YH Leung (2005, 2006, 2007, 2008, 2012)
Problems
1. Compute the DFT of each of the following finite-length sequences considered to be of
length N (where N is even):
(a) [ ] [ ] d = x n n
(b) [ ] [ ], 0 1 d = - -
o o
x n n n n N
(c)
1, even, 0 1
[ ]
0, odd, 0 1
-
n n N
x n
n n N
(d)
2
2
1, 0 1
[ ]
0, 1
N
N
n
x n
n N
(e)
, 0 1
[ ]
0, otherwise
n
a n N
x n
2. Consider the finite-length sequence { }
3
0
[ ] 6, 5, 4, 3
n
x n
=
= . Determine the sequences
(a)
1
4
[ ] [ 2 ], 0 3 x n x n n = -
(b)
2
4
[ ] [ ], 0 3 x n x n n = -
3. A finite-duration sequence [ ] x n of length 8 has the 8-point DFT [ ] X k shown below.
A new sequence of length 16 is defined by
[ 2], even
[ ]
0, odd
x n n
y n
n
Sketch the 16-point DFT of [ ] y n .
k
[ ] X k
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Curtin University, Australia 7-46
YH Leung (2005, 2006, 2007, 2008, 2012)
4. Two 8-point sequences
1
[ ] x n and
2
[ ] x n shown below have DFTs
1
[ ] X k and
2
[ ] X k
respectively. Determine the relationship between
1
[ ] X k and
2
[ ] X k .
5. Two finite-length sequences [ ] x n and
1
[ ] x n are shown below.
The N-point DFTs of these sequences, [ ] X k and
1
[ ] X k , respectively, are related by
2
2
1
[ ] [ ]
N
j k
X k X k e
p
=
where N is an unknown constant. Can you determine a value of N consistent with
the figures drawn for [ ] x n and
1
[ ] x n ? Is your choice for N unique? If so, justify
your answer. If not, find another choice of N consistent with the information given.
6. Consider the real finite-length sequence [ ] x n shown below.
(a) Determine the finite-length sequence [ ] y n whose 6-point DFT is
2
6
4
[ ] [ ]
j k
Y k X k e
p
-
=
where [ ] X k is the 6-point DFT of [ ] x n
(b) Determine the finite-length sequence [ ] w n whose 6-point DFT is
{ } [ ] Re [ ] W k X k =
(c) Determine the finite-length sequence [ ] q n whose 3-point DFT is
[ ] [2 ], 0, 1, 2 Q k X k k = =
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
a
b
c
d
e
n n
e
d
a
b
c x
1
[n] x
2
[n]
0
1
2 3 4 5 6 7 0 1 2 3
4
5 6 7
n n
x [n] x
1
[n]
1 1
1 - 1 -
1 1
n
[ ] x n
0 1 2 3 4 5 6 7 -1
4
3
2
1
Curtin University, Australia 7-47
YH Leung (2005, 2006, 2007, 2008, 2012)
7. [ ] x n is a real-valued finite-length sequence of length 10 and is nonzero in the interval
from 0 to 9, i.e.,
[ ] 0, 0, 10
[ ] 0, 0 9
x n n n
x n n
= <
( )
j
X e
q
denotes the DTFT of [ ] x n , and [ ] X k denotes the 10-point DFT of [ ] x n .
Determine a choice for [ ] x n so that [ ] X k is real valued for all k and
( ) ( ) ,
j j
X e A e
q aq
q q p = <
where ( ) A q is real and a is a nonzero real constant.
8. Let [ ] x n be a real-valued 5-point sequence whose 7-point DFT is denoted by [ ] X k .
If { } Re [ ] X k is the 7-point DFT of [ ] g n , show that [0] [0] g x = , and determine the
relationship between [1] g and [1] x .
9. Suppose we have two 4-point sequences [ ] x n and [ ] h n as follows:
( )
2
[ ] cos , 0, 1, 2, 3
[ ] 2 , 0, 1, 2, 3
n
n
x n n
h n n
p
= =
= =
(a) Calculate the 4-point DFT [ ] X k .
(b) Calculate the 4-point DFT [ ] H k .
(c) Calculate
4
[ ] [ ] [ ] y n x n h n = by doing the circular convolution directly.
(d) Calculate [ ] y n of Part (c) by multiplying the DFTs of [ ] x n and [ ] h n and
performing an inverse DFT.
10. Consider the two 4-point sequences { }
3
1
0
[ ] 1, 0, 2, 1
n
x n
=
= and { }
3
2
0
[ ] 0, 1, 0,
n
x n a
=
=
where a is unknown. Suppose the 4-point circular convolution of
1
[ ] x n and
2
[ ] x n is
given by
{ }
4
3
1 2
0
[ ] [ ] [ ] 1, 1, 1, 1
n
y n x n x n
=
= = - -
Can you specify a uniquely? If so, what is a? If not, give two possible values of a.
Curtin University, Australia 7-48
YH Leung (2005, 2006, 2007, 2008, 2012)
11. In this exercise, we investigate the plausibility of the zero-insertion method described in
the Lecture Notes for zero-padding in frequency, particularly when the original DFT
has an even number of points.
Consider the continuous-time signal
( ) sin 2 cos 4 p p = +
c
x t A t B t
Clearly, ( )
c
x t is periodic with period 1 sec and bandwidth 2 Hz. Suppose ( )
c
x t is
sampled over 1 sec at 4, 5, 6 and 7 Hz with the first sample taken at 0 = t to yield
the 4-, 5-, 6- and 7-point sequences
4
[ ] x n ,
5
[ ] x n ,
6
[ ] x n and
7
[ ] x n , respectively. Show
that
{ }
3
4
0
[ ] 0, 2 , 4 , 2
=
= -
k
X k j A B j A
{ }
4
5
5
4 0
[ ] 0, 2 , 2 , 2 , 2
=
= -
k
X k j A B B j A
{ }
5
6
6
4 0
[ ] 0, 2 , 2 , 0, 2 , 2
=
= -
k
X k j A B B j A
{ }
6
7
7
4 0
[ ] 0, 2 , 2 , 0, 0, 2 , 2
=
= -
k
X k j A B B j A
12. Consider the finite-length sequence { }
5
0
[ ] 1, 1, 1, 1, 1, 1
=
=
n
x n . Let ( ) X z be the z-
transform of [ ] x n . If we sample ( ) X z at
(2 4) p
=
j k
z e , 0, 1, 2, 3 = k , we obtain
(2 4)
1
[ ] ( )
p
=
=
j k
z e
X k X z , 0, 1, 2, 3 = k .
Sketch the sequence
1
[ ] x n obtained as the inverse DFT of
1
[ ] X k
13. Suppose
1
[ ] x n is an infinite-length, stable (i.e., absolutely summable) sequence with
z-transform given by
1
1
1
3
1
( )
1
X z
z
-
=
-
Suppose
2
[ ] x n is a finite-length sequence of length N, and its N-point DFT is given by
2
2 1
[ ] ( ) , 0, 1, , 1 j k N
z e
X k X z k N p
=
= = - .
Determine
2
[ ] x n .
14. Consider the two finite-length sequences { }
3
1
0
[ ] 1, 2, 1, 3
n
x n
=
= - - and
2
[ ] x n =
{ }
5
0
0, 2, 0, 0, 1, 1
n=
- . What is the smallest N such that the N-point circular
convolution of
1
[ ] x n and
2
[ ] x n equals the linear convolution of these sequences, i.e.,
such that
1 2 1 2
[ ] [ ] [ ] [ ]
N
x n x n x n x n = * ?
Curtin University, Australia 7-49
YH Leung (2005, 2006, 2007, 2008, 2012)
15. Determine a real sequence [ ] x n that satisfies all of the following three conditions:
Condition 1: The DTFT of [ ] x n has the form
1 2
( ) 1 cos cos 2
j
X e A A
q
q q = + +
where
1
A and
2
A are some unknown constants.
Condition 2: The sequence [ ] [ 3] x n n d * - evaluated at 2 n = is 5.
Condition 3: For the 3-point sequence { }
2
0
[ ] 1, 2, 3
n
w n
=
= , the result of the 8-point
circular convolution of [ ] w n and [ 3] x n- is 11 when 2 n = ; i.e.,
7
8
0
2
[ ] [ 3 ] 11
m
n
w m x n m
=
=
- - =
16. Two finite-length sequences
1
[ ] x n and
2
[ ] x n , which are zero outside the interval
0 99 n , are circularly convolved to form a new sequence [ ] y n .
100
99
1 2 1 2
100
0
[ ] [ ] [ ] [ ] [ ] , 0 99
k
y n x n x n x k x n k n
=
= = -
If, in fact,
1
[ ] x n is nonzero only for 10 39 n , determine the set of values of n for
which [ ] y n is guaranteed to be identical to the linear convolution of
1
[ ] x n and
2
[ ] x n .
17. Consider two finite-duration sequences [ ] x n and [ ] y n . [ ] x n is zero for 0 n < , 40 n ,
and 9 30 n < < , and [ ] y n is zero for 10 n < and 19 n > , as shown below.
Let [ ] w n denote the linear convolution of [ ] x n and [ ] y n . Let [ ] g n denote the 40-point
circular convolution of [ ] x n and [ ] y n :
[ ] [ ] [ ] [ ] [ ]
k
w n x n y n x k y n k
=-
= * = -
40
39
40
0
[ ] [ ] [ ] [ ] [ ]
k
g n x n y n x k y n k
=
= = -
0
0 9
10 19
30 39
n
n
[ ] y n
[ ] x n
Curtin University, Australia 7-50
YH Leung (2005, 2006, 2007, 2008, 2012)
(a) Determine the values of n for which [ ] w n can be nonzero.
(b) Determine the values of n for which [ ] w n can be obtained from [ ] g n . Explicitly
specify at what index values n in [ ] g n these values of [ ] w n appear.
18. Suppose [ ] x n and [ ] y n are two finite-duration sequences, both with the same length N.
Show, directly, that
1
0
[ ] [ ] [ ]
N
m r
x m y n m w n rN
-
= =-
- = -
/
where [ ] y n is the periodic extension of [ ] y n , and [ ] w n
/
is the linear convolution of
[ ] x n with [ ] y n .
19. We want to implement the linear convolution of a 10,000-point sequence with an FIR
impulse response that is 100 points long. The convolution is to be implemented by using
DFTs and IDFTs of length 256.
(a) If the overlap-add method is used, what is the minimum number of 256-point
DFTs and the minimum number of 256-point IDFTs needed to implement the
convolution of the entire 10,000-point sequence? Justify your answer.
(b) If the overlap-save method is used, what is the minimum number of 256-point
DFTs and the minimum number of 256-point IDFTs needed to implement the
convolution of the entire 10,000-point sequence? Justify your answer.
(c) Suppose the DFTs and IDFTs of Parts (s) and (b) are implemented using FFTs
and IFFTs. Compare the number of arithmetic operations (multiplications and
additions) required in the overlap-add method, the overlap-save method, and
direct convolution.
Other problems to attempt from Oppenheim and Schafer, Chapter 8:
8, 11, 13, 14, 16, 18, 19, 26, 31, 32, 38, 53
Curtin University, Australia 7-51
YH Leung (2005, 2006, 2007, 2008, 2012)
Answers
1. (a) [ ] 1 = X k (b)
2
[ ]
p -
=
o
j kn N
X k e
(c)
2, 0, 2
[ ]
0, otherwise
N k N
X k (d)
2
2
1
2, 0
, odd
[ ]
0, even
p -
-
j k N
e
N k
k
X k
k
(e)
2
1
1
[ ]
p -
-
-
=
N
j k N
a
ae
X k
2. (a) { }
3
1
0
[ ] 4, 3, 6, 5
n
x n
=
=
(b) { }
3
2
0
[ ] 6, 3, 4, 5
n
x n
=
=
3.
4.
2 1
[ ] ( 1) [ ]
k
X k X k = -
5. 5 N =
6. (a) { }
5
0
[ ] 2, 1, 0, 0, 4, 3
n
y n
=
=
(b)
{ }
5
3 3
2 2
0
[ ] 4, , 1, 1, 1,
n
w n
=
=
(c) { }
2
0
[ ] 5, 3, 2
n
q n
=
=
k
[ ] Y k
0 1 2 3 4 5 6 7 15
Curtin University, Australia 7-52
YH Leung (2005, 2006, 2007, 2008, 2012)
7. We first establish the following result. Let [ ] Y k be the DFT of an arbitrary real N-point
sequence. Define
[ ] [ ] [ ] X k Y k Y k
*
= +
Clearly, [ ] X k is real for all k. Now, from the properties of DFTs, the IDFT of [ ] X k
is given by
[ ] [ ] [ ] [ ] [ ] [ ] [ ]
N N
x n y n y n y n y n y n y N n
*
= + - = + - = + -
Accordingly, if [ ] X k is an N-point DFT and is real for 0 ( 1) k N - , then its
IDFT [ ] x n must satisfy
[ ], 1 1
[ ]
arbitrary real , 0
x N n n N
x n
n
- -
In the context of this Problem, the above result means
[1] [9]
[2] [8]
[3] [7]
[4] [6]
x x
x x
x x
x x
=
=
=
=
and [0] x and [5] x are arbitrary but real.
Next, recall our earlier work on linear phase FIR filters. The condition on ( )
j
X e
q
implies [ ] x n is linear phase. Therefore, [ ] x n must satisfy
[ ] [ 1 ], 0 ( 1) x n x N n n N = - - -
or in the context of this Problem,
[0] [9]
[1] [8]
[2] [7]
[3] [6]
[4] [5]
x x
x x
x x
x x
x x
=
=
=
=
=
Combining both sets of conditions on [ ] x n , we see that [ ] x n must be a constant for
0 ( 1) n N - .
8. [0] [0] g x = ;
1
2
[1] [1] g x =
9. (a) { }
4
4
3
0
[ ] 1 0, 2, 0, 2
k
j
k
X k e
p
-
=
= - =
(b) { }
2 4 6
4 4 4
3
0
[ ] 1 2 4 8 15, 3 6, 5, 3 6
k k k
j j j
k
H k e e e j j
p p p
- - -
=
= + + + = - + - - -
(c)(d) { }
3
0
[ ] 3, 6, 3, 6
n
y n
=
= - -
Curtin University, Australia 7-53
YH Leung (2005, 2006, 2007, 2008, 2012)
10. 1 a = -
11. Sampling ( )
c
x t at 4, 5 and 6 Hz, we get
{ }
3
4
0
[ ] , ( ), , ( )
=
= - - -
n
x n B A B B A B
{
}
2 2
5
5 5 5 5
4
2 2
5 5 5 5
0
[ ] , sin cos , sin cos ,
sin cos , sin cos
p p p p
p p p p
=
= - +
- + - -
n
x n B A B A B
A B A B
{
}
1 1
6
2 2
5
1 1
2 2
0
[ ] , ( 3 ), ( 3 ),
, ( 3 ), ( 3 )
=
= - -
- - - -
n
x n B A B A B
B A B A B
DFTs can be found, after some algebra, through the DFT matrices
4
1 1 1 1
1 1
1 1 1 1
1 1
FFT
- -
- -
- -
=
j j
j j
2 5 4 5 4 5 2 5
4 5 2 5 2 5 4 5
5
4 5 2 5 2 5 4 5
2 5 4 5 4 5 2 5
1 1 1 1 1
1
1
1
1
FFT
p p p p
p p p p
p p p p
p p p p
- -
- -
- -
- -
=
j j j j
j j j j
j j j j
j j j j
e e e e
e e e e
e e e e
e e e e
3 2 3 2 3 3
2 3 2 3 2 3 2 3
2 3 2 3 2 3 2 3
3 2 3 2 3 3
6
1 1 1 1 1 1
1 1
1 1
1 1 1 1 1 1
1 1
1 1
FFT
p p p p
p p p p
p p p p
p p p p
- -
- -
- -
- -
-
- - -
-
=
j j j j
j j j j
j j j j
j j j j
e e e e
e e e e
e e e e
e e e e
12. { }
3
1
0
[ ] 2, 2, 1, 1
n
x n
=
=
13. ( )
( )
1
3
1 1
2
3
1
[ ]
N
n
x n
-
=
14. 9 N =
Curtin University, Australia 7-54
YH Leung (2005, 2006, 2007, 2008, 2012)
15. From Condition 1, we can write
1 2
2 2
1 2
2 2
( ) 1 cos cos 2 1 ( ) ( )
A A
j j j j j
X e A A e e e e
q q q q q
q q
- -
= + + = + + + + (1)
Comparing the above expression with the definition of the DTFT
( ) [ ]
j jn
n
X e x n e
q q
-
=-
=
(2)
we see that [ ] x n is the non-causal finite-length sequence
{ }
2 1 1 2
2
2 2 2 2
2
[ ] , , 1, ,
A A A A
n
x n
=-
= (3)
Next, from Condition 2
( ) ( )
2 2
[ ] [ 3] [ 3] [ 1] 5
n n
x n n x n x d
= =
* - = - = - = (4)
Combining (3) and (4), we get
[ 1] [1] 5 x x - = = (5)
and
1
10 A = (6)
Finally, with reference to Condition 3, we first remark that [ 3] x n- is a causal 6-point
sequence
{ }
2 1 1 2
5
2 2 2 2
0
[ 3] 0, , , 1, ,
A A A A
n
x n
=
- = (7)
Therefore, the linear convolution of [ 3] x n- with the causal 3-point sequence [ ] w n will
yield a causal 3 6 1 8 + - = point causal sequence. Moreover, from our study on
the relationship between linear and circular convolutions, we see the 8-point circular
convolution of [ 3] x n- with [ ] w n will equal their linear convolution. In other words,
8
[ ] [ 3] [ ] [ 3] w n x n w n x n * - = - (8)
It can be shown, using the table method to calculate linear convolutions, that
{ }
7
0
[ ] [ 3] 0, , 5 2 , 11 3 , 22, 13 , 15 2 , 3
n
w n x n a a a a a a
=
* - = + + + + (9)
where
2
[ 2] [2] 2 a x x A = - = = . Hence, from Condition 3
2
[ ] [ 3] 5 2 11
n
w n x n a
=
* - = + = (10)
2
3 or 6 a A = = (11)
Summarising
{ }
2
2
[ ] 3, 5, 1, 5, 3
n
x n
=-
=
16. 39 99 n
Curtin University, Australia 7-55
YH Leung (2005, 2006, 2007, 2008, 2012)
17. (a) 10 28 n and 40 58 n
(b) [ ] [ ] g n w n = for 19 39 n , and [ ] [ 40] g n w n = + for 0 9 n
19.
Multiplications Addtions
Overlap-add 528,384 798,813
Overlap-save 536,576 804,864
Direct convolution 1,009,900 999,801