Вы находитесь на странице: 1из 107

Biomedical Signal processing

Chapter 8 The Discrete Fourier


Transform
Zhongguo Liu
Biomedical Engineering
School of Control Science and Engineering, Shandong
University

2014/11/26

Zhongguo Liu_Biomedical Engineering_Shandong Univ.

Chapter 8 The Discrete Fourier Transform


8.0 Introduction
8.1 Representation of Periodic Sequence: the
Discrete Fourier Series
8.2 Properties of the Discrete Fourier Series
8.3 The Fourier Transform of Periodic Signal
8.4 Sampling the Fourier Transform
8.5 Fourier Representation of Finite-Duration
Sequence: the Discrete Fourier Transform
8.6 Properties of the Discrete Fourier Transform
8.7 Linear Convolution using the Discrete
Fourier Transform
2

Filter Design Techniques

8.0 Introduction
3

8.0 Introduction

Discrete Fourier Transform (DFT) for


finite duration sequence
DFT is a sequence rather than a function
of a continuous variable
DFT corresponds to sample, equally
spaced in frequency, of the Fourier
transform of the signal.

8.0 Introduction
The relationship between periodic

sequence and finite-length sequences


The Fourier series representation of the
periodic sequence corresponds to the
DFT of the finite-length sequence.

8.1 Representation of Periodic Sequence:


the Discrete Fourier Series
x[n] with period N so
Given a periodic sequence ~
that
~
~
x[n] x[n rN]

The Fourier series representation can be written


as
j 2 / N kn
1
x[n] X k e
N k
Fourier series representation of continuous-time periodic

signals require infinite many complex exponentials


Not that for discrete-time periodic signals we have

e
6

j2 / Nk mNn

j2 / Nkn

j2 mn

j2 / Nkn

8.1 Representation of Periodic Sequence:


the Discrete Fourier Series

j2 / Nk mNn

j2 / Nkn

j2 mn

j2 / Nkn

Due to the periodicity of the complex exponential


we only need N exponentials for discrete time
Fourier series

1
x[n]
N
No need
7

N 1

X k e

j 2 / N kn

k 0

1
x[n]
N

X k e

j 2 / N kn

Discrete Fourier Series Pair


A periodic sequence in terms of Fourier series
coefficients
j 2 / N kn
1 N 1
x[n] X k e
N k 0
To obtain the Fourier series coefficients we multiply
both sides by

j (2 / N ) rn for 0nN-1 and then

sum both the sides , we obtain


N 1

x ( n )e

2
rn
N

n0

N 1

x ( n )e
n0

2
rn
N

N 1

n0 N

N 1

X ( k )e

2
( k r ) n
N

k 0

1 j 2N ( k r ) n
X ( k ) e
k 0
n0 N
N 1

N 1

Discrete Fourier Series Pair


1
x[n]
N
N 1

x ( n )e

2
rn
N

n0

1
N

N 1

2
( k r ) n
N

n 0

N 1

N 1

X k e

j 2 / N kn

k 0

1 j 2N ( k r ) n
X ( k ) e
k 0
n0 N
N 1

N 1

1, k - r mN , m an integer

0, otherwise

x ( n )e

2
rn
N

Problem 8.51, HW

X (r )

n 0

N 1

X ( k ) x ( n )e
n 0

2
kn
N

8.1 Representation of Periodic


Sequence: the Discrete Fourier Series
x n with period N,
a periodic sequence ~
~
x n ~
x n rN for any integer r

The Fourier series coefficients of ~x n is


N 1

X k x n e

j 2 N kn

n 0

1
x n
N
10

N 1

X k e
k 0

j 2 N kn

8.1 Representation of Periodic


Sequence: the Discrete Fourier Series
N 1

X k x n e

j 2 N kn

n 0

~
The sequence X k is periodic with period N

~
~
X 0 X N ,
N 1

~
~
X 1 X N 1

X k N x n e

j 2 N k N n

n 0

j 2 N kn j 2 n

x n e
X k
e
n 0

N 1

11

Discrete Fourier Series (DFS)


N 1

X k x n e

j 2 N kn

n 0

Analysis equation:

Let WN e j 2 N
N 1

~
kn
~
X k x nWN
n 0

Synthesis equation:
DFS

~
~
x n X k

1
~
x n
N

N 1

~
kn
X k WN
k 0

discrete periodic
F

periodic discrete
12

Ex. 8.1 DFS of a impulse train


Consider the periodic impulse train
~
x n

1, n rN , r is any integer
n rN

r
0, therwise

~
x n

N points

-N -N+1 -2

-1

N-1 N N+1 N+2

N 1
~
X k nWNkn WN0 1
n 0

13

Ex. 8.1 DFS of a impulse train


N 1
~
X k nWNkn WN0 1
n 0

~
X k

N points

-N -N+1 -2

x n

n rN

N 1

X k W
k 0

N-1 N N+1 N+2

1, n rN , r is any integer

0, therwise

N
14

-1

kn
N

N 1

e
k 0

j 2 N kn

N points

1
-N

-N+1

-2

-1

-N

15

N points

1
-N+1

-2

-1

~
x n
N-1 N N+1 N+2

~
X k
N-1 N N+1 N+2

Example 8.2 Duality in the Discrete


Fourier Series

The discrete Fourier series coefficients


is the periodic impulse train N points
N
Y k

~
Y k

N k rN

1
~
x n
N
1
~
y n
N
16

N 1

-N

-1 0 1

N 1

N 1

~
X k ~
x nWNkn

~
kn

X
k
W

N
k 0

1
~
kn
Y k WN

N
k 0

-2

n 0

N 1

kn
0

k
W

N
N 1
k 0

Y k

N points

N
k
-N -N+1 -2

-1

N-1 N N+1 N+2

N points

y n

1
-N -N+1 -2

17

-1

N-1 N N+1 N+2

N points

~
x n

1
-N+1

-N

-2

-1

N-1 N N+1 N+2

-N+1

-2

-1

1
N points

N-1 N N+1 N+2

-1

N-1 N N+1 N+2

N points

18

-N -N+1 -2

-1

Y k

N
-N -N+1 -2

~
X k

N points

-N

y n
N-1 N N+1 N+2

Example 8.3 The Discrete Fourier Series


of a Periodic Rectangular Pulse Train

Periodic sequence with period N=10


1

X k W
n 0

kn
10

j 2 10 kn

n 0

4 k 10 sin k 2
1 W105k
e

k
sin k 10
1 W10
19

magnitude

phase

20

X k e

4 k 10

sin k 2
sin k 10

magnitude

phase

21

X k e

4 k 10

sin k 2
sin k 10

8.2 Properties of the Discrete


Fourier Series

Linearity: two periodic sequence, both


with period N
DFS

~
~
x1 n X 1 k
DFS

~
~
x2 n X 2 k
DFS

~
~
~
~
ax1 n bx2 n aX 1 k bX 2 k

22

8.2 Properties of the Discrete


Fourier Series

Shift of a sequence
DFS

~
~
x n X k
DFS

km ~
~
x n m WN X k

DFS

WN nl x n X k l

Problem 8.52, HW
23

8.2 Properties of the Discrete


Fourier Series

Duality

DFS

~
~
x n X k

~
x n

~
X k
1

n
N-1

X n

24

DFS
~
X n N~
x k

N-1

Nx k

N-1

k
N-1

8.2.4 Symmetry

Problem 8.53, HW

25

8.2.5 Periodic Convolution

x2 n are two periodic sequences,


x1 n and ~
~
each with period N and with discrete Fourier
~
~
series X 1 k and X 2 k
~
~
~
X 3 k X1k X 2 k

N 1

N 1

m0

m0

x3 n x1 m x2 n m x2 m x1 n m
N 1

X 3 k x3 n W
N 1

n 0
N 1

kn
N

N 1 N 1

x1 m x2 n m W
n 0 m 0

kn
N

N 1

x1 m x2 n m WNkn x1 m WNkm X 2 k
m 0
N 1

26

n 0

m 0

km
x1 mWN X 2 k X1 k X 2 k
m0

8.2.5 Periodic Convolution


N 1

DFS
x
m
x
n

1 2

m0

X1 k X 2 k

The sum is over the finite interval 0 m N 1


The value of ~x2 n m in the interval 0 repeat
m N 1
periodically for m outside of that interval
1
~
~
~
~
DFS
x3 n x1 nx2 n X 3 k
N
27

N 1

~ ~
X 1l X 2 k l
l 0

Example 8.4 Periodic Convolution


x2 m
x1 m
x2 m
x2 1 m
N 1

x3 1 x1 m x2 1 m
m 0

x2 2 m
N 1

28

x3 2 x1 m x2 2 m
m0

8.2.5 Periodic Convolution

~
x3 n ~
x1 n~
x2 n
1
~
X 3 k
N

29

N 1

~ ~
X 1l X 2 k l
l 0

8.1 Representation of Periodic


Sequence: the Discrete Fourier Series
x n with period N,
a periodic sequence ~
~
x n ~
x n rN for any integer r

The Fourier series coefficients of ~x n is


N 1

X k x n e

j 2 N kn

n 0

1
x n
N
30

N 1

X k e
k 0

j 2 N kn

Review

Discrete Fourier Series (DFS)


N 1

X k x n e

j 2 N kn

n 0

Let WN e j 2 N

N 1
~
kn
~
X k x nWN

Analysis equation:

n 0

Synthesis equation:
DFS

1
~
x n
N

~
~
x n X k
31

N 1

~
kn

X
k
W

N
k 0

8.2 Properties of the Discrete


Fourier Series

Shift of a sequence
DFS

~
~
x n X k
DFS

km ~
~
x n m WN X k

nl
N

32

DFS

x n X k l

WN e

j 2 N

8.2 Properties of the Discrete


Fourier Series

Duality

DFS

~
~
x n X k

~
x n

~
X k
1

n
N-1

X n

33

DFS
~
X n N~
x k

N-1

Nx k

N-1

k
N-1

8.2.5 Periodic Convolution


~
~
~
X 3 k X1k X 2 k
N 1

~
x3 n ~
x1 m~
x2 n m
m 0

~
x3 n ~
x1 n~
x2 n
1
~
X 3 k
N
34

N 1

~ ~
X 1l X 2 k l
l 0

Example 8.4 Periodic Convolution


x2 m
x1 m
x2 m
x2 1 m
N 1

x3 1 x1 m x2 1 m
m 0

x2 2 m
N 1

35

x3 2 x1 m x2 2 m
m0

8.3 The Fourier Transform of


Periodic Signal
Periodic sequences are neither absolutely summable
nor square summable, hence they dont have a
strict Fourier Transform

xn 1 for all n

xn e

jw0 n

2 w 2 r

X e jw

2 w w 2 r

Xe

jw

x n ak e
k

36

jwk n

2 a w w 2 r

jw
F
X e

r k

8.3 The Fourier Transform of


Periodic Signal
We can represent Periodic sequences as sums of
complex exponentials: DFS
We can combine DFS and Fourier transform
Fourier transform of periodic sequences
Periodic impulse train with values proportional
to DFS coefficients

1
x n
N

N 1

X k e

j 2 N kn

k 0

2
2 k

X e
X k
N

k - N
j

37

8.3 The Fourier Transform of


Periodic Signal
2
2 k

X e
X k
N
N

k -
j

This is periodic with 2 since DFS is periodic


The inverse transform can be written as
1
2

2 -

0-

N
38

1
j
j n
X e e d
2

X k

k -

2 -

0-

2 -

0-

2
2 k jn

X k
e d
N

k - N

2 k j n
1

e d
N
N

N -1

X k e
k 0

2 k
n
N

x n

Ex. 8.5 Fourier Transform of a


periodic impulse train
Consider the periodic impulse train

p[n]

N points

p n

n rN

-N

-2

-1 0 1

The DFS was calculated previously to be

P k 1 for all k
-N

-2 -1 0 1

Therefore the Fourier transform is

2
2 k
P e

k N
j

39

P k

N points

2 N-1

Relation between Finite-length and


Periodic Signals

Consider finite length signal x[n]


spanning from 0
p n
to N-1 1

-N

- -1 0 1 2
periodic
2
with

Convolve
impulse train

x[n] x[n] p[n] x[n] n rN


r

x n rN

The Fourier transform of the periodic sequence is

2
2 k
j
j
j
j
X e X e P e X e

N
N

k
2 k
j


2
2 k
j
N
X e
X e

N
N

40

Relation between Finite-length and


Periodic Signals
2
2 k

X e
X k
N

k - N

2 k
j

2 k
j
N
X e
X e

N
k N

This implies that

j 2N k
X k X e

X
e
2 k

DFS coefficients of a periodic signal can be thought


as equally spaced samples of the Fourier transform
of one period
41

Relation between Finite-length and


Periodic Signals
~
If x n is periodic with period N, the DFS are
N 1
~
X k ~
x ne j 2

N kn

n 0

x
n

x n for 0 n N 1 and xn 0 otherwise


If

then

N 1

N 1

n 0

n 0

X e jw xne jwn ~
x ne jwn
X k X e jw

42

w 2 k N

Ex. 8.5 Relation between FS coefficients and FT


Consider the sequence
1 0 n 4
x[n]
else
0

The Fourier transform

X e

jw

X e

43

x n e

jwn

j 2

sin 5 / 2
sin / 2

Ex. 8.5 Relation between FS coefficients and FT


Consider the sequence
1 0 n 4
x[n]
else
0

The DFS coefficients


N 1

X k x n e

j 2 N kn

n 0

~
sink / 2
Xk e j4 k / 10
sink / 10

The Fourier transform


N 1

X e jw x n e jwn

Xe
44

n 0

j2

sin5 / 2
sin / 2

Ex. 8.5 Relation between FS coefficients and FT


Consider the sequence
1 0 n 4
x[n]
else
0

The DFS coefficients


N 1

X k x n e

j 2 N kn

n 0

~
sink / 2
Xk e j4 k / 10
sink / 10

The Fourier transform


N 1

X e jw x n e jwn

Xe
45

n 0

j2

sin5 / 2
sin / 2

8.4 Sampling the Fourier Transform

Consider an aperiodic sequence xn with


Fourier transform X e jw ,and assume that a
sequence X~ k is obtained by sampling
at frequency
wk 2 k N
j 2 N k

X k X e
X e

w 2 N k

j 2 N k
X k X z z e j2 N k X e
jw

~
X k is Fourier series coefficients of periodic sequence
x n
46

Sampling the Fourier Transform

j 2 / N k

j m
j
X k X e
X
e

x
m
e

1
x[n]
N

X k e

j 2 / N kn

N 1
k 0

j 2 / N km j 2 / N kn
1 N 1
x[n] x m e
e

N k 0 m

1 N 1 j 2 / N k nm
x m e
x m p n m

m
N k 0
m

1
p n m
N
47

N 1

e
k 0

j 2 / N k n m

n m rN

Sampling the Fourier Transform


X k X e

1
x[n]
N

N points

j 2 / N k

j 2 / N kn

X k e
N 1

-2 -1
N 12

-N

k 0

01

x m p n m

x n n rN
r

1
p n m
N

48

N 1

e
k 0

p n

x n rN

j 2 / N k n m

n m rN

x n 0 n N 1
x n
else
0

Sampling the Fourier Transform


j 2 / N k

X k X e

1
x[n]
N

x[n]

X k e
N 1

x n rN

49

j 2 / N kn

k 0

N 7

2
N

Sampling the Fourier Transform


Samples of the DTFT of an aperiodic sequence
can be thought of as DFS coefficients
of a periodic sequence
obtained through summing periodic
replicas of original sequence
If the original sequence is of finite length,
and we take sufficient number of samples of its
DTFT,
then the original sequence can be recovered by

x n 0 n N 1
x n
else
0
50

Sampling the Fourier Transform


It is not necessary to know the DTFT at all
frequencies

To recover the discrete-time sequence in time


domain
Discrete Fourier Transform is used in

Representing a finite length sequence by


samples of DTFT

51

8.5 Fourier Representation of Finite-Duration


Sequence: Discrete Fourier Transform

Consider a finite-length sequence xn of


length N samples such that xn 0 outside
N 9
the range 0 n N 1

To each finite-length sequence of length N,


we can associate a period sequence

x n

x n rN

x n, 0 n N 1
~
xn
0, otherwise
x n x n mod N x n N
52

Discrete Fourier Transform


For ~x n , the DFS is

~
X k with period N
The Discrete Fourier Transform of xn is
~
X k , 0 k N 1
X k
0, otherwise

X k X k mod N X k N
53

Discrete Fourier Transform


N 1
~
X k ~
x nWNkn
n 0

1
~
x n
N

N 1

~
kn

X k WN
k 0

N 1
kn
xnWN , 0 k N 1
X k n 0
0,
otherwise

1 N 1
X k WN kn , 0 n N 1
xn N k 0
0,
otherwise
54

Discrete Fourier Transform pairs


Analysis equation

N 1

X k xn W

Synthesis equation

n 0

1
xn
N
xn

55

N 1

kn
N

kn

X
k
W

N
k 0

DFT

X k

Discrete Fourier Transform


Time

Frequency

Fourier transform
(FT)

continuous

continuous

Fourier series (FS)

continuous
periodic
discrete

Continuous impulse
train

discrete
periodic

continuous impulse
train, periodic

discrete

discrete

Discrete-time
Fourier transform
(DTFT)
Discrete Fourier
series (DFS)

Discrete Fourier
transform (DFT)
56

continuous
periodic

57

Ex. 8.7 The DFT of a Rectangular Pulse


x[n] is of length 5
We can consider x[n] of
any length greater than 5

Lets pick N=5


Calculate the DFS of the
periodic form of x[n]
4

X k e

j 2 k /5 n

n 0

58

1 e j 2 k
1 e

j 2 k /5

5 k 0, 5, 10,...

else
0

2
k
5

Ex. 8.7 The DFT of a Rectangular Pulse


If we consider x[n] of
length 10

We get a different set of


DFT coefficients
Still samples of the
DTFT but in different
places

59

Review

Relation of DTFT,DFS, DFT


X e

DFS

j 2 / N k

X k X e

1
x[n]
N

X k e
N 1

x n rN

~
kn
~
X k x nWN
n 0

x m e jm

j 2 / N kn

k 0

N 1

N 12

Let

WN e

DFS

j 2 N

1
~
x n
N

N 1

~
kn

X
k
W

N
k 0

x n , 0 n N 1 DFT
X k , 0 k N 1
x n
X k
else
else
0,
0,
60

Discrete Fourier Transform


N 1

~
kn
~
X k x nWN
n 0

1
~
x n
N

N 1

~
kn

X
k
W

N
k 0

N 1
xnWNkn , 0 k N 1
X k n 0
0,
otherwise

1 N 1
kn
X k WN , 0 n N 1
xn N k 0
0,
otherwise
61

Review

Relation of DTFT,DFS, DFT


X e

DFS

j 2 / N k

X k X e

1
x[n]
N

X k e
N 1

x m e jm

j 2 / N kn

k 0

N 7

x n rN

N 1
~
kn
~
X k x nWN
n 0

x n , 0 n N 1 DFT
X k , 0 k N 1
x n
X k
else
else
0,
0,
62

Sampling of DTFT of
Linear Convolution
Consider x1 n of
Linear
length L and x2 n
Convolution
of length P

x3 n

L P 1
X 3 e jw X 1 e jw X 2 e jw

x mx n m

X3 k X3 e

j 2 k N

X e
1

j 2 k N

X e
2

j 2 k N

X k X k
1

N ?
0

1
1
x3 p n X 3 k WN kn , 0 n N 1
N k 0

x3 n rN , 0 n N 1

The inverse DFT x n


r
3p
of X 3 k is
0,
otherwise
63
N 1

8.6 Properties of the Discrete Fourier Transform


8.6.1 Linearity
DFT

ax1 n bx2 n aX 1 k bX 2 k
If x1 n has length N1 and x2 n has length N 2 ,
N 3 max N1 , N 2
X1 k
X 2 k
64

N 3 1

kn
x
n
W
1 N3 , 0 k N 3 1
n 0

N3 1

kn
x
n
W
2 N3 , 0 k N 3 1
n0

8.6.2 Circular Shift of a Sequence


DFS

~
~
x n X k
DFS

x n m e

j 2 k N m

xn , 0 n N 1

x n m N , 0 n N 1
65

DFT

DFT

j 2 k N m

X k
X k

X k

Ex. 8.8 Circular Shift of a Sequence

circular
shift

66

Figure 8.12

8.6.2 Circular Shift of a Sequence

xn X e
DFS

~
x n

jw

~
X k

x n m e jwm X e jw
DFS

x n m e
DFT

xn , 0 n N 1

x1 n , 0 n N 1

DFT

j 2 k N m

X k

X k

X1 k e

j 2 k N m

x n x n N X k X k N
DFS

x1 n x1 n N X1 k X1 k N
DFS

67

X k

8.6.2 Circular Shift of a Sequence


x n x n N X k X k N
DFS

x1 n x1 n N X1 k X1 k N
DFS

X1 k e

j 2 k N m

X1 k e

j 2 k

x1 n
68

N m

j 2 k N m

X k

X k N

X k N e

x n m N x n m

DFS

j 2 k N m

X k

j 2 k N m

X k

8.6.2 Circular Shift of a Sequence

X1 k e

x1 n

j 2 k N m

X k

x n m N x n m

DFS

j 2 k N m

X k

x1 n x n m N , 0 n N 1
x1 n
otherwise

0,
xn , 0 n N 1
xn m N , 0 n N 1
69

DFT

X k

DFT

j 2 k N m

X k

8.6.3 Duality
DFS

~
~
x n X k

x n x n N X k X k N
DFS

x1 n X n

DFS
~
X n N~
x k

x1 n X n

X1 k Nx k

Nx k Nx k N , 0 k N 1
X1 k
0,
otherwise

xn
X n
70

DFT

DFT

X k

Nx k N , 0 k N 1

Ex.8.9 The Duality Relationship for the DFT

71

8.6.4 Symmetry Properties


x n x n N X k X k N
DFS

DFT

x* n X * k N , 0 n N 1
DFT

x* n N X * k , 0 n N 1

1
xe n x n x* n
2
1
xo n x n x* n
2
1
xep n xe n x n x* n ,0 n N 1
N
N

2
1
xop n xo n x n N x* n N ,0 n N 1
2
72

8.6.4 Symmetry Properties

73

1
xep n xn N x* n N , 0 n N 1
2
1
xop n xn N x* n N , 0 n N 1
2
for 0 n N 1, n N N n, n N n
1
xep n x n x* N n , 0 n N 1
2
1
1
*
*
xep 0 x 0 x N x 0 x 0 Re x 0
2
2
1
xop n x n x* N n , 0 n N 1
2
1
x0 p 0 x 0 x* 0 j Im x 0
2

8.6.4 Symmetry Properties


1
xep n x n x* N n , 0 n N 1
2
1
*
xop n x n x N n , 0 n N 1
2
1
*
xe n x n x n
2
1
xo n x n x* n
2

xep n xe n xe n N , 0 n N 1

xop n xo n xo n N , 0 n N 1
74

8.6.4 Symmetry Properties


x n xe n xo n
x n x n xe n xo n , 0 n N 1
xep n xe n , 0 n N 1
xop n xo n , 0 n N 1

x n xep n xop n
DFT

Re xn X ep k
DFT

xep n Re X k
75

DFT

j Imxn X op k
DFT

xop n j ImX k

8.6.4 Symmetry Properties

76

8.6.4

Problem 8.56

0n N-1
0n N-1

0n N-1

77

8.6.5 Circular Convolution


N 1

DFS
x
m
x
n

1 2

m0

X1 k X 2 k

For two finite-duration sequences x1 n and x2 n ,


both of length N, with DFTs X1 k and X 2 k

X 3 k X1 k X 2 k
N 1

x3 n x1 m x2 n m , 0 k N 1
m 0

N 1

x3 n x1 m N x2 n m N , 0 k N 1
m0
N 1

x1 m x2 n m N , 0 k N 1
m 0

78

since

m,

for 0 k N 1

8.6.5 Circular Convolution


N 1

x3 n x1 m x2 n m N
m0

x1 n N x2 n

x2 n N x1 n
N 1

x2 m x1 n m N
m0

DFT

x3 n X 3 k X 1k X 2 k , 0 k N 1
79

8.6.5 Circular Convolution


DFT

x1 n N x2 n X 1 k X 2 k
if

x3 n x1 nx2 n

1
X 3 k
N

N 1

X l X k l
l 0

DFT

x1 nx2 n

80

1
X 1 k N X 2 k
N

Ex. 8.10 Circular


Convolution with a
Delayed Impulse
Sequence

x1 n n n0
0, 0 n n0

1, n n0
0, n n N 1
0

N 1

x3 n x1 m x2 n m N
m0

x2 [n] N [n 1]
x2 [((n 1)) N ], n0 n N 1
81

Ex. 8.10 Circular Convolution with a Delayed


Impulse Sequence
0, 0 n n0

x1 n n n0 1, n n0
0, n n N 1
0

X 1 k W

kn0
N

X 3 k X 1 k X 2 k
WNkn0 X 2 k

x[n] N [n 1]
x[((n 1)) N ], n0 n N 1
82

Example 8.11 Circular Convolution


of Two Rectangular Pulses
1, 0 n L 1
x1 n x2 n
0, otherwise

N L6

N 1

X 1k X 2 k W
n 0

kn
N

k 0
N,

0, otherwise

N 2,
k 0
X 3 k X 1 k X 2 k
0, otherwise
N 1
x3 n x1 m x2 n m N
m0

83

N , 0 n L 1

0, otherwise

N 1

X k W
k 0

kn
N

Ex. 8.11 Circular


Convolution of Two
Rectangular Pulses

N 2L 12
L 1

X1 k X 2 k WNkn
n 0

1 WNLk

1 WNk

1W
X 3 k X 1 k X 2 k
1W

Lk
N
k
N

N 1

x3 n x1 m x2 n m N
m0

84

8.6.6 Summary of Properties of the


Discrete Fourier Transform

85

8.6.6 Summary of Properties of the


Discrete Fourier Transform

86

8.7 Linear Convolution using the


Discrete Fourier Transform
Implement a convolution of two sequences
by the following procedure:
1. Compute the N-point DFT X 1 k and X 2 k
of the two sequence x1 n and x2 n
2. Compute X 3 k X 1 k X 2 k for 0 k N 1

3. Compute x3 n x1 n N x2 n as the inverse


DFT of X 3 k
87

8.7 Linear Convolution using the


Discrete Fourier Transform

In most applications, we are


interested in implementing a linear
convolution of two sequence.
To obtain a linear convolution, we will
discuss the relationship between linear
convolution and circular convolution.

88

8.7.1 Linear Convolution of Two


Finite-Length Sequences

x1 n x2 n

length L

x3 n

x mx n m

x2 1 m

x2 n m

for x3 n 0, 0 n L P 2

x2 L P 1 m

L p 1 is maximum length of x3 n
89

L P 1

8.7.2 Circular Convolution as Linear


Convolution with Aliasing

circular convolution x1 n N x2 n corresponding


to DFTs: X1 k X 2 k and linear convolution

x1 n * x2 n , Whether they are same?

depends on the length of the DFT in relation


to the length of x1 n and x2 n

90

8.7 Linear Convolution using the


Discrete Fourier Transform
Implement a convolution of two sequences
by the following procedure:
1. Compute the N-point DFT X 1 k and X 2 k
of the two sequence x1 n and x2 n
2. Compute X 3 k X 1 k X 2 k for 0 k N 1

3. Compute x3 n x1 n N x2 n as the inverse


DFT of X 3 k
Review
91

8.7.2 Circular Convolution as Linear


Convolution with Aliasing
DTFT X e jw
For finite sequence x n
x n

j 2 k
DFS
x n rN
X k X e

j 2 k

X e
X k

0,

0 k N 1
otherwise

The inverse DFT of X k is one period of x n :

x n , 0 n N 1
DFT
x p n
x p n
X k
otherwise
0,
If Nlength of x[n], then xp[n]= x[n]

92

8.7.2 Circular Convolution as Linear


Convolution with Aliasing
Linear convolution:

x3 n

x mx n m

The Fourier transform of x3 n is


jw
jw
jw
X 3 e X 1 e X 2 e
Define a DFT

X3 k X3 e

j 2 k N

X e
1

j 2 k N

X e
2

j 2 k N

X1 k X 2 k
0 k N 1

x3 n rN , 0 n N 1

The inverse DFT x n


r
3p
of X 3 k is
0,
otherwise
x3 p n x1 n N x2 n
93

8.7.2 Circular Convolution as Linear


Convolution with Aliasing
From X 3 k X 1 k X 2 k 0 k N 1
And

x3 p n x1 n N x2 n

Linear convolution:

x3 n

x mx n m


x3 n rN , 0 n N 1
x3 p n r
0,
otherwise

The circular convolution of two-finite sequences


is equivalent to linear convolution of the two
sequences, followed by time aliasing as above.
94

8.7.2 Circular Convolution as Linear


Convolution with Aliasing

If x1 n has length L and x2 n has length P,


then x3 n has maximum length L P 1
if N, the length of the DFTs, satisfies
N L P 1

DFT

The circular convolution corresponding to


X1 k X 2 k is identical to the linear convolution
jw
jw
X
e
X
e
corresponding to 1 2

x3 p n x1 n N x2 n
95

x3 n

x mx n m

x1 n x2 n

x3 n

Ex. 8.12 Circular Convolution


as Linear Convolution with
Aliasing.

linear convolution
x3 p n

x3 n N

x3 n rN

N=6

6 points shift right of


the linear convolution

x3 n N 6 points shift left of

the linear convolution


6 points circular convolution=
linear convolution with aliasing

N=12
96

12 points circular convolution


= linear convolution

Which points of Circular


Convolution equal that of
Linear Convolution when
Aliasing?

Fig.8.19

Consider x1 n of
length L and x2 n
of length P, where N L

Linear
Convolution

L P 1

P<L

Fig.8.20

Circular Convolution

x3 p n

x n rN

0 n N 1
97

P1 L P 1

L 8, P 4

N L 8

N L P 1 11

98

8.7.3 Implementing Linear TimeInvariant Systems Using the DFT

Linear time-invariant systems can be


implemented by linear convolution.
Linear convolution can be obtained from
the circular convolution.
So, circular convolution can be used to
implement linear time-invariant systems.

99

Zero-Pading
Consider an L-point input sequence xn
and a P-point impulse response hn
The linear convolution of these two
sequence yn has finite duration with
length (L+P-1)
For the circular convolution and linear
convolution to be identical, the circular
convolution must have a length of at least
(L+P-1) points.
100

Zero-Pading
The circular convolution can be achieved by
multiplying the DFTs of xn and hn .
Since the length of the linear convolution is
(L+P-1) points, the DFTs that we compute
must also be of at least that length, i.e.,
both xn and hn must augmented with
sequence values of zero.
The process is called Zero-Pading
101

Block Convolution
If the input signal is of indefinite duration,
the input signal to be processed is
segmented into sections of length L.
Each section can be convolved with the
finite-length impulse response and the
output sections fitted together in an
appropriate way.
The processing of each section can then be
implemented using the DFT.
102

Block Convolution

x n xr n rL
r 0

x n rL , 0 n L 1
xr n
otherwise
0,

overlap-add method
(1) segmentx(n) into sections of length L;
(2) fill 0 into h(n) and some section
of x(n) , then do L+P-1 points FFT ;
(3) calculate y (n)
y(n) IFFT {H (k ) X (k )}n 0,...L P 2
103

overlap-add method

x n xr n rL
r 0

L=16

(1) segment x(n) into sections of length L;


(2) fill 0 into h(n) and some section
of x(n), then do L+P-1 points FFT
(3) calculate y (n)

y(n) IFFT {H (k ) X (k )}
n 0,..., L P 2

y n x n h n yr n rL
r 0

where yr n xr n h n
(4)add the points n=0P-2 in y[n]
to the last P-1 points in the former
section y[n]the output for this
section
is the points n=0L-1
104

P-1 points

8.7.2 Circular Convolution as Linear


Convolution with Aliasing

L 8, P 4

N L 8

105

overlap-save method
(1) segment x(n) into sections of length L,
overlap P-1 points;

(2) fill 0 into h(n) and some section


of x(n), then do L points FFT

L=25

(3) calculate y (n)

y(n) IFFT {H (k ) X (k )}
n 0,..., L 1
(4) the output for this section is
L-P+1 points of y[n]
n=P-1,L-1

106

P-1 points

Chapter 8 HW
8.3, 8.4, 8.7, 8.10,
8.51, 8.52, 8.53,

107

2014/11/26

Zhongguo Liu_Biomedical Engineering_Shandong Univ.

Вам также может понравиться