Linear Systems 2: Fourier transform, filtering, convolution theorem - - PowerPoint PPT Presentation

โ–ถ
linear systems 2
SMART_READER_LITE
LIVE PREVIEW

Linear Systems 2: Fourier transform, filtering, convolution theorem - - PowerPoint PPT Presentation

COMP 546 Lecture 17 Linear Systems 2: Fourier transform, filtering, convolution theorem Tues. March 20, 2018 1 Recall last lecture convolution special behavior of sines and cosines complex numbers and Eulers formula Today


slide-1
SLIDE 1

1

COMP 546

Lecture 17

Linear Systems 2:

Fourier transform, filtering, convolution theorem

  • Tues. March 20, 2018
slide-2
SLIDE 2

Recall last lecture

  • convolution
  • special behavior of sines and cosines
  • complex numbers and Eulerโ€™s formula
slide-3
SLIDE 3

Today

  • Fourier transform
  • convolution theorem
  • filtering
slide-4
SLIDE 4

Key idea from linear algebra:

  • rthonormal basis vectors

1

  • 1

1 1 = ๐‘ฃ ๐‘ค ๐‘ฆ ๐‘ง

1 2

1 1

  • 1 1

= ๐‘ฃ ๐‘ค ๐‘ฆ ๐‘ง

Example: 1 2 ๐‘ฃ ๐‘ค ๐‘ฆ ๐‘ง

slide-5
SLIDE 5

Fourier transform uses

  • rthogonal basis vectors

1 1 1 -1 = ๐ฝ 0 ๐ฝ(1) ๐ฝ 0 ๐ฝ(1)

Example: ๐ฝ 0 ๐ฝ 1 ๐ฝ 0 ๐ฝ 1

1 1 1 -1 = ๐ฝ 0 ๐ฝ(1) ๐ฝ 0 ๐ฝ(1)

1 2

slide-6
SLIDE 6

(1D) Fourier analysis

Fourier transform

map N-dimensional delta function (impulse function) basis to an N-dimensional sinusoid function basis

Inverse Fourier transform

๐ฝ 0 : : ๐ฝ(๐‘‚ โˆ’ 1)

๐†โˆ’1 ๐†

๐ฝ 0 : : ๐ฝ(๐‘‚ โˆ’ 1)

slide-7
SLIDE 7

๐ฝ ๐‘™ =

๐‘ฆ=0 ๐‘‚โˆ’1

cos 2๐œŒ ๐‘‚ ๐‘™๐‘ฆ โˆ’ ๐‘— sin 2๐œŒ ๐‘‚ ๐‘™๐‘ฆ ๐ฝ ๐‘ฆ

Fourier Transform

๐ฝ ๐‘™ = ๐† ๐ฝ ๐‘ฆ

๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™ ๐‘ฆ

slide-8
SLIDE 8

Fourier transform

๐ฝ ๐‘™ = ๐† ๐ฝ ๐‘ฆ

slide-9
SLIDE 9

Define ๐‘‚ x ๐‘‚ Fourier transform matrix

Claim: (see lecture notes for proof)

where

๐†๐‘™,๐‘ฆ โ‰ก ๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™๐‘ฆ

๐†โˆ’1 = 1 ๐‘‚ ๐†

๐†๐‘™,๐‘ฆ โ‰ก ๐‘“ ๐‘— 2๐œŒ

๐‘‚ ๐‘™๐‘ฆ

slide-10
SLIDE 10

๐ฝ ๐‘™ = ๐ฝ ๐‘™

๐‘“ ๐‘— ๐œš(๐‘™)

amplitude phase spectrum spectrum

slide-11
SLIDE 11

Convolution Theorem

๐‘ฎ ๐ฝ ๐‘ฆ โˆ— โ„Ž ๐‘ฆ = ๐‘ฎ ๐ฝ ๐‘ฆ ๐‘ฎ โ„Ž ๐‘ฆ = ๐ฝ(๐‘™) โ„Ž(๐‘™)

11

Let ๐ฝ(๐‘ฆ) and โ„Ž(๐‘ฆ) be defined on ๐‘ฆ โˆˆ 0, 1, โ€ฆ , ๐‘‚ โˆ’ 1 . See lecture notes for proof.

slide-12
SLIDE 12

Convolution Theorem

๐‘ฎ ๐ฝ ๐‘ฆ โˆ— โ„Ž ๐‘ฆ = ๐‘ฎ ๐ฝ ๐‘ฆ ๐‘ฎ โ„Ž ๐‘ฆ = ๐ฝ(๐‘™) โ„Ž(๐‘™)

12

Let ๐ฝ(๐‘ฆ) and โ„Ž(๐‘ฆ) be defined on ๐‘ฆ โˆˆ 0, 1, โ€ฆ , ๐‘‚ โˆ’ 1 .

= ๐ฝ ๐‘™ โ„Ž(๐‘™)

๐‘“ โˆ’๐‘— ๐œš๐ฝ(๐‘™) ๐‘“ โˆ’๐‘— ๐œšโ„Ž(๐‘™)

Convolving an image ๐ฝ ๐‘ฆ with a filter โ„Ž ๐‘ฆ changes the amplitude and phase of each frequency component.

slide-13
SLIDE 13

Concept of filtering (by size) filters

slide-14
SLIDE 14
slide-15
SLIDE 15

Linear Filtering (by frequency โ€œbandโ€)

= + + + +

slide-16
SLIDE 16

Ideal Low Pass Filter โ„Ž ๐‘ฆ

16

๐‘‚ ๐‘™ ๐‘‚ 2 โ„Ž ๐‘™

Only consider up to N/2 because of the conjugacy property (coming soon).

slide-17
SLIDE 17

Ideal High Pass Filter โ„Ž ๐‘ฆ

17

๐‘‚ ๐‘™ ๐‘‚ 2 โ„Ž ๐‘™

slide-18
SLIDE 18

Ideal bandpass filter

18

๐‘‚ ๐‘™1 ๐‘‚ 2 ๐‘™2

Bandwidth โ‰ก ๐‘™2 โˆ’ ๐‘™1 Bandwidth (octaves) โ‰ก ๐‘š๐‘๐‘•2(๐‘™2) โˆ’ ๐‘š๐‘๐‘•2(๐‘™1)

โ„Ž ๐‘™

slide-19
SLIDE 19

Non-Ideal Filters

19

slide-20
SLIDE 20

Bandwidth of Non-Ideal Bandpass Filter

20

slide-21
SLIDE 21

Why are we defining the low/band/high pass filters according to their properties

  • n frequencies k in 0, .. N/2 only ?
slide-22
SLIDE 22

Conjugacy Property of Fourier transform

Let โ„Ž ๐‘ฆ be a real valued function. Then, for any integer ๐‘™,

โ„Ž ๐‘™ = โ„Ž ๐‘‚ โˆ’ ๐‘™ .

Proof: see the lecture notes. ๐‘‚ ๐‘™ ๐‘‚ โˆ’ ๐‘™ ๐‘‚ 2

slide-23
SLIDE 23

For any positive or negative integer ๐‘›,

Periodicity Property of Fourier transform โ„Ž ๐‘™ = โ„Ž ๐‘™ + ๐‘›๐‘‚ .

๐‘‚ ๐‘™ ๐‘™ + ๐‘‚ ๐‘™ โˆ’ ๐‘‚

etc

slide-24
SLIDE 24

For any positive or negative integer ๐‘›, Proof: Use this:

Periodicity Property of Fourier transform โ„Ž ๐‘™ = โ„Ž ๐‘™ + ๐‘›๐‘‚ .

๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ (๐‘™+๐‘›๐‘‚) ๐‘ฆ

= ๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™๐‘ฆ ๐‘“ โˆ’๐‘— 2 ๐œŒ ๐‘‚ ๐‘›๐‘‚๐‘ฆ

1

slide-25
SLIDE 25

๐‘ฆ=0 ๐‘‚โˆ’1

๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™ ๐‘ฆ

๐ฝ ๐‘ฆ ๐ฝ ๐‘™ = The Fourier transform is well defined for any ๐‘™ (not just in 0, โ€ฆ, ๐‘‚ โˆ’ 1. )

slide-26
SLIDE 26

๐‘ฆ =โˆ’๐‘‚ 2 ๐‘‚ 2โˆ’1

๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™ ๐‘ฆ

๐‘” ๐‘ฆ ๐‘” ๐‘™ = The Fourier transform is well defined for any range of ๐‘‚ consecutive values of ๐‘ฆ. e.g. Essentially we are treating ๐‘”(๐‘ฆ) as periodic. ๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ (๐‘ฆ+๐‘›๐‘‚) ๐‘™

= ๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™๐‘ฆ ๐‘“ โˆ’๐‘— 2 ๐œŒ ๐‘‚ ๐‘™๐‘›๐‘‚

1

slide-27
SLIDE 27

Example 1 = ?

slide-28
SLIDE 28

Example 1

slide-29
SLIDE 29

Examples 2:

Local Difference:

๐ฝ ๐‘ฆ โˆ— ๐ธ(๐‘ฆ) โ‰ก 1 2 ๐ฝ ๐‘ฆ + 1 โˆ’ 1 2 ๐ฝ ๐‘ฆ โˆ’ 1

โˆ’ 1 2 , ๐‘ฆ = 1

๐ธ ๐‘ฆ โ‰ก

1 2 ,

0,

  • therwise

๐‘ฆ = โˆ’1

slide-30
SLIDE 30

โˆ’ 1 2 , ๐‘ฆ = 1

๐ธ ๐‘ฆ โ‰ก

1 2 ,

0,

  • therwise

๐‘ฆ = โˆ’1

๐‘ฆ=0 ๐‘‚โˆ’1

๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™ ๐‘ฆ

๐ธ ๐‘ฆ ๐ธ ๐‘™ = = ?

(Done on blackboard. See lecture notes)

slide-31
SLIDE 31
slide-32
SLIDE 32

Example 3:

Local Average:

๐ฝ ๐‘ฆ โˆ— ๐ถ ๐‘ฆ โ‰ก 1 4 ๐ฝ ๐‘ฆ + 1 + 1 2 ๐ฝ ๐‘ฆ + 1 4 ๐ฝ ๐‘ฆ โˆ’ 1

1 4 , ๐‘ฆ = โˆ’1, 1

๐ถ ๐‘ฆ โ‰ก

1 2 ,

0,

  • therwise

๐‘ฆ = 0

slide-33
SLIDE 33

1 4 , ๐‘ฆ = โˆ’1, 1

๐ถ ๐‘ฆ โ‰ก

1 2 ,

0,

  • therwise

๐‘ฆ = 0

๐‘ฆ=0 ๐‘‚โˆ’1

๐‘“ โˆ’๐‘— 2 ๐œŒ

๐‘‚ ๐‘™ ๐‘ฆ

๐ถ ๐‘ฆ ๐ถ ๐‘™ = = ?

(Sketched on blackboard. See lecture notes)

slide-34
SLIDE 34

Stopped here

(will finish next class)

slide-35
SLIDE 35

Example 4:

๐‘“ ๐‘— 2 ๐œŒ

๐‘‚ ๐‘™0 ๐‘ฆ =

๐‘‚ ๐œ€ (๐‘™ โˆ’ ๐‘™0)

๐†

๐‘‚ ๐‘™0 ๐‘‚ 2 โ„Ž ๐‘™ (Done on blackboard. See lecture notes.)

slide-36
SLIDE 36

Example 5 & 6: cosine and sine

cos 2๐œŒ ๐‘‚ ๐‘™0๐‘ฆ = ?

๐†

sin 2๐œŒ ๐‘‚ ๐‘™0๐‘ฆ = ?

๐†

slide-37
SLIDE 37

Example 5 & 6: cosine and sine

cos 2๐œŒ ๐‘‚ ๐‘™0๐‘ฆ = ๐‘‚ 2 ๐œ€ ๐‘™ โˆ’ ๐‘™0 + ๐œ€(๐‘™ + ๐‘™0 )

๐†

sin 2๐œŒ ๐‘‚ ๐‘™0๐‘ฆ = ๐‘‚ 2๐‘— ๐œ€ ๐‘™ โˆ’ ๐‘™0 โˆ’ ๐œ€(๐‘™ + ๐‘™0 )

๐†

Use Eulerโ€™s formula and Example 4. Also, recall the conjugacy property.

slide-38
SLIDE 38

38

๐ป ๐‘ฆ, ๐œ = 1 2๐œŒ ๐œ ๐‘“โˆ’ 1

2 ๐‘ฆ ๐œ

2

Example 7: Gaussian What is its Fourier transform?

slide-39
SLIDE 39

39

๐ป ๐‘ฆ, ๐œ = 1 2๐œŒ ๐œ ๐‘“โˆ’ 1

2 ๐‘ฆ ๐œ

2

with equality in the limit as distance between samples goes to 0 and N goes to infinity, i.e. continuous Fourier transform.

Note the inverse relationship

๐‘ฎ ๐ป ๐‘ฆ, ๐œ โ‰ˆ ๐‘“โˆ’1

2 2 ๐œŒ ๐œ ๐‘™ ๐‘‚

2

Example 7: Gaussian

slide-40
SLIDE 40

40

slide-41
SLIDE 41

Example 8: cosine Gabor

41

cos 2๐œŒ ๐‘‚ ๐‘™0๐‘ฆ = ๐‘‚ 2 ๐œ€ ๐‘™ โˆ’ ๐‘™0 + ๐œ€(๐‘™ + ๐‘™0 )

๐† ๐† ๐ป ๐‘ฆ, ๐œ โ‰ˆ ๐‘“โˆ’1

2 2 ๐œŒ ๐œ ๐‘™ ๐‘‚

2

๐† ๐‘‘๐‘๐‘ก๐ป๐‘๐‘๐‘๐‘  ๐‘ฆ, ๐œ = ๐† { cos

2๐œŒ ๐‘‚ ๐‘™0๐‘ฆ ๐ป ๐‘ฆ, ๐œ }

= ?

slide-42
SLIDE 42

Convolution Theorem (version 2)

๐‘ฎ ๐ฝ ๐‘ฆ โ„Ž ๐‘ฆ =

1 ๐‘‚ ๐‘ฎ ๐ฝ ๐‘ฆ โˆ— ๐‘ฎ โ„Ž ๐‘ฆ

42

Proof: see Appendix in lecture notes

slide-43
SLIDE 43

Example 8: cosine Gabor

43

cos 2๐œŒ ๐‘‚ ๐‘™0๐‘ฆ = ๐‘‚ 2 ๐œ€ ๐‘™ โˆ’ ๐‘™0 + ๐œ€(๐‘™ + ๐‘™0 )

๐† ๐† ๐ป ๐‘ฆ, ๐œ โ‰ˆ ๐‘“

โˆ’1 2 2 ๐œŒ ๐œ ๐‘™ ๐‘‚

2

๐† ๐‘‘๐‘๐‘ก๐ป๐‘๐‘๐‘๐‘  ๐‘ฆ, ๐œ โ‰ˆ ๐‘‚ 2 ( ๐‘“

โˆ’1 2 2 ๐œŒ ๐œ (๐‘™โˆ’ ๐‘™0) ๐‘‚

2

+ ๐‘“

โˆ’1 2 2 ๐œŒ ๐œ (๐‘™+ ๐‘™0) ๐‘‚

2

) See lecture notes for proof, and formula for sine Gabor.

slide-44
SLIDE 44

Example: cosine Gabor

[ADDED: April 12]

N = 128, k0 = 20, sigma = 5