Project 1 W1 Solutions

1a
f * g  :2 0 -4 0 2 0 4 -6 4 -6 4 0 4 -8 6 -4 6 -8 4

1b
if you flipped h(x)  you get [-1 1 1]
f * h  :2 6 4 -2 -2 0 4 6 2 2 -4 0 4 4 -2 2 2 4 -4

if you did not h(x)  you get [1 1 -1] (-0.5 points)
f * h2 :-2 -2 4 6 2 0 -4 2 2 6 4 0 -4 4 2 2 -2 4 4


2a zero padding
0 0 0 5 0 5 0 5 0 5 0 0
    1 2 2 3 2 3 2 2

2b clamping
0 0 0 5 0 5 0 5 0 5 5 5
    1 2 2 3 2 3 3 4

2c mirroring
5 0 0 5 0 5 0 5 0 5  5 0
    2 2 2 3 2 3 3 3

0 5 0 5 0 5 0 5 0 5 0 5
    2 3 2 3 2 3 2 3

2d re-normalization
 0   5  0 5 0 5  0    5
5/3 5/2 2 3 2 3 5/2 10/3

3a

     |1 1 1 1 1|
     |1 1 1 1 1|
1/25*|1 1 1 1 1|
     |1 1 1 1 1|
     |1 1 1 1 1|


3b
      |1  3   8  3  1|
      |3  9  24  9  3|
1/256*|8 24  64 24  8|
      |3  9  24  9  3|
      |1  3   8  3  1|

3c

    | 1 -1  2 -1  1|
    |-1  1 -2  1 -1|
1/4*| 2 -2  4 -2  2|
    |-1  1 -2  1 -1|
    | 1 -1  2 -1  1|


4       a     b
2.5     8     4
2.75    8     6
3       8     8
3.5     8     8

Remember you need to flip the kernel
you get 0 8 8 8 for part A if you did not (-0.5 point)