\underline{Assignment 2}

2.1 Sub-Pixel Refinement I

f(0) = a · 0^{2} + b · 0 + c  (1)
f(−1) = a · 1 + b · (−1) + c  (2)
f(1) = a · 1 + b · 1 + c  (3)

From (1) we know that c_{0} = c. From (2), we get

c_{−1} = a − b + c_{0}

and from (3)

c_{+1} = a + b + c_{0}.

Rearranging these two latter equations, s.t. on one hand side only a appears, we get

c_{−1} + b − c_{0} = c_{+1} − b − c_{0}
⇔ 2b = c_{+1} − c − −1
⇔ b = \frac{c_{+1} − c_{−1}}{2}

This can now be used to compute a:

c_{+1} = a + b + c_{0}
⇔ a = c_{+1} − b − c_{0}
= c_{+1} − \frac{c_{+1} − c_{−1}}{2} − c_{0}
a = \frac{c_{+1} − 2c_{0} − c_{−1}}{2}
□

2.2 Sub-Pixel Refinement II

Remark: There is a small bug in the given result for the case c_{+1} < c_{−1} where the stated result for the variable b is not correct.

f(−1) = a · | − 1 + b| + c = c_{−1}
f(0) = a · |b| + c = c_{0}
f(1) = a · |1 + b| + c = c_{+1}

We know from the hint that −1 ≤ b ≤ 1. So we have to consider only the cases b < 0 and b ≥ 0:

• b < 0:

−ab + a + c = c_{−1}  (4)
−ab + c = c_{0}  (5)
ab + a + c = c_{+1}  (6)

Now we can substract (4) and (5), resulting in

a = c_{−1} − c_{0}.

Adding up (4) and (5) results in

2a + 2c = c_{+1} + c_{−1}
2(c_{−1} − c_{0}) + 2c = c_{+1} − c_{−1}
2c = c_{+1} + c_{−1} − 2c_{−1} + 2c_{0}
c = \frac{c_{+1} + 2c_{0} − c_{−1}}{2}

Finally, we can calculate b as

b = \frac{c_{+1} − c_{−1}}{2(c_{−1} − c_{0})}.

• b ≥ 0:

−ab + a + c = c_{−1}  (7)
ab + c = c_{0}  (8)
ab + a + c = c_{+1}  (9)

If we substract (8) from (9), we get

a = c_{+1} − c_{0}.

Adding up (7) and (9) gives

2a + 2c = c_{+1} + c_{−1}
2(c_{+1} − c_{0}) + 2c = c_{+1} + c_{−1}
2c = c_{+1} + c_{−1} − 2c_{+1} + 2c_{0}
c = \frac{c_{−1} + 2c_{0} − c_{+1}}{2}

Now we can calculate the (right!) b:

ab + c = c_{0}
b = \frac{c_{0} − c}{a}
= \frac{c_{0} − \frac{c_{−1}+2c_{0}−c_{+1}}{2}}{c_{+1} − c_{0}}
b = \frac{c_{+1} − c_{−1}}{2(c_{+1} − c_{0})}

□