Digital Signal Processing Lecture 7

61
Remote Sensing Laboratory Dept. of Information Engineering and Computer Science University of Trento Via Sommarive, 14, I-38123 Povo, Trento, Italy Remote Sensing Laboratory Dept. of Information Engineering and Computer Science University of Trento Via Sommarive, 14, I-38123 Povo, Trento, Italy Digital Signal Processing Lecture 7 Digital Signal Processing Lecture 7 E-mail: demir@disi.unitn.it Web page: http://rslab.disi.unitn.it Quote of the Day Whoever despises the high wisdom of mathematics nourishes himself on delusion. Leonardo da Vinci

Transcript of Digital Signal Processing Lecture 7

Page 1: Digital Signal Processing Lecture 7

Remote Sensing LaboratoryDept. of Information Engineering and Computer Science

University of TrentoVia Sommarive, 14, I-38123 Povo, Trento, Italy

Remote Sensing LaboratoryDept. of Information Engineering and Computer Science

University of TrentoVia Sommarive, 14, I-38123 Povo, Trento, Italy

Digital Signal ProcessingLecture 7

Digital Signal ProcessingLecture 7

E-mail: [email protected] page: http://rslab.disi.unitn.it

Quote of the DayWhoever despises the high wisdom of mathematics

nourishes himself on delusion.

Leonardo da Vinci

Page 2: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Page 3: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Time Fourier Transform

B. Demir

Page 4: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

B. Demir

• Consider a sequence with a Fourier transform

• Assume that a sequence is obtained by sampling the DTFT

• Since the DTFT is periodic resulting sequence is also periodic.

• is the Discrete Fourier Series of a sequence.

• Write the corresponding sequence:

jDTFT eXnx ][

kNj

kN

j eXeXkX /2

/2

~

kX~

1N

0k

knN/2jekX~N1]n[x~

Page 5: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

B. Demir

• The only assumption made on the sequence is that DTFT exist.

• Combine equation to get:

• Term in the parenthesis is

• So we get

m

mjj emxeX kNjeXkX /2~

1

0

/2~1][~ N

k

knNjekXN

nx

mm

N

k

mnkNj

N

k

knNj

m

kmNj

mnpmxeN

mx

eemxN

nx

~1

1][~

1

0

/2

1

0

/2/2

r

N

k

mnkNj rNmneN

mnp 1

0

/21~

rr

rNnxrNnnxnx ][~

Page 6: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

Page 7: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

Sampling in Frequency Domain-Example

Page 8: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

B. Demir

If the original sequence• is of finite length• and we take sufficient number of samples of its DTFT• the original sequence can be recovered by

else

Nnnxnx

010~

Discrete Fourier Transform• Representing a finite length sequence by samples of DTFT

Page 9: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

B. Demir

• Consider a finite length sequence x[n] of length N

• For given length-N sequence associate a periodic sequence

• The Discrete Fourier Series (DFS) coefficients of the periodic sequence are samples of the DTFT of x[n]. Since x[n] is of length N there is no overlap between terms of x[n-rN] and we can write the periodic sequence as:

• To maintain duality between time and frequency– We choose one period of as the Fourier transform of x[n]

10 of outside 0 Nnnx

r

rNnxnx~

Nnxnxnx N mod ~

kX~

else

NkkXkX0

10~ NkXkXkX N mod ~

Page 10: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

B. Demir

• The DFS pair:

• The equations involve only on period so we can write

• The Discrete Fourier Transform (DFT):

• The DFT pair can also be written as

1

0

/2][~~ N

n

knNjenxkX

1

0

/2~1][~ N

k

knNjekXN

nx

else

NkenxkXN

n

knNj

0

10][~1

0

/2

else

NkekXNnx

N

k

knNj

0

10~1][

1

0

/2

1

0

/2][N

n

knNjenxkX

1

0

/21][N

k

knNjekXN

nx

][kXnx DFT

Page 11: Digital Signal Processing Lecture 7

University of Trento, Italy

Implications of Inherent DFT Periodicity

B. Demir

Use DFS for interpretations

Use DFT for computations

User Before

User After

Page 12: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier TransformSampling in Frequency Domain-Example

B. Demir

Page 13: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Discrete Fourier Transform

2 /j NNW e

Page 14: Digital Signal Processing Lecture 7

University of Trento, Italy

DFT versus DTFT

B. Demir

Page 15: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

B. Demir

Page 16: Digital Signal Processing Lecture 7

University of Trento, Italy

Discrete Fourier Transform

B. Demir

Page 17: Digital Signal Processing Lecture 7

University of Trento, Italy

• The DFT of a rectangular pulse• x[n] is of length 5• We can consider x[n] of any length greater

than 5• Let’s pick N=5• Calculate the DFS of the periodic form of x[n]

elsek

ee

ekX

kj

kjn

nkj

0,...10,5,05

11

~

5/2

2

4

0

5/2

Example

B. Demir

Page 18: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Discrete Fourier Transform

How we can obtain other samples of DTFT?

We should increase N. This we can achieve by treating x[n] as an N point sequence by appending zeros.

This is a very important operation called zero padding operation.

This operation is necessary in practice to obtain a dense spectrum ofsignals.

Zero padding is an operation in which more zeros are appended to theoriginal sequence. The resulting longer DFT provides closely spacedsamples of the DTFT of the original sequence (i.e., a high densityspectrum).

Page 19: Digital Signal Processing Lecture 7

University of Trento, Italy

Example-Cont

• 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

B. Demir

Page 20: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Discrete Fourier Transform

Page 21: Digital Signal Processing Lecture 7

University of Trento, Italy

Time-domain aliasing

B. Demir

Page 22: Digital Signal Processing Lecture 7

University of Trento, Italy

Illustration of Time-Domain Aliasing

B. Demir

Page 23: Digital Signal Processing Lecture 7

University of Trento, Italy

Illustration of Time-Domain Aliasing

B. Demir

Page 24: Digital Signal Processing Lecture 7

University of Trento, Italy

DFT: Matrix form

B. Demir

Page 25: Digital Signal Processing Lecture 7

University of Trento, Italy

IDFT: Matrix form

B. Demir

Page 26: Digital Signal Processing Lecture 7

University of Trento, Italy

Example

B. Demir

Page 27: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Properties of Discrete Fourier Transform

1 1

2 2

3 1 2 3 1 2[ ] [ ]

DFT

DFT

DFT

x n X kx n X k

x n ax n bx n X k aX k bX k

• Linearity

If x1[n] and x2[n] have different durations-that is, they are N1 point andN2 point sequences, respectively-then the duration N3 of x3[n] should begreater or equal to max(N1, N2).

Then N3≥ max(N1, N2) point DFTs should be estimated both for x1[n]and x2[n].

If the duration (i.e., length) of any of the signals is smaller than N3, zeropadding should be applied.

Page 28: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Properties of Discrete Fourier Transform: Linearity

n

1[ ]x n1[ ]x n

0 N11

Duration N1

n2[ ]x n2[ ]x n

0 N21

Duration N2

1 1[ ] [ ]x n X kDFT1 1[ ] [ ]x n X kDFT

2 2[ ] [ ]x n X kDFT2 2[ ] [ ]x n X kDFT

1 2 1 2[ ] [ ] [ ] [ ]ax n bx n aX k bX k DFT1 2 1 2[ ] [ ] [ ] [ ]ax n bx n aX k bX k DFT

Page 29: Digital Signal Processing Lecture 7

University of Trento, Italy

Periodic, circular and modulo-N operations

B. Demir

a) finite length sequence x[n] b) periodic extension sequence formed byreplicated x[n] c) wrapping the sequence around a cylinder withcircumference N and using modulo-N d) representation of a circularbuffer with modulo-N indexing.

Page 30: Digital Signal Processing Lecture 7

University of Trento, Italy

The n Modulo N Operation

B. Demir

Page 31: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular folding (or reversal)

[0] n=0[ ]

[ ] 1 -1N

xz n x n

x N n n N

B. Demir

Page 32: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular folding (or reversal)

B. Demir

[ ] [ ]x n X kDFT[ ] [ ]x n X kDFT

[ ] [ ]N N

x n X k DFT[ ] [ ]N N

x n X k DFT

[0] n=0

[ ] 1 -1N

XX k

X N k k N

Page 33: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Time Shifting of a Sequence

2 / 0 -1

DFT

j k N mDFTN

x n X k

x n m n N X k e

B. Demir

Circular Shift of a Sequence

Page 34: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Shift of a Sequence

B. Demir

Page 35: Digital Signal Processing Lecture 7

University of Trento, Italy

Properties of Discrete Fourier Transform-Shifting

B. Demir

Page 36: Digital Signal Processing Lecture 7

University of Trento, Italy

0n

[ ]x n[ ]x n

N

n

[ ]x n[ ]x n

0 N

n

1[ ] [ 2]x n x n 1[ ] [ 2]x n x n

0 N

11

[ ] [ ] 0 1[ ]

0N

x n x n m n Nx n

otherwise

11

[ ] [ ] 0 1[ ]

0N

x n x n m n Nx n

otherwise

Circular Time Shifting of a Sequence

n m

Page 37: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Shift of a Sequence

B. Demir

Page 38: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Frequency Shifting Teorem:

B. Demir

02 /

0 0 -1

DFT

j k N n DFTN

x n X k

x n e X k k k N

Circular Frequency Shifting of a Sequence

Page 39: Digital Signal Processing Lecture 7

University of Trento, Italy

1

3 1 20

[ ] [ ] [ ]N

Nm

x n x m x n m

1

3 1 20

[ ] [ ] [ ]N

Nm

x n x m x n m

1 1[ ] [ ]x n X kDFT1 1[ ] [ ]x n X kDFT

2 2[ ] [ ]x n X kDFT2 2[ ] [ ]x n X kDFT

1

3 1 2 3 1 20

[ ] [ ] [ ] [ ] [ ] [ ]N

Nm

x n x m x n m X k X k X k

DFT1

3 1 2 3 1 20

[ ] [ ] [ ] [ ] [ ] [ ]N

Nm

x n x m x n m X k X k X k

DFT

both of length N

Circular Convolution

B. Demir

Page 40: Digital Signal Processing Lecture 7

University of Trento, Italy

Multiplication of Two N-Point DFTs: Circular Convolution

Page 41: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Convolution

B. Demir

Page 42: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Convolution-Example

B. Demir

Page 43: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Convolution-Graphical Interpretation

B. Demir

Page 44: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Convolution-Matrix Form

B. Demir

Page 45: Digital Signal Processing Lecture 7

University of Trento, Italy

Circular Convolution-Matrix Form

B. Demir

Page 46: Digital Signal Processing Lecture 7

University of Trento, Italy

Example

B. Demir

Page 47: Digital Signal Processing Lecture 7

University of Trento, Italy

3 1 2 1 2[ ] [ ] [ ] [ ] [ ]m

x n x m x n m x n x n

3 1 2 1 2[ ] [ ] [ ] [ ] [ ]m

x n x m x n m x n x n

1 1[ ] ( )jx n X e DTFT1 1[ ] ( )jx n X e DTFT

2 2[ ] ( )jx n X e DTFT2 2[ ] ( )jx n X e DTFT

3 1 2 3 1 2[ ] [ ] [ ] ( ) ( ) ( )j j jx n x n x n X e X e X e DTFT3 1 2 3 1 2[ ] [ ] [ ] ( ) ( ) ( )j j jx n x n x n X e X e X e DTFT

B. Demir

Linear Convolution (Review)

Page 48: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Linear Convolution Using DFT

Let x1[n] be an N1 point sequence and let x2[n] be an N2 point sequence.

Define the linear convolution of x1[n] and x2[n] by x3[n], that is:

Then x3[n] is a N1+N2-1 point sequence.

If we choose N=max(N1, N2) and compute an N point circular convolution we

get an N point sequence which is obviously different from x3[n].

3 1 2

1 2

[ ] [ ] [ ]

[ ] [ ]m

x n x n x n

x m x n m

3 1 2

1 2

[ ] [ ] [ ]

[ ] [ ]m

x n x n x n

x m x n m

Page 49: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Linear Convolution Using DFT

To obtain the same results with linear convolution, we should make both x1[n]

and x2[n] N1+N2-1 point sequences by padding an appropriate number of

zeros.

By this way the circular convolution is identical to the linear convolution.

Page 50: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Linear Convolution Using DFT

Page 51: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Example

Page 52: Digital Signal Processing Lecture 7

University of Trento, Italy

Windowing Property:

B. Demir

3 1 2[ ] [ ] [ ]x n x n x n3 1 2[ ] [ ] [ ]x n x n x n

1 1[ ] [ ]x n X kDFT1 1[ ] [ ]x n X kDFT

2 2[ ] [ ]x n X kDFT2 2[ ] [ ]x n X kDFT

1

3 1 2 3 1 20

1[ ] [ ] [ ] [ ] [ ] [ ]N

Nl

x n x n x n X k X l X k lN

DFT1

3 1 2 3 1 20

1[ ] [ ] [ ] [ ] [ ] [ ]N

Nl

x n x n x n X k X l X k lN

DFT

both of length N

Page 53: Digital Signal Processing Lecture 7

University of Trento, Italy

[ ] [ ]x n X kDFT[ ] [ ]x n X kDFT

[ ] [ ], 0 1N

X n Nx k k N DFT[ ] [ ], 0 1N

X n Nx k k N DFT

Duality Property:

B. Demir

Page 54: Digital Signal Processing Lecture 7

University of Trento, Italy

Properties of DFT

B. Demir

1

2 /

0

1[ ]N

j N kn

kx n X k e

N

12 /

0

12 /

01

2 /

0

[ ]

[ ]

[ ]

Nj N kn

n

Nj N kn

kN

j N kn

n

X k x n e

Nx n X k e

Nx k X n e

Proof for the Duality:

DFT

DFT

x n X kX n Nx k

Page 55: Digital Signal Processing Lecture 7

University of Trento, Italy

Parseval's Relation (Related to DFT):

B. Demir

1 12 2

0 0

1[ ] [ ]N N

n k

E g n G kN

The total energy of a length N sequence g[n] can be computed by summing the square of the absolute values of the DFT samples G[k] divided by N:

1 1* *

0 0

1[ ] [ ] [ ] [ ]N N

n k

g n h n G k H kN

This theorem expresses the sum of sample by sample product of two complex sequences in terms of sum of the product of their discrete Fourier transforms. Specifically, the most general form of this theorem is:

Page 56: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

Symmetry properties of the DFT

x[n] is a real sequence:

Page 57: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

x[n] is a real sequence:

* *[ ] [ ] [ ]DFTN

x n x n X k X k

Sequence x[n] Discrete Fourier Transform X[k]Any real x[n] X[k]=X*[(-k)N]Any real x[n] XRe[k]=XRe[(-k)N]Any real x[n] XIm[k]=-XIm[(-k)N]Any real x[n] |X[k]|=|X[(-k)N]|Any real x[n] X[k]=-X[(-k)N]xe[n] XRe[k]xo[n] jXIm[k]

Symmetry relation of the discrete Fourier transform for a real sequence

Symmetry properties of the DFT

Page 58: Digital Signal Processing Lecture 7

University of Trento, Italy

Symmetry properties of the DFT

Symmetries of real and imaginary parts of the DFT of a real valuedsequence with even and odd number of samples. Note that we check thevalues for k=1,2,…,N-1 for even and odd symmetry about the point N/2;for odd symmetry the value at k=0 should be zero.

B. Demir

Page 59: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

DFT Symmetry Properties-Conjugate Symmetry

Let’s consider a complex sequence x[n]:

*N

x n x n

*N

x n x n

, 0 1cs cax n x n x n n N

*1 , 0 12cs N

x n x n x n n N

*1 , 0 12ca N

x n x n x n n N

Circular conjugate symmetric Circular conjugate antisymmetric

x[n] is said to be circular conjugate symmetric if

x[n] is said to be circular conjugate antisymmetric if

Page 60: Digital Signal Processing Lecture 7

University of Trento, Italy B. Demir

*N

X k X k

*N

X k X k

, 0 1cs caX k X k X k k N

*1 , 0 12cs N

X k X k X k k N

*1 , 0 12ca N

X k X k X k k N

Circular conjugate symmetric Circular conjugate antisymmetric

X[k] is said to be circular conjugate symmetric if

X[k] is said to be circular conjugate antisymmetric if

Similarly, symmetry properties can be extended to DFT of a signal:

DFT Symmetry Properties-Conjugate Symmetry

Page 61: Digital Signal Processing Lecture 7

University of Trento, Italy

Sequence x[n] Discrete Fourier Transform X[k]x*[n] X*[(-k)N]x*[(-n) N] X*[k]Re{x[n]} Xcs[k] ( circular conjugate-symmetric part)jIm{x[n]} Xca[k] (circular conjugate-antisymmetric part)xcs[n] XRe[k]= Re{X[k]}xca[n] jXIm[k]= jIm{X[k]}

Symmetry relation of the discrete Fourier transform for a complex sequence

B. Demir

DFT Symmetry Properties-Conjugate Symmetry