Docsity

Optimization Methods in C++ - Convolution | MA 490, Assignments of Mathematics

Toggle sidebar
bg1
Mathematics of Image Processing
Worksheet #5 - Convolution
Name: Box #:
1. Let fand gbe two signals with Nsamples each. The circular convolution
of fand gis the npoint sample given by:
f∗g(k)=
N−1
r=0
f(k−r)g(r)=
N−1
r=0
f(r)g(k−r) (mod N)
The mod Nmeans that we use clock arithmetic in computing k−r, or that
we assume that fand gare defined for all integers , but are periodic with
period N, i.e., f(k+N)=f(k), g(k+N)=g(k).For example, suppose
that N= 4 and that fand gare defined by vectors [x0,x
1,x
2,x
3] and
[y0,y
1,y
2,y
3]:
f(r)=xrmod 4,g(r)=yrmod N.
Then
f∗g(0) =
3
r=0
f(−r)g(r)=f(0)g(0) + f(−1)g(1) + f(−2)g(2) + f(−3)g(3)
=f(0)g(0) + f(3)g(1) + f(2)g(2) + f(1)g(3)
=x0y0+x3y1+x2y2+x1y3
f∗g(1) = x1y0+x0y1+x3y2+x2y3
f∗g(2) = x2y0+x1y1+x0y2+x3y3
f∗g(3) = x3y0+x2y1+x1y2+x0y3
2. Let N= 8, f(0) = 1
2,f(1) = 1
2f(r) = 0 otherwise. Let gbe defined by
an arbitrary vector [y0,y
1,...,y
7].Find the formulas (for eight samples) for
f∗g.
pf3

Partial preview of the text

Download Optimization Methods in C++ - Convolution | MA 490 and more Assignments Mathematics in PDF only on Docsity!

Mathematics of Image Processing

Worksheet #5 - Convolution

Name: Box #:

  1. Let f and g be two signals with N samples each. The circular convolution of f and g is the n point sample given by:

f ∗ g(k) =

N∑ − 1

r=

f (k − r)g(r) =

N∑ − 1

r=

f (r)g(k − r) (mod N )

The mod N means that we use clock arithmetic in computing k − r, or that we assume that f and g are defined for all integers , but are periodic with period N , i.e., f (k + N ) = f (k), g(k + N ) = g(k). For example, suppose that N =4 and that f and g are defined by vectors [x 0 , x 1 , x 2 , x 3 ] and [y 0 , y 1 , y 2 , y 3 ] : f (r) = xr mod 4, g(r) = yr mod N. Then

f ∗ g(0) =

∑^3 r=

f (−r)g(r) = f (0)g(0) + f (−1)g(1) + f (−2)g(2) + f (−3)g(3)

= f (0)g(0) + f (3)g(1) + f (2)g(2) + f (1)g(3) = x 0 y 0 + x 3 y 1 + x 2 y 2 + x 1 y 3 f ∗ g(1) = x 1 y 0 + x 0 y 1 + x 3 y 2 + x 2 y 3 f ∗ g(2) = x 2 y 0 + x 1 y 1 + x 0 y 2 + x 3 y 3 f ∗ g(3) = x 3 y 0 + x 2 y 1 + x 1 y 2 + x 0 y 3

  1. Let N =8, f (0) = 12 , f (1) = 12 f (r) =0 otherwise. Let g be defined by an arbitrary vector [y 0 , y 1 ,... , y 7 ]. Find the formulas (for eight samples) for f ∗ g.
  1. Find a matrix Hf such that

   

f ∗ g(0) f ∗ g(1) .. . f ∗ g(7)

   

= Hf Y = Hf

   

y 0 y 1 .. . y 7

   

  1. Now let N =8, f (7) = x 7 , f (0) = x 0 , f (1) = x 1 , f (r) =0 otherwise. Now write out the matrix for Hf.
  2. Based on the examples in 3 and 4 write out the matrix for Hf for a general f.