You are on page 1of 4

COMP 308-558B: Assignment 1 Solutions

Question I: (8 marks)
Solution images courtesy of Jonathan Taylor.
(a) [3 marks] Consider a linear, time-invariant (LTI) system whose response to the signal x1 (t) is
y1 (t) illustrated in Figure 1(a) and (b). For the signals in Figure 1 (c), (d) and (e), determine
and sketch carefully the response of the system, if possible. If it is impossible to determine
the system response for a particular signal, provide an explanation.
Solution: We attempt to express the signals in Figures 1 (c), (d) and (e) as a sum of scaled
and shifted signals in Figure 1(a). This is possible for Figures 1 (c) and (e). The output
is obtained by summing the scaled and shifted response in Figure 1(b). The responses are
provided in Figure 2. The signal in Figure 1 (d) cannot be represented as a sum of scaled
and shifted signals in Figure 1 (a).

(a)

(b)

(d)

(e)

(c)

Figure 1: Signals for Question 1(a)

(c)

(e)

Figure 2: Responses for Figures 1(c) and (e)

(b) [3 marks] Sketch the function that results from convolving each pair of the following functions.
Label the significant time and intensity values.
Solution: Refer to Figure 3.

Figure 3: Question 1(b): For each column, convolution of the signal in the first row with that in
the second row produces one in the third row. is a very small number.

(c) [2 marks] Recall the impulse function (t) defined axiomatically in class as a function that
satisfies the following conditions:
1. (t t0 ) = 0, t 6= t0
Rt
2. t12 (t t0 )dt = 1, t1 < t0 < t2
R
3. f (t)(t t0 )dt = f (t0 ), f (t) continuous at t0 .
Derive the Fourier transform of (t). Given this answer, how would one represent (t) as a
sum of cosines?
Solution: The Fourier transform of (t) is:

(k)
=

(t)ei2kt dt
(t t0 )ei2k(tt0 ) dt

= ei2k(t0 t0 )
= e0
= 1,
where property 3 was used. Taking the inverse Fourier transform,
2

(t) =
Z

i2kt

(k)e
dk

ei2kt dk

(cos(kt) + i sin(kt))dk

=
=

lim

k0

lim

k0

(cos(kt) + i sin(kt))k

n=

cos(kt)k,

n=

as the complex terms must cancel out. Therefore, (t) can be represented as a sum of cosines of all
frequencies. For intuitions as to why this is true, note that at x = 0, all the cosines have value 1,
while at other locations some of the cosines have positive values, while others have negative, and
these cancel out.
Question II: (5 marks)
Consider the image for Question II located at www.cim.mcgill.ca/~sveta/558.
(a) [4 marks] Convolve this image with the function
H(x, y) =

1
x2 + y 2 x2 +y2 2
[1
]e 2
2 2
2 3

for a fixed value of . How would you describe the effect of this convolution on the image?
What is a value of for which you observed that this effect is pronounced? How does the
choice of affect the output?
Solution: As seen in class, H is the Laplacian of a Gaussian with standard deviation .
These filters are used in edge detection, as the zero-crossings of an image convolved with H
correspond to edges (areas of intensity change). Therefore, you should see light and dark
bands along edges in images convolved with H. The value of giving a valid response
is subjective and relies on your implementation of H. Note that H is, like the Gaussian
function, non-zero in a small neighbourhood around (0, 0) only. Thus, you need not consider
large values of x and y. However, you do need to consider both negative and positive values.
As increases, the edges highlighted are those that correspond to larger scale features.
(b) [1 mark] Now repeat this procedure but this time use Fourier transforms instead of spatial
convolution. Compare these results to those obtained in part (a) and comment.
Solution: Here you are asked to apply the convolution theorem:
I J = F 1 (F(I) F(J))
by performing operations on the left side of this equation. You could observe a loss of fine
detail attributed to the use of a discrete Fourier transform.

Question III: (7 marks)


For this question you will need the two images of lovebirds provided at www.cim.mcgill.ca/~sveta/558.
Compute the Fourier transforms of the two images. Now compare them in terms of their amplitude
and phase spectra and explain any relationship between the two transforms. Explain why you think
this property holds. How might this property be useful?
Solution:
If image B is a rotation of image A through an angle of , then the spatial coordinates of A
x, y map to spatial coordinates x0 , y 0 of B, where
x0 = cos()x + sin()y
y 0 = sin()x + cos()y.
What is the relationship between the Fourier transform of A FA and that of B FB ?
Let u and v be coordinates in the frequency domain. Then
Z
FA (u, v) =
ei2(ux+vy) f (x, y)dxdy.

We wish to write this equation in terms of x0 and y 0 . Taking the inverse of the rotation matrix,
x = cos()x0 sin()y 0
y = sin()x0 + cos()y 0 .
Changing variables from (x, y) to (x0 , y 0 ),
Z
FA (u, v) =
ei2(ux+vy) f (x, y)dxdy

Z
(x, y) 0 0
0
0
0
0
=
ei2(u(cos()x sin()y )+v(sin()x +cos()y )) f (x0 , y 0 )
dx dy
(x0 , y 0 )

Z
0
0
=
ei2(x (u cos()v sin())+y (u sin()+v cos())) f (x0 , y 0 )dx0 dy 0

= FB (u cos() + v sin(), u sin() + v cos())


Thus, the Fourier transform of B has the same amplitude as that of A, but the frequency
components are rotated by .
A variation on this property has proven useful in the work of fellow McGillers [Jugessur and
Dudek, CVPR00] on planar rotation invariant appearance-based object recognition.

You might also like