Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Prof. A.

Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

LECTURE 2:
M-D SYSTEMS (FILTERS)
• Impulse Response and MD Convolution
– Example: 2D Convolution
– Vector-Matrix Notation (Appendix A)
• MD Frequency Response
– DFT domain, Circular Shift, Circular vs. Linear Convolution
• MD FIR Filters and Symmetry
– Symmetry and Zero-Phase
• MD IIR Filters
– Difference Equations
– Recursive Computability, Stability, Boundary Conditions
Chapter 1 Multi-dimensional Signals and Systems 1
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

Impulse Response
• 2D impulse response is the response of a 2D system L to
a 2D unit impulse input, denoted by
, ,
• MD LSI filters can be completely specified by their
impulse response.
• Example: Point-Spread Function

Chapter 1 Multi-dimensional Signals and Systems 2


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D FIR Filters: 2D Convolution


• The output of a 2D LSI system to an arbitrary input , is
, ,
• Expressing the input as a sum of weighted and shifted 2D impulses
, , ,

• Using linearity, changing the order of operator L and summations,


, , ,

• Now using the shift-invariance of L


, , ,

Chapter 1 Multi-dimensional Signals and Systems 3


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D Convolution (cont’d)
• By a change of variables, is equivalent to
, , ,

• 2D convolution is commutative
, **s , , ∗∗ ,
• 2D convolution is associative (series or cascade connection)
, ∗∗ , **s , , ∗∗ , )**s ,
• 2D convolution is distributive over addition (parallel connection)
, , **s ,
, ∗∗s , , **s ,
Chapter 1 Multi-dimensional Signals and Systems 4
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D Convolution: Example
  k2 k2

k1 k1

h(k1,k2) f(k1,k2)

k2 k2

(n1,n2)

k1 k1
h(‐k1,‐k2)
h(n1‐k1,n2‐k2)

Chapter 1 Multi-dimensional Signals and Systems 5


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D Separable Filters
• A filter is called separable if its impulse response is separable
,
• They can be implemented as a cascade of two 1D convolutions.
, , ,

∗ ∗ ,
Chapter 1 Multi-dimensional Signals and Systems 6
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D Separable Filters (cont’d)

• Easier to design
• Faster to implement

Number of multiplications/pixel
Filter size 7×7 9×9 11×11

General 49 81 121

Separable 14 18 22

Chapter 1 Multi-dimensional Signals and Systems 7


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D FIR Filters: Vector-Matrix Form


• 1D convolution ∑
• The input is samples, impulse response is samples, hence
the output is 1 samples.
0 ⋯ 0 ⋯
0 0
1 0 ⋯ 0 ⋯
1 1
⋮ ⋮ ⋮ ⋮
⋮ ⋮
0 ⋯ 0 ⋯ 0 ⋯ 0 ⋯ 0 2
2
1 ⋮ ⋮ ⋮ 1
⋯ 0 ⋯ 0

• The output samples to 1 and to 2 are


truncated, so that the input and output vectors are the same length.
• The matrix is Toeplitz.
Chapter 1 Multi-dimensional Signals and Systems 8
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

Vector-Matrix Form (cont’d)


• 2D convolution can be expressed as
⋯ ⋯
⋯ ⋯
⋮ ⋮ ⋮
⋮ ⋯ ⋯ ⋯ ⋯ ⋮
⋮ ⋮ ⋮
⋯ ⋯


where and are vectors obtained by concatenating lines (rows) of
the output and input images, respectively, and is a block matrix.
• The matrix is doubly Toeplitz, that is, is block-Toeplitz and
each block matrix is Toeplitz.
Chapter 1 Multi-dimensional Signals and Systems 9
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

Vector-Matrix Form: Example


• 3×3 convolution with a 5×5 input image Input vector
Line 1

Line 2

Line 3

Output vector
(boundary samples Line 4
truncated)
Line 5

Chapter 1 Multi-dimensional Signals and Systems 10


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D DFT: Vector-Matrix Form


• 2D DFT: , ∑ ∑ ,
where
, , , 0, … , 1

is the 1D DFT of the th column of the image.


• The 1D DFT of the th column in vector-matrix form

,0 ,0
,1 ,1
,2 , ,2 , 0, … , 1
⋮ ⋮
, 1 , 1
Chapter 1 Multi-dimensional Signals and Systems 11
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D DFT: Vector-Matrix Form (cont’d)


1 1 1 1 ⋯ 1

1 ⋯
1 ⋯
1 ⋯
⋮ ⋮ ⋮
1 ⋯

and
• The transpose of all transformed column vectors
can be written as an matrix

⋮ ⋮

Chapter 1 Multi-dimensional Signals and Systems 12


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D DFT: Vector-Matrix Form (cont’d)


• The 2D Fourier transform of the image matrix
is equal to the 1D Fourier transform of the
transpose of the transformed columns, given by

Chapter 1 Multi-dimensional Signals and Systems 13


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D Frequency Response
• The response of an LSI system to a complex exponential input
,
is given by the convolution summation
, ,

• Taking the terms that do not depend on and out of the sum
, ,

• The frequency response , of the system is defined by


, ,
Chapter 1 Multi-dimensional Signals and Systems 14
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D Frequency Response (cont’d)


• The frequency response is a complex-valued function
, , ,
that can be expressed in polar form in terms of a real,
positive magnitude and a real phase function ,
, , ,

where
, , ,
and
,
, tan
,

Chapter 1 Multi-dimensional Signals and Systems 15


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D Convolution in the Frequency Domain


• Convolution in spatial domain corresponds to
multiplication in the frequency domain
**s

• Hence, the magnitude and phase of the output are

Chapter 1 Multi-dimensional Signals and Systems 16


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

Implementation in the 2D DFT Domain


• Circular convolution yields the same result as linear convolution if
we set the DFT size to at least 1 1 .

1) Pad the filter impulse response , and the image ,


with zeros to obtain 1 1 arrays.
2) Compute 1 1 point DFTs of both
, and , .
3) Multiply 1 1 arrays , and
, .
4) Take 1 1 point IDFT of the product
to find the output.
Chapter 1 Multi-dimensional Signals and Systems 17
Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D FIR Filters: Symmetry and Zero-Phase


• The frequency response , is said to have zero-
phase if it is real, i.e., , , .
• Hence, odd-length, even-symmetric FIR filters have zero-
phase.
• Strictly speaking, the phase , for those
, where , is negative. However, such
filters still have zero group-delay.
• Zero-phase filters do not introduce any phase distortion, since
, ,

Chapter 1 Multi-dimensional Signals and Systems 18


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

Circularly Symmetric Filters

• A more strict form of symmetry is circular symmetry,


which is isotropic.
• A filter is said to have circularly symmetric frequency
response if , is a function of
for and is constant outside this region
within    ,   .
• Circular symmetry of , implies circular
symmetry of , , but not vice versa.

Chapter 1 Multi-dimensional Signals and Systems 19


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D IIR Filters: Difference Equations


• Recursive

Chapter 1 Multi-dimensional Signals and Systems 20


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

Difference Equations (cont’d)


• Recursive Computability
– Lexicographic ordering
• Stability

• Boundary Conditions

Chapter 1 Multi-dimensional Signals and Systems 21


Prof. A. Murat Tekalp Digital Video Processing, 2E, Prentice Hall, 2015

2D IIR Filters: Example


• A 2D AR model with NSHP support is a difference
equation driven by white noise
,
1, 1 , 1 1, 1
1, ,
• The first column, the last column and the first line
(row) of the output must be known in order
to compute the rest of the output samples recursively.
• As a rule of thumb, the filter is generally stable if
1

Chapter 1 Multi-dimensional Signals and Systems 22

You might also like