Finite-length Discrete Transforms Chapter 5 Sections 5 2 Chapter 5, - - PowerPoint PPT Presentation

finite length discrete transforms
SMART_READER_LITE
LIVE PREVIEW

Finite-length Discrete Transforms Chapter 5 Sections 5 2 Chapter 5, - - PowerPoint PPT Presentation

Finite-length Discrete Transforms Chapter 5 Sections 5 2 Chapter 5, Sections 5.2 - 5.10 5 10 D I Dr. Iyad Jafar d J f Outline Outline The Discrete Fourier Transform (DFT) Matrix Representation of DFT Finite-length Sequences


slide-1
SLIDE 1

Finite-length Discrete Transforms

Chapter 5 Sections 5 2 5 10 Chapter 5, Sections 5.2 - 5.10 D I d J f

  • Dr. Iyad Jafar
slide-2
SLIDE 2

Outline Outline

The Discrete Fourier Transform (DFT) Matrix Representation of DFT Finite-length Sequences Circular Convolution DFT Symmetry Properties DFT Theorems

2

slide-3
SLIDE 3

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

In practice, we usually deal with finite-length sequences,

x[n], 0 ≤ n ≤ N -1

N 1

  • In this case, the DTFT is

N 1 j j n n 0

X(e ) x[n] e

|X(ejω)| …. ….

However, X(ejω) is a periodic and continuous function of

ω 2π

, ( ) p ω!!

How about processing of digital signals in How about processing of digital signals in

frequency domain ?

3

slide-4
SLIDE 4

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

j

|X(ejω) | ω 2 …. ….

Alternatively, consider working with one period of X(ejω) !

ω 2π

Δω

y, g p ( ) Still, we have infinite points?

Take N equally-spaced samples from X(ejω) over the range [0,

q y p p ( ) g [ , 2π]

Accordingly, the spacing between the samples is

g y, p g p Δω = 2π / N

And the normalized angular frequency for each sample is And the normalized angular frequency for each sample is

ω = 2π k / N , 0 ≤ k ≤ N-1

4

slide-5
SLIDE 5

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Mathematically,

j 2 k

X[k] X(e )

  • N 1

2 kn j N

x[n] e , 0 k N-1

N

  • This is called the N-point Discrete Fourier Transform

(DFT)

n 0

[ ] ,

(DFT)

Note that the DFT Always exists since it is a finite sum!

y

When computing the DFT, all samples in x[n] are used

to compute one sample in X[k] to compute one sample in X[k]

5

slide-6
SLIDE 6

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Example 5.1: compute the 4-point DFT for x[n] = {2, 0, -2, 1} [ ] { , , , }

6

slide-7
SLIDE 7

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Example 5.2: compute the N-point DFT for

1 , n = 0 [ ] ⎧ ⎨ x[n] 0 , 1 n N-1 ⎨

7

slide-8
SLIDE 8

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

The inverse N-point Discrete Fourier Transform (IDFT) is

given by

N 1 2 kn j

1

V ifi i !

j N k 0

1 x[n] X[k] e , 0 n N-1 N

Verification!

N 1 2 kn j N

1 x[n] X[k] e , 0 n N-1 N

k 0

N

N 1 N 1 2 km 2 kn j j N N

1 x[n] x[m] e e n N 1

⎟ ⎜ ⎟

∑ ∑

k 0 m 0

x[n] x[m] e e , 0 n N-1 N

⎟ ⎜ ⎟ ⎝ ⎠

∑ ∑

N 1 N 1 2 k(m n)

1

N 1 N 1 2 k(m n) j N m 0 k 0

1 x[n] x[m] e , 0 n N-1 N

⎟ ⎜ ⎟ ⎝ ⎠

∑ ∑

8

x[n] x[n]

  • Equals 0 when m ≠ n and N

when m = n

slide-9
SLIDE 9

Matrix R Matrix Representation of DFT presentation of DFT

The DFT is given by

N 1 2 kn j

Let W = e-j2π/N so the DFT becomes

j N n 0

X[k] x[n] e , 0 k N-1

Let WN = e j2π/N, so the DFT becomes

N 1 kn N

X[k] x[n] W , 0 k N-1

In matrix form

N n 0

[ ] [ ] ,

x[0] x[1] ⎡ ⎤ ⎢ ⎥ ⎢ ⎥

k 2k 3k (N 1)k N N N N

X[k] 1 W W W ... W x[2] ...

⎥ ⎢ ⎥ ⎡ ⎤ ⎣ ⎦ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥

9

x[N 1] ⎢ ⎥

slide-10
SLIDE 10

Matrix R Matrix Representation of DFT presentation of DFT

In general, the DFT can be written as

n = 0 n = N-1

1 1 1 1 ... 1 x[0] ⎡ ⎤ ⎡ ⎢ ⎥ ⎢ ⎤ ⎥

n 0 k = 0

2 3 (N 1) N N N N 2 4 6 N N N

1 W W W ... W X[k] 1 W W W ...

  • 2(N 1)

N

x[1] W x[2]

⎥ ⎢ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥

N 1 2(N 1) 3(N 1) (N 1)(N 1) N N N N

... ... x[N 1] 1 W W W ... W

⎥ ⎢ ⎥ ⎢ ⎥

⎢ ⎥ ⎣ ⎦ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎦

k = N-1

⎣ ⎦

N

X[k] = D x

where DN is called the DFT matrix

10

slide-11
SLIDE 11

Matrix R Matrix Representation of DFT presentation of DFT

For the inverse DFT

X[k] D

1 1 N

X[k] = D x

1 1 N N N

D X[k] = D D x

  • h

h f D

1 N

x[n] = D X[k]

  • where the inverse of DN is

1 1 1 1 ... 1 ⎡ ⎤

1 2 3 (N 1) N N N N 1 2 4 6

1 W W W ... W 1 D 1 W W W

  • 2(N 1)

W

⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥

N N N N

D 1 W W W N

  • (

) N (N 1) 2(N 1) 3(N 1) (N 1)(N 1)

... W ... ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥

11 (N 1) 2(N 1) 3(N 1) (N 1)(N 1) N N N N

1 W W W ... W

⎥ ⎢ ⎥ ⎣ ⎦

slide-12
SLIDE 12

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Example 5.3: compute the N-point DFT for x[n] = {-2, 1, 7, 3} using matrix notation. [ ] { , , , } g

12

slide-13
SLIDE 13

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Note 1. The N-point DFT is computed from the DTFT

through sampling through sampling

j 2 k

X[k] X(e )

  • 2 k

N

X[k] X(e )

  • Note 2. The DTFT for a length-N sequence can be

computed from the DFT by taking infinite samples. This p y g p implies that we can take as many as M samples for the DFT given that M > N g

13

slide-14
SLIDE 14

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Note 3. For a finite length sequence x[n], 0 ≤ n ≤ N-1,

the IDFT is periodic with period N In other words if the IDFT is periodic with period N. In other words, if y[n] = IDFT(X[k]),then

  • m

y[n] x[n mN] , 0 n N - 1

Proof: let x[n] be a length-N sequence, 0 ≤ n ≤ N-1, andY[k] be the N-point DFT of x[n], i.e.,

kl N l

Y[k] x[l] W

Now, the N-point IDFT of Y[k]

l M 1

1

  • 14

kn N k 0

1 q[n] Y[k] W , 0 k N 1 N

slide-15
SLIDE 15

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Proof - continued

M 1 kl k

1

⎞ ⎜ ⎟

∑ ∑

kl kn N N k 0 l

1 q[n] x[l] W W , 0 k N 1 N

⎟ ⎜ ⎟ ⎝ ⎠

∑ ∑

M 1 k(n l) N

1 q[n] x[l] W , 0 k N 1 N

⎟ ⎜ ⎟ ⎝ ⎠

∑ ∑

However,

l k 0

N

M 1

M 1 k(n l) N k 0

1 , l = n + mN 1 W 0 , otherwise N

⎨ ⎩

So,

~

q[n]= y[n] x[n mN] n N 1

15 m

q[n] y[n] x[n mN] , 0 n N 1

slide-16
SLIDE 16

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Note 4. To compute the M-point DFT for a length-N

sequence it is required that M ≥ N to avoid time-domain sequence, it is required that M ≥ N to avoid time domain aliasing between the translated copies of the original time-domain sequence time domain sequence. Example 5.4: consider x[n] = {1 , -1 , 1 , 1}, N = 4. If p [ ] { , , , }, we compute the 4-point DFT X[k], then the IDFT,

x[n] X[k] y[n]

[ ] [ 8] [ 4] [ ] [ 4] [ 8]

m

y[n] x[n mN] , 0 n N 1

16

y[n] + x[n+8] + x[n+4] + x[n] + x[n-4] + x[n-8] … …

slide-17
SLIDE 17

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Example 5.4: Continued.

0.5 1 1.5

y[n]

1 1.5

  • 1
  • 0.5

x[n+4] y[n]

0.5 1

1 1.5

  • 4
  • 2

2 4 6 8

  • 1.5

n

  • 0.5

1

  • 0.5

0.5

x[n] +

1 5

  • 1

1 1.5

  • 4
  • 2

2 4 6 8

  • 1.5
  • 1

n

  • 4
  • 2

2 4 6 8

  • 1.5

n

  • 0.5

0.5 1

x[n-4]

17

  • 4
  • 2

2 4 6 8

  • 1.5
  • 1

n

slide-18
SLIDE 18

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Example 5.5: consider x[n] = {1 , -1 , 1 , 1}, N = 4. If we compute the 2-point DFT X[k], then the IDFT, p p [ ], , x[n] X[k] y[n] [ ] [ ] y[ ]

[ ] [ N] N 1

m

y[n] x[n mN] , 0 n N 1

y[n] + x[n+4] + x[n+2] + x[n] + x[n-2] + x[n-4] … …

18

slide-19
SLIDE 19

The Discre The Discrete F e Fourier T urier Transf ansform (DFT)

  • rm (DFT)

Example 5.5: Continued.

[ 2] y[n]

0.5 1 1.5

2.5

x[n+2] y[n]

  • 1
  • 0.5

1.5 2

1 1.5

  • 4
  • 2

2 4 6 8

  • 1.5

n

0.5 1

  • 0.5

0.5

x[n] +

0 5

  • 4
  • 2

2 4 6 8

  • 1.5
  • 1

n 1 1.5

  • 2

2 4 6

  • 0.5

n

x[n-2]

  • 0.5

0.5

19

  • 4
  • 2

2 4 6 8

  • 1.5
  • 1

n

slide-20
SLIDE 20

Operations on Finit Operations on Finite-Length Seq

  • Length Sequences

ences

Given a finite-length sequence x[n], 0 ≤ n ≤ N -1, we can

define the circular time-reversal of x[n] as [ ] here <n> = r is the modulus operator i e

N

y[n] x[ n ]

  • where <n>N = r is the modulus operator, i.e.

r = n modulo N

How to compute <n>N ?

For positive n, straight forward! For negative numbers, let r = n + kN, where k is an integer,

then compute the smallest k such that 0 ≤ r ≤ N -1

Example 5.6

<-15>7 = ?? 15 + k * 7 f k 3 6 r = -15 + k * 7 for k = 3 r = 6 <-15>7 = 6

20

slide-21
SLIDE 21

Operations on Finit Operations on Finite-Length Seq

  • Length Sequences

ences

Example 5.7: Determine y[n] = x[<-n>5] for

[ ] = [1 2 3 4 5] x[n] = [1 2 3 4 5] y[0] = x[<-0>5] = 1

3 4 5 n]

y[ ] [

5]

y[1] = x[<-1>5] = 5 y[2] = x[< 2> ] = 4

1 2 x [n

y[2] = x[<-2>5] = 4 y[3] = x[<-3>5] = 3 [4] [< 4> ] 2

2 4 n

y[4] = x[<-4>5] = 2

3 4 5 [n]

[N ] 1 N 1 ⎧

1 2 y [

N

x[N - n] , 1 n N - 1 x[ n ] = x[n] , n = 0

⎨ ⎩

21

2 4 n

slide-22
SLIDE 22

Operations on Finit Operations on Finite-Length Seq

  • Length Sequences

ences

22

slide-23
SLIDE 23

Operations on Finit Operations on Finite-Length Seq

  • Length Sequences

ences

Given a finite-length sequence x[n], 0 ≤ n ≤ N -1, we can

define the circular time-shift of x[n] as define the circular time-shift of x[n] as

  • N

y[n] x[ n - n ]

  • For no > 0

x[n - n ] n n N - 1

  • N
  • x[n - n ] , n

n N - 1 x[ n - n ] x[N + n - n ] , 0 n < n

For no < 0

  • N

x[N + n - n ] , n n N - 1 x[ n - n ] x[n + n ] n n

23

  • x[n + n ] , 0

n n

slide-24
SLIDE 24

Operations on Finit Operations on Finite-Length Seq

  • Length Sequences

ences

Example 5.8: let x[n] = {-1 , 0 , 1 , 2}, determine

4

y[n] x[ n - 2 ]

  • y[0] = x[<0 - 2>4] = x[<-2>4] = x[2] = 1

4

y[n] x[ n 2 ]

  • y[1] = x[<1 - 2>4] = x[<-1>4] = x[3] = 2

y[2] = x[<2 - 2>4] = x[<0>4] = x[0] = 1 y[ ] [

4]

[

4]

[ ] y[3] = x[<3 - 2>4] = x[<1>4] = x[1] = 0

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

24

  • 1

1 2 3 4

  • 1

n

  • 1

1 2 3 4

  • 1

n

slide-25
SLIDE 25

Symmetr Symmetry of Finit y of Finite-Length Seq

  • Length Sequences

ences

A complex finite-length sequence x[n], 0 ≤ n ≤ N -1, is

called circular conjugate-symmetric sequence if

A complex finite-length sequence x[n], 0 ≤ n ≤ N -1, is

* * N N

x[n] x [ n ] x [ N n ]

  • p

g q called circular conjugate-antisymmetric sequence if

* * N N

x[n]

  • x [

n ]

  • x [

N n ]

  • A complex finite-length sequence can be decomposed into

its circular conjugate-symmetric and circular conjugate-

N N

[ ] [ ] [ ]

its circular conjugate symmetric and circular conjugate antisymmetric parts

cs ca

x[n] x [n] x [n]

  • *

cs N

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

  • 25
  • *

ca N

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

slide-26
SLIDE 26

Symmetr Symmetry of Finit y of Finite-Length Seq

  • Length Sequences

ences

A real finite-length sequence x[n], 0 ≤ n ≤ N -1, is called

circular even sequence if q

A real finite-length sequence x[n] 0 ≤ n ≤ N -1 is called

N N

x[n] x[ n ] x[ N n ]

  • A real finite length sequence x[n], 0 ≤ n ≤ N 1, is called

circular odd sequence if

x[n] x[ n ] x[ N n ]

  • A real finite-length sequence can be decomposed into its

d dd

N N

x[n]

  • x[

n ]

  • x[

N n ]

  • conjugate even symmetric and conjugate odd parts

ev

  • dd

x[n] x [n] x [n]

  • ev

N

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

  • 26
  • dd

N

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

slide-27
SLIDE 27

Symmetr Symmetry of Finit y of Finite-Length Seq

  • Length Sequences

ences

Example

5.9: determine the circular conjugate- symmetric and circular conjugate-antisymmetric for y g y x[n] = {1+j4 , -2+j3 , 4-j2 , -5-j6}

27

slide-28
SLIDE 28

Cir Circular Con ular Convolution

  • lution

Given a finite-length sequence x[n], 0 ≤ n ≤ N -1, with its

X(ejω) being its DTFT and X[k] being its N-point DFT

Similarly, let h[n], 0 ≤ n ≤ N -1, be the impulse response of

LTI h H( jω) b DTFT d H[k] b LTI system with its H(ejω) being its DTFT and H[k] being its N-point DFT

We know from the convolution theorem that the output of

the system y[n] due to the input x[n] y y[ ] p [ ] y[n] = x[n] h[n]  Y(ejω) = X(ejω) H(ejω)

*

However, is it true that

y[n] = x[n] h[n] ?????? Y[k] = X[k] H[k]

*

y[ ] [ ] [ ] [ ] [ ] [ ]

28

slide-29
SLIDE 29

Cir Circular Con ular Convolution

  • lution

x[n]

N-point DFT

X[k]

IDFT

x[n]

… n

h[n]

X[k]

n … …

N-point DFT IDFT

h[n]

  • N-1

n

h[n]

DFT

H[k]

… …

This implies that

n

x[n] * h[n] X[k] H[k]

  • N-1

x[n] * h[n] X[k] H[k]

  • n

… … N-1

29

n N-1 Wrap around error

slide-30
SLIDE 30

Cir Circular Con ular Convolution

  • lution

[ ] [ ] N h[ ]

This is called N-point circular convolution,

N 1

y[n] x[n] N h[n] = x[n] * h[n] = x[m] h[<n m> ]

  • N

m 0

= x[n] * h[n] = x[m] h[<n-m> ]

where the sequence y[n] is of length N and is computed over where the sequence y[n] is of length N and is computed over 0 ≤ n ≤ N -1.

Circular convolution of length-N finite sequences requires

Circular time-reversal Circular time-shift Multiplication

p

Addition

30

slide-31
SLIDE 31

Cir Circular Con ular Convolution

  • lution

Example 5.10: let x[n] = {1 , 2 , 0 , 1} and h[n] = {2 ,

2 , 1 , 1} for 0 ≤ n ≤ N -1. Determine the circular convolution between x[n] and h[n].

3 4

y [n] x[n] N h[n] = x[m] h[<n-m> ]

c 4 m 0

y [n] x[n] N h[n] x[m] h[ n m ]

31

slide-32
SLIDE 32

Cir Circular Con ular Convolution

  • lution

Can we implement linear convolution between two

finite length sequences using circular convolution? Simply, we need to prevent the wraparound errors ! This can be simply done by padding the two sequences with M zeros be simply done by padding the two sequences with M zeros where M ≥ N – 1. This implies that when the IDFT is computed from the DFT

  • f the padded sequences, the two sequences are periodic with
  • f the padded sequences, the two sequences are periodic with

the padded zeros. Accordingly, wraparound errors are canceled when one sequence is shifted in convolution.

32

slide-33
SLIDE 33

Cir Circular Con ular Convolution

  • lution

x[n]

N-point DFT

X[k]

IDFT

x[n]

… n

h[n]

X[k]

n … …

N-point DFT IDFT

h[n]

  • N-1 2(N-1)

n

h[n]

DFT

H[k]

… …

This implies that

n

x[n] * h[n] X[k] H[k]

  • N-1

x[n] * h[n] X[k] H[k]

  • n

… … N-1

33

n N-1

slide-34
SLIDE 34

Cir Circular Con ular Convolution

  • lution

So why do we care about circular convolution?

To perform linear convolution between two finite length p g sequences using their DFT, the sequences have to be padded with at least N-1 zeros.

Example 5.11: x[n] = {1 2 0 1} h[n] = {2 2 1 1}. The linear convolution result The circular convolution result The circular convolution result of the padded sequences

34

slide-35
SLIDE 35

DFT Symmetr DFT Symmetry Pr y Proper

  • perties

ties

xn is a complex sequence sequence

35

slide-36
SLIDE 36

DFT Symmetr DFT Symmetry Pr y Proper

  • perties

ties

xn is a real sequence

36

slide-37
SLIDE 37

DFT Theorems DFT Theorems

37

slide-38
SLIDE 38

Exam Examples ples

Example 5.12: Compute G[k] and H[k] of the following

two sequences using a single 4-point DFT. x[n] = {1 , 2 , 0 , 1} h[n] = {2 , 2 , 1 , 1} [ ] { , , , }

38

slide-39
SLIDE 39

Exam Examples ples

Example 5.13:

X[k] = {4 , -1+j7.33 , -1-j3.36 , -1+j3.36 , -1-j7.33}. What is G[k] if g[n] = x[<n-12>5]?

39

slide-40
SLIDE 40

Exam Examples ples

Example 5.14: The 134-point DFT for a real sequence x[n] is

known to be zero except at the following values of k. Determine

k

k k k

k1 , k2 , k3 , k4 A, B , C, D , E The DC value

k X[k] 3.42 - jA

The DC value

The energy of x[n]

17 4.52 + j7.91 k1

  • 3.6 + j5.46

k2 j3.78 47

  • j3.78

67 45 + jB 67 45 + jB k3 E – j7.91 79

  • 3 6 + jD

79

  • 3.6 + jD

108 C + j7.56 k4

  • 3.7 – j7.56

40

4

j

slide-41
SLIDE 41

Matlab Matlab

  • Related functions
  • freqz
  • freqz
  • fft
  • dft t
  • dftmtx
  • fftshift
  • angle
  • abs
  • mod
  • conv
  • cconv

41