+ All Categories
Home > Documents > Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

Date post: 19-Dec-2015
Category:
Upload: -
View: 259 times
Download: 30 times
Share this document with a friend
Description:
Digital Image Processing for students
Popular Tags:
48
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Circulant Matrices and Convolution) Digital Image Processing Christophoros Nikou [email protected]
Transcript
Page 1: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

University of Ioannina - Department of Computer Science

Filtering in the Frequency Domain (Circulant Matrices and Convolution)

Digital Image Processing

Christophoros [email protected]

Page 2: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

2

C. Nikou – Digital Image Processing (E12)

Toeplitz matrices

• Elements with constant value along the main diagonal and sub-diagonals.

• For a NxN matrix, its elements are determined by a (2N-1)-length sequence { }( 1) 1|n N n Nt − − ≤ ≤ −

1

( 1)0 1 2

1 0 1

2 2

1

2 1 0N

N

N N

t t t tt t tt t

tt t t t

− −− −

×

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

T

( , ) m nm n t −=T

Page 3: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

3

C. Nikou – Digital Image Processing (E12)

Toeplitz matrices (cont.)

• Each row (column) is generated by a shift of the previous row (column).− The last element disappears.− A new element appears.

1

( 1)0 1 2

1 0 1

2 2

1

2 1 0N

N

N N

t t t tt t tt t

tt t t t

− −− −

×

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

T

( , ) m nm n t −=T

Page 4: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

4

C. Nikou – Digital Image Processing (E12)

Circulant matrices

• Elements with constant value along the main diagonal and sub-diagonals.

• For a NxN matrix, its elements are determined by a N-length sequence { }0 1|n n Nc ≤ ≤ −

1

1

2

1

0 1 2

0 1

2

1

1 2 0

N

N

N

N N N

c c c cc c cc c

cc c c c

− ×

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

C

( )mod( , ) m n Nm n c −=C

Page 5: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

5

C. Nikou – Digital Image Processing (E12)

Circulant matrices (cont.)

• Special case of a Toeplitz matrix.• Each row (column) is generated by a circular shift

(modulo N) of the previous row (column).

1

1

2

1

0 1 2

0 1

2

1

1 2 0

N

N

N

N N N

c c c cc c cc c

cc c c c

− ×

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

C

( )mod( , ) m n Nm n c −=C

Page 6: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

6

C. Nikou – Digital Image Processing (E12)

Convolution by matrix-vector operations

• 1-D linear convolution between two discrete signals may be expressed as the product of a Toeplitz matrix constructed by the elements of one of the signals and a vector constructed by the elements of the other signal.

• 1-D circular convolution between two discrete signals may be expressed as the product of a circulant matrix constructed by the elements of one of the signals and a vector constructed by the elements of the other signal.

• Extension to 2D signals.

Page 7: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

7

C. Nikou – Digital Image Processing (E12)

1D linear convolution using Toeplitz matrices

• The linear convolution g[n]=f [n]*h [n] will be of length N=N1+N2-1=3+2-1=4.

• We create a Toeplitz matrix H from the elements of h [n] (zero-padded if needed) with− N=4 lines (the length of the result).− N1=3 columns (the length of f [n]).− The two signals may be interchanged.

1 2[ ] {1, 2, 2}, [ ] {1, 1}, 3, 2f n h n N N= = − = =

Page 8: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

8

C. Nikou – Digital Image Processing (E12)

1D linear convolution using Toeplitz matrices (cont.)

1 2[ ] {1, 2, 2}, [ ] {1, 1}, 3, 2f n h n N N= = − = =

4 3

1 0 01 1 00 1 10 0 1

×

⎡ ⎤⎢ ⎥−⎢ ⎥=⎢ ⎥−⎢ ⎥−⎣ ⎦

H

Length of f [n] = 3

Length of the result =4

Notice that H is not circulant (e.g. a -1 appears in the second line which is not present in the first line.

Zero-padded h[n] in the first column

Page 9: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

9

C. Nikou – Digital Image Processing (E12)

1D linear convolution using Toeplitz matrices (cont.)

1 2[ ] {1, 2, 2}, [ ] {1, 1}, 3, 2f n h n N N= = − = =

1 0 0 11

1 1 0 12

0 1 1 02

0 0 1 2

⎡ ⎤ ⎡ ⎤⎡ ⎤⎢ ⎥ ⎢ ⎥− ⎢ ⎥⎢ ⎥ ⎢ ⎥= =⎢ ⎥⎢ ⎥ ⎢ ⎥−⎢ ⎥⎢ ⎥ ⎢ ⎥⎣ ⎦− −⎣ ⎦ ⎣ ⎦

g = Hf

[ ] {1, 1, 0, 2}g n = −

Page 10: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

10

C. Nikou – Digital Image Processing (E12)

1D circular convolution using circulant matrices

• The circular convolution g[n]=f [n] h [n] will be of length N=max{N1, N2}=3.

• We create a circulant matrix H from the elements of h [n] (zero-padded if needed) of size NxN.− The two signals may be interchanged.

1 2[ ] {1, 2, 2}, [ ] {1, 1}, 3, 2f n h n N N= = − = =

Page 11: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

11

C. Nikou – Digital Image Processing (E12)

1D circular convolution using circulant matrices (cont.)

1 2[ ] {1, 2, 2}, [ ] {1, 1}, 3, 2f n h n N N= = − = =

3 3

1 0 11 1 00 1 1

×

−⎡ ⎤⎢ ⎥= −⎢ ⎥⎢ ⎥−⎣ ⎦

H

Zero-padded h[n] in the first column

Page 12: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

12

C. Nikou – Digital Image Processing (E12)

1D circular convolution using circulant matrices (cont.)

1 2[ ] {1, 2, 2}, [ ] {1, 1}, 3, 2f n h n N N= = − = =

1 0 1 1 11 1 0 2 10 1 1 2 0

− −⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎢ ⎥ ⎢ ⎥ ⎢ ⎥= − =⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥−⎣ ⎦ ⎣ ⎦ ⎣ ⎦

g = Hf

[ ] { 1, 1, 0}g n == −

Page 13: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

13

C. Nikou – Digital Image Processing (E12)

Block matrices

• Aij are matrices.

• If the structure of A, with respect to its sub-matrices, is Toeplitz (circulant) then matrix A is called block-Toeplitz(block-circulant).

• If each individual Aij is also a Toeplitz (circulant) matrix then A is called doubly block-Toeplitz (doubly block-circulant).

11 12 1

21 22 2

1 2

N

N

M M MN

A A AA A A

A

A A A

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

……

Page 14: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

14

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices

m

n

1 4 12 5 3f [m,n]

m

n

1 11 -1h [m,n]

M1=2, N1=3 M2=2, N2=2

The result will be of size (M1+M2-1) x (N1+N2-1) = 3 x 4

Page 15: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

15

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• At first, h[m,n] is zero-padded to 3 x 4 (the size of the result).

• Then, for each row of h[m,n], a Toeplitz matrix with 3 columns (the number of columns of f [m,n]) is constructed.

m

n

1 1 01 -1 0

h[m,n]

00

0 0 0 0

m

n

1 4 12 5 3f [m,n]

m

n

1 11 -1h [m,n]

Page 16: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

16

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• For each row of h[m,n], a Toeplitz matrix with 3 columns (the number of columns of f [m,n]) is constructed.

m

n

1 1 01 -1 0

h[m,n]

00

0 0 0 0

1

1 0 01 1 00 1 10 0 1

⎡ ⎤⎢ ⎥−⎢ ⎥=⎢ ⎥−⎢ ⎥−⎣ ⎦

H 2

1 0 01 1 00 1 10 0 1

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

H 3

0 0 00 0 00 0 00 0 0

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

H

Page 17: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

17

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• Using matrices H1, H2and H3 as elements, a doubly block Toeplitzmatrix H is then constructed with 2 columns (the number of rows of f [m,n]).

m

n

1 4 12 5 3f [m,n]

m

n

1 11 -1h [m,n]

1 3

2 1

3 2 12 6×

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

H HH H H

H H

Page 18: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

18

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• We now construct a vector from the elements of f [m,n].

m

n

1 4 12 5 3f [m,n]

m

n

1 11 -1h [m,n]

25

(2 5 3)3(1 4 1)1

41

T

T

⎡ ⎤⎢ ⎥⎢ ⎥

⎡ ⎤⎢ ⎥= = ⎢ ⎥⎢ ⎥

⎢ ⎥⎢ ⎥ ⎣ ⎦⎢ ⎥⎢ ⎥⎣ ⎦

f

Page 19: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

19

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

m

n

1 4 12 5 3f [m,n]

m

n

1 11 -1h [m,n]

1 3

2 1

3 2

253141

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

H Hg = Hf H H

H H

Page 20: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

20

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

1 0 0 0 0 0 21 1 0 0 0 0 30 1 1 0 0 0 20 0 1 0 0 0 2 31 0 0 1 0 0 5 3

(1 1 0 1 1 0 3 100 1 1 0 1 1 1 50 0 1 0 0 1 4 20 0 0 1 0 0 1 10 0 0 1 1 0 50 0 0 0 1 1 50 0 0 0 0 1 1

⎡ ⎤ ⎡ ⎤⎢ ⎥ ⎢ ⎥−⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥− −⎢ ⎥ ⎢ ⎥− ⎡ ⎤⎢ ⎥ ⎢ ⎥

⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥−⎢ ⎥ ⎢ ⎥= = =⎢ ⎥⎢ ⎥ ⎢ ⎥− ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥−⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥⎣ ⎦⎢ ⎥ ⎢ ⎥

⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎣ ⎦ ⎣ ⎦

g = Hf2 3 2 3)

(3 10 5 2)(1 5 5 1)

T

T

T

⎡ ⎤−⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

Page 21: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

21

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

*

m

n

1 4 12 5 3f [m,n]

m

n

1 11 -1h [m,n]

=32

m

n

3 10 52 3 -2g [m,n]

1 5 5 1 (2 3 2 3)(3 10 5 2)(1 5 5 1)

T

T

T

⎡ ⎤−⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

g =

Page 22: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

22

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

m

n

3 41 2f [m,n]

m

n1 -1h [m,n]

M1=2, N1=2 M2=1, N2=2

The result will be of size (M1+M2-1) x (N1+N2-1) = 2 x 3

Another example

Page 23: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

23

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• At first, h[m,n] is zero-padded to 2 x 3 (the size of the result).

• Then, for each line of h[m,n], a Toeplitz matrix with 2 columns (the number of columns of f [m,n]) is constructed.

m

n

0 0 01 -1 0

h[m,n]

m

n

3 41 2f [m,n]

m

n1 -1h [m,n]

Page 24: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

24

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• For each row of h[m,n], a Toeplitzmatrix with 2 columns (the number of columns of f [m,n]) is constructed.

m

n

0 0 01 -1 0

h[m,n]

1

1 01 10 1

⎡ ⎤⎢ ⎥= −⎢ ⎥⎢ ⎥−⎣ ⎦

H 2

0 00 00 0

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

H

Page 25: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

25

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• Using matrices H1 and H2 as elements, a doubly block Toeplitzmatrix H is then constructed with 2 columns (the number of rows of f [m,n]).

1 2

2 1 6 4×

⎡ ⎤= ⎢ ⎥⎣ ⎦

H HH

H H

m

n

3 41 2f [m,n]

m

n1 -1h [m,n]

Page 26: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

26

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

• We now construct a vector from the elements of f [m,n].

1(1 2)2(3 4)3

4

T

T

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

f

m

n

3 41 2f [m,n]

m

n1 -1h [m,n]

Page 27: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

27

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

m

n

3 41 2f [m,n]

m

n1 -1h [m,n]

1 2

2 1

1234

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

H Hg = Hf

H H

Page 28: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

28

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

1 0 0 0 11 1 0 0 1 1

(1 1 2)0 1 0 0 2 2(3 1 4)0 0 1 0 3 3

0 0 1 1 4 10 0 0 1 4

T

T

⎡ ⎤ ⎡ ⎤⎢ ⎥ ⎢ ⎥− ⎡ ⎤⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎡ ⎤−⎢ ⎥ ⎢ ⎥− −⎢ ⎥= = = ⎢ ⎥⎢ ⎥ ⎢ ⎥ −⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎣ ⎦⎢ ⎥⎢ ⎥ ⎢ ⎥− ⎣ ⎦⎢ ⎥ ⎢ ⎥

− −⎣ ⎦ ⎣ ⎦

g = Hf

Page 29: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

29

C. Nikou – Digital Image Processing (E12)

2D linear convolution using doubly block Toeplitz matrices (cont.)

*

=m

n

3 1 41 1 -2g [m,n]

m

n

3 41 2f [m,n]

m

n1 -1h [m,n]

(1 1 2)(3 1 4)

T

T

⎡ ⎤−⎢ ⎥−⎢ ⎥⎣ ⎦

g =

Page 30: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

30

C. Nikou – Digital Image Processing (E12)

2D circular convolution using doubly block circulant matrices

where H is a doubly block circulant matrix generated by h [m,n] and f is a vectorized form of f [m,n].

0 1, 0 1,m M n N≤ ≤ − ≤ ≤ −The circular convolution g[m,n]=f [m,n] h [m,n]

may be expressed in matrix-vector form as:

g = Hf

with

Page 31: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

31

C. Nikou – Digital Image Processing (E12)

2D circular convolution using doubly block circulant matrices (cont.)

Each Hj, for j=1,..M, is a circulant matrix with N columns (the number of columns of f [m,n]) generated from the elements of the j-th row of h [m,n].

0 1 2 1

1 0 1 2

2 1 0 3

1 2 3 0

M M

M

M M M

− −

− − −

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

H H H HH H H H

H H H H H

H H H H

……………

Page 32: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

32

C. Nikou – Digital Image Processing (E12)

2D circular convolution using doubly block circulant matrices (cont.)

[ ,0] [ , 1] [ ,1][ ,1] [ ,0] [ ,2]

[ , 1] [ , 2] [ ,0]

j

N N

h j h j N h jh j h j h j

h j N h j N h j ×

−⎡ ⎤⎢ ⎥⎢ ⎥=⎢ ⎥⎢ ⎥− −⎣ ⎦

H

……

Each Hj, for j=1,..M, is a NxN circulant matrix generated from the elements of the j-th row of h [m,n].

Page 33: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

33

C. Nikou – Digital Image Processing (E12)

2D circular convolution using doubly block circulant matrices (cont.)

m

n

1 3 -11 2 1f [m,n]

m

n

1 01 -1h [m,n]

0 1 0

00

0 0 0

0

1 0 11 1 00 1 1

−⎡ ⎤⎢ ⎥= −⎢ ⎥⎢ ⎥−⎣ ⎦

H 1

1 0 00 1 00 0 1

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

H 2

0 0 00 0 00 0 0

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

H

Page 34: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

34

C. Nikou – Digital Image Processing (E12)

2D circular convolution using doubly block circulant matrices (cont.)

m

n

1 3 -11 2 1f [m,n]

m

n

1 01 -1h [m,n]

0 1 0

00

0 0 0

( )( )( )

0 2 1

1 0 2

2 1 0

1 2 1

1 3 1

0 1 0

T

T

T

⎡ ⎤⎡ ⎤ ⎢ ⎥⎢ ⎥ ⎢ ⎥= −⎢ ⎥ ⎢ ⎥⎢ ⎥⎣ ⎦ ⎢ ⎥⎣ ⎦

H H Hg = Hf H H H

H H H

Page 35: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

35

C. Nikou – Digital Image Processing (E12)

2D circular convolution using doubly block circulant matrices (cont.)

1 0 1 0 0 0 1 0 0 1 01 1 1 0 0 0 0 1 0 2 20 1 0 0 0 0 0 0 1 1 11 0 0 1 0 1 0 0 0 1 30 1 0 1 1 1 0 0 0 3 40 0 1 0 1 0 0 0 0 1 30 0 0 0 0 0 1 0 1 0 10 0 0 0 0 0 1 1 1 1 40 0 0 0 0 0 0 1 0 0 2

−⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎢ ⎥ ⎢ ⎥ ⎢ ⎥−⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥− −⎢ ⎥ ⎢ ⎥ ⎢ ⎥−⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥= =−⎢ ⎥ ⎢ ⎥ ⎢ ⎥

− − −⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥−⎢ ⎥ ⎢ ⎥ ⎢ ⎥

−⎢ ⎥ ⎢ ⎥ ⎢⎢ ⎥ ⎢ ⎥ ⎢− −⎣ ⎦ ⎣ ⎦ ⎣ ⎦

g = Hf

⎥⎥

Page 36: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

36

C. Nikou – Digital Image Processing (E12)

2D circular convolution using doubly block circulant matrices (cont.)

m

n

1 01 -1h [m,n]

m

n

3 4 -30 2 -1g [m,n]

1 4 -2

00

0 0 0

=

m

n

1 3 -11 2 1f [m,n]

0 1 0

( )( )( )

0 2 1

3 4 3

1 4 2

T

T

T

⎡ ⎤−⎢ ⎥⎢ ⎥−⎢ ⎥

−⎢ ⎥⎣ ⎦

g =

Page 37: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

37

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices

Theorem: The columns of the inverse DFT matrix are eigenvectors of any circulant matrix. The corresponding eigenvalues are the DFT values of the signal generating the circulant matrix.Proof: Let

2 2 nj j knkN Nw e w e

π π− −

Ν Ν= ⇔ =

be the DFT basis elements of length N with:

0 1, 0 1,k N n N≤ ≤ − ≤ ≤ −

Page 38: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

38

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

We know that the DFT F [k] of a 1D signal f [n]

may be expressed in matrix-vector form:

whereF = Af

[ ] [ ][0], [1],..., [ 1] , [0], [1],..., [ 1]T Tf f f N F F F N− −f = F =

( ) ( ) ( ) ( )( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

0 1 2 10 0 0 0

0 1 2 11 1 1 1

0 1 2 11 1 1 1

N

N N N N

N

N N N N

NN N N NN N N N

w w w w

w w w w

w w w w

−− − − −

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

A

Page 39: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

39

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

The inverse DFT is then expressed by:

where

-1f = A F

( )

( ) ( ) ( ) ( )( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

*0 1 2 10 0 0 0

0 1 2 11 1 1 11 *

0 1 2 11 1 1 1

1 1

TN

N N N N

NT N N N N

NN N N NN N N N

w w w w

w w w wN N

w w w w

−− − − −

⎛ ⎞⎡ ⎤⎜ ⎟⎢ ⎥⎜ ⎟⎢ ⎥⎜ ⎟⎢ ⎥= = ⎜ ⎟⎢ ⎥⎜ ⎟⎢ ⎥⎜ ⎟⎢ ⎥⎜ ⎟⎣ ⎦⎝ ⎠

A A

The theorem implies that any circulant matrix has eigenvectors the columns of A-1.

Page 40: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

40

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

Let H be a NxN circulant matrix generated by the 1D N-length signal h[n], that is:

[ ]mod( , ) ( ) [ ]N Nm n h m n h m n= − −H

Let also αk be the k-th column of the inverse DFT matrix A-1. We will prove that αk, for any k, is an eigenvector of H.The m-th element of the vector Hαk, denoted by is the result of the circular convolution of the signal h[n] with αk.

[ ]k mHα

Page 41: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

41

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

[ ]1

0[ ] [ ]

N

k N kmn

h m n nα−

=

= −∑Hα1

0

1 [ ]N

k nN N

nh m n w

N

−−

=

= −∑

( 1)( )1 [ ]

m Nl m nk m l

N Nl m

h l wN

− −= −− −

=

= ∑( 1)1 [ ]

m Nk m k l

N N Nl m

w h l wN

− −−

=

= ∑

1

( 1) 0

1 [ ] [ ]m

k m k l k lN N N N N

l m N lw h l w h l w

N

−−

= − − =

⎡ ⎤= +⎢ ⎥

⎣ ⎦∑ ∑

We will break it into two parts

Page 42: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

42

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

1 1 1

( 1) 0 1

1 [ ] [ ] [ ]N N

k m k l k l k lN N N N N N N

l m N l l mw h l w h l w h l w

N

− − −−

= − − = = +

⎡ ⎤= + −⎢ ⎥

⎣ ⎦∑ ∑ ∑

Periodic with respect to N.

1 1 1

( 1) 0 1

1 [ ] [ ] [ ]N N N

k m k l k l k lN N N N N N N

l N m N l l m

w h l w h l w h l wN

− − −−

= + − − = = +

⎡ ⎤= + −⎢ ⎥

⎣ ⎦∑ ∑ ∑

1 1 1

1 0 1

1 [ ] [ ] [ ]N N N

k m k l k l k lN N N N N N N

l m l l m

w h l w h l w h l wN

− − −−

= + = = +

⎡ ⎤= + −⎢ ⎥⎣ ⎦∑ ∑ ∑ ⇔

Page 43: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

43

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

[ ]1

0

1 [ ]N

k m k lk N N Nm

lw h l w

N

−−

=

⎡ ⎤= ⎢ ⎥⎣ ⎦∑Hα [ ][ ] k m

H k= α

DFT of h[n] at k.

This holds for any value of m. Therefore:

[ ]k kH k=Hα α

which means that αk, for any k, is an eigenvector of H with corresponding eigenvalue the k-th element of H[k], the DFT of the signal generating H .

Page 44: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

44

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

The above expression may be written in terms of the inverse DFT matrix:

1 1− −=HA A Λ

Based on this diagonalization, we can prove the property between circular convolution and DFT.

{ }=diag [0], [1],..., [ 1]H H H N −Λ

or equivalently: 1−=Λ ΑHA

Page 45: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

45

C. Nikou – Digital Image Processing (E12)

Diagonalization of circulant matrices (cont.)

g = Hf

DFT of g[n]

⇔ -1g = HA Af ⇔ -1Ag = AHA Af ⇔ G = ΛF

DFT of f [n]DFT of h [n]

[0] [0] 0 0 [0][0] 0 [1] 0 [0]

[ 1] 0 0 [ 1] [ 1]

G H FG H F

G N H N F N

⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥⇔⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥− − −⎣ ⎦ ⎣ ⎦ ⎣ ⎦

=

……

Page 46: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

46

C. Nikou – Digital Image Processing (E12)

Diagonalization of doubly block circulant matrices

• These properties may be generalized in 2D.• We need to define the Kronecker product:

11 12 1

21 22 2

1 2

N

N

M M MN MK NL

a a aa a a

a a a×

⎡ ⎤⎢ ⎥⎢ ⎥⊗ =⎢ ⎥⎢ ⎥⎣ ⎦

B B BB B B

A B

B B B

……

,M N K L× ×∈ ∈A B

Page 47: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

47

C. Nikou – Digital Image Processing (E12)

Diagonalization of doubly block circulant matrices (cont.)

• The 2D signal f [m,n], may be vectorized in lexicographic ordering (stacking one column after the other) to a vector:

1MN×∈f

0 1, 0 1,m M n N≤ ≤ − ≤ ≤ −

• The DFT of f [m,n], may be obtained in matrix-vector form:

( )F = ⊗A A f

Page 48: Chapter 04c Frequency Filtering (Circulant Matrices) 1spp

48

C. Nikou – Digital Image Processing (E12)

Diagonalization of doubly block circulant matrices (cont.)

( ) ( ) 1−= ⊗ ⊗Λ A A H A A

Theorem: The columns of the inverse 2D DFT matrix

are eigenvectors of any doubly block circulantmatrix. The corresponding eigenvalues are the 2D DFT values of the 2D signal generating the doubly block circulant matrix:

( ) 1−⊗A A

Doubly block circulantDiagonal, containing the 2D DFT of h[m,n] generating H


Recommended