Professional Documents
Culture Documents
February 1, 2014
f ( x)
x
(ECE @ McMaster) Bicubic Interpolation February 1, 2014 2 / 26
Interpolation
Definition
Interpolation is a method of constructing new data points within the
range of a discrete set of known data points.
f ( x)
x
(ECE @ McMaster) Bicubic Interpolation February 1, 2014 2 / 26
Nearest-neighbour Interpolation
f ( x)
f ( x)
f ( x)
f ( x)
f ( 1)
f ( 0)
−1 1 2 x
Normalization
f ( x)
f ( 1)
f ( 0)
−1 1 2 x
Normalization
Model: f (x) = a1 x1 + a0 x0
f ( x)
f ( 1)
f ( 0)
−1 1 2 x
Normalization
Model: f (x) = a1 x1 + a0 x0
Solve: a0 , a1
f (0) = a1 · 0 + a0 · 1
f (1) = a1 · 1 + a0 · 1
(ECE @ McMaster) Bicubic Interpolation February 1, 2014 5 / 26
Linear Interpolation
f (0) = a1 · 0 + a0 · 1
f (1) = a1 · 1 + a0 · 1
T 0 1 T
Let y = f (0) f (1) , B = and a = a1 a0
1 1
Then the equations can be written as y = Ba
Thus f (x) = ba = bB−1 y, where b = x1 x0
Example:
0 1 −1
1 0
f (0.5)= 0.5 0.5 y
1 1
−1 1
= 0.5 1 y
1 0
= 0.5 0.5 y
= 21 f (0) + 12 f (1)
Piecewise-cubic function
f ( x)
Piecewise-cubic function
f ( x)
Piecewise-cubic function
f ( x)
Piecewise-cubic function
f ( x)
f ( 2)
f ( 1)
f ( 0)
f (−1 )
3
X
Model: f (x) = ai xi = a3 x3 + a2 x2 + a1 x1 + a0
i=0
3 2 1 0
f (−1) = a 3 (−1) +a2 · (−1) +a1 · (−1) +a0 · (−1)
·
f (0) = a3 · 03 +a2 · 02 +a1 · 01 +a0 · 00
f (1) = a3 · 1 3 +a2 · 12 +a1 · 11 +a0 · 10
f (2) = a3 · 23 +a2 · 22 +a1 · 21 +a0 · 20
Example:
−0.167 0.5 −0.5 0.167
0.5 −1 0.5 0
f (0.5)= 0.5 0.52 0.51 0.50
3
y
−0.333 −0.5 1 −0.167
0 1 0 0
= −0.0625 0.5625 0.5625 −0.0625 y
1
= 16 −1 9 9 −1 y
Piecewise-cubic function
f ( x)
Piecewise-cubic function
f ( x)
Piecewise-cubic function
f ( x)
Piecewise-cubic function
f ( x)
Model:
3
X
f (x) = ai xi = a3 x3 + a2 x2 + a1 x1 + a0
i=0
X3
f 0 (x) = iai xi−1 = 3a3 x2 + 2a2 x1 + a1
i=1
Example:
f (1,1)
f (0,1)
f (1,0)
f (0,0)
f (1,1)
f (0,1)
f (1,0)
f (0,0)
f (1,1)
1
f ( , 1)
2
f (0,1)
f (1,0)
1
f ( , 0)
f (0,0) 2
f (1,1)
1
f ( , 1)
2
f (0,1) 1 1
f( , )
2 2
f (1,0)
1
f ( , 0)
f (0,0) 2
f (0,1)
f (1,0)
f (0,0)
1 X
X 1
Model: f (x, y) = aij xi y i = a11 xy + a10 x + a01 y + a00
i=0 i=0
f (0, 0) = a11 · 0 +a10 · 0 +a01 · 0 +a00 · 1
f (0, 1) = a11 · 0 +a10 · 0 +a01 · 1 +a00 · 1
f (1, 0) = a11 · 0 +a10 · 1 +a01 · 0 +a00 · 1
f (1, 1) = a11 · 1 +a10 · 1 +a01 · 1 +a00 · 1
F = BAB T V A = B −1 F (B T )−1 = B −1 F (B −1 )T
−1 1 −1 1 −1/6 1/2 −1/2 1/6
0 0 0 1 −1
1/2 −1 1/2 0
B=
1 1 1 1 ; B = −1/3 −1/2
1 −1/6
8 4 2 1 0 1 0 0
1 1 T
f ( , ) = 18 1 1
B −1 F (B −1 )T
1 1 1
4 2 1 x 8 4 2 1 y
2 2
f (−1, −1) f (−1, 0) f (−1, 1) f (−1, 2) −1 16
9
−1 f (0, −1) f (0, 0) f (0, 1) f (0, 2) 16
= [ −1 9 9
16 ] f (1, −1)
16 16 16 9
f (1, 0) f (1, 1) f (1, 2)
16
−1
f (2, −1) f (2, 0) f (2, 1) f (2, 2) 16
f (1,1)
f (0,1)
f (1,0)
f (0,0)
f (1,1)
1
f ( , 1)
2
f (0,1)
f (1,0)
1
f ( , 0)
f (0,0) 2
Interpolate
f ( 12 , 0) using f (0, 0), f (1, 0), ∂x f (0, 0) and ∂x f (1, 0)
f ( 12 , 1) using f (0, 1), f (1, 1), ∂x f (0, 1) and ∂x f (1, 1)
∂y f ( 21 , 0) using ∂y f (0, 0), ∂y f (1, 0), ∂xy f (0, 0) and ∂xy f (1, 0)
∂y f ( 21 , 1) using ∂y f (0, 1), ∂y f (1, 1), ∂xy f (0, 1) and ∂xy f (1, 1)
f (1,1)
1
f ( , 1)
2 1 1
f( , )
f (0,1) 2 2
f (1,0)
1
f ( , 0)
f (0,0) 2
Interpolate
f ( 12 , 0) using f (0, 0), f (1, 0), ∂x f (0, 0) and ∂x f (1, 0)
f ( 12 , 1) using f (0, 1), f (1, 1), ∂x f (0, 1) and ∂x f (1, 1)
∂y f ( 21 , 0) using ∂y f (0, 0), ∂y f (1, 0), ∂xy f (0, 0) and ∂xy f (1, 0)
∂y f ( 21 , 1) using ∂y f (0, 1), ∂y f (1, 1), ∂xy f (0, 1) and ∂xy f (1, 1)
Interpolate f ( 12 , 12 ) using f ( 12 , 0), f ( 12 , 1), ∂y f ( 12 , 0) and ∂y f ( 12 , 1)
Model:
3 X
X 3
f (x, y) = aij xi y j
i=0 j=0
X 3 X 3
∂x f (x, y) = iaij xi−1 y j
i=1 j=0
3 X
X 3
∂y f (x, y) = jaij xi y j−1
i=0 j=1
X3 X 3
∂xy f (x, y) = ijaij xi−1 y j−1
i=1 j=1
Approximation:
∂x f (x, y) = [f (x + 1, y) − f (x − 1, y)]/2
∂y f (x, y) = [f (x, y + 1) − f (x, y − 1)]/2
∂xy f (x, y) = [f (x+1, y +1)−f (x−1, y)−f (x, y −1)+f (x, y)]/4
1 1
Linear: fl (0.5) = f (0) + f (1)
2 2
1 9 9 1
Cubic: fc (0.5) = − (−1) + f (0) + f (1) − f (2)
16 16 16 16
The absolute difference between the results of linear and cubic
interpolations
|fc (0.5) − fl (0.5)|
1 1 1 1
= − f (−1) + f (0) + f (1) − f (2)
16 16 16 16
| − 0 + 1 + 1 − 0|
≤
16
= 0.125
f ( x)
f ( x)
f ( x)
f ( x)
f ( x)
f ( x)