11.0 KB · commit a9602da
The cubic spline formulae derived in the preceding section are global in nature, which means that they do not permit any local changes in the given data. Hence, efforts were made to derive spline formulae which are 'nonglobal'. We require basis functions which allow the degree of the resulting curve to be changed without any change in the data. The B-splines are such basis functions which have important applications in computer graphics. The B-splines can be of any degree but those of second or third degree are usually found to be sufficient.
The theory of B-splines was first suggested by Schoenberg [1946], but recurrence formulae for their computation were discovered independently by Cox [1972] and de Boor [1972].
A B-spline of order n (or degree n−1), denoted by sn,i(x), is a spline of degree (n−1) with knots ki−n,ki−n+1,…,ki, which is zero everywhere except in the interval ki−n<x<ki. The cubic B-spline s4,i(x) with knots ki−4,ki−3,ki−2,ki−1,ki, is such that (i) on each interval, s4,i(x) is a polynomial in x of degree 3 or less, (ii) s4,i(x), s4,i′(x) and s4,i′′(x) are continuous, and (iii) s4,i(x)>0 inside [ki−4,ki] and is identically zero outside [ki−4,ki].
A typical cubic B-spline with knots ki−4,ki−3,ki−2,ki−1,ki, is shown in Fig. 5.1.
Figure 5.1 — A typical cubic B-spline.
To represent the cubic B-spline s4,i(x) at x=ki, we consider the five knots ki−4,ki−3,ki−2,ki−1,ki which are such that ki−4<ki−3<ki−2<ki−1<ki(5.56)
We also define the function P+3={P3,0,when P≥0when P≤0(5.57)
Then, a unique representation of the cubic B-spline with knots ki−4,…,ki, is given by Greville [1968]: s4,i(x)=r=0∑3αrxr+m=i−4∑iβm(x−km)+3(5.58)
Another representation based on the concept of divided differences is given below.
\begin{aligned} s_{4, i}(x) &= [k_{i-4}, k_{i-3}, k_{i-2}, k_{i-1}, k_i] \tag{5.59} \\ &= \frac{(k_{i-4} - x)_+^3}{(k_{i-4} - k_{i-3})(k_{i-4} - k_{i-2})(k_{i-4} - k_{i-1})(k_{i-4} - k_i)} \\ &\quad + \frac{(k_{i-3} - x)_+^3}{(k_{i-3} - k_{i-4})(k_{i-3} - k_{i-2})(k_{i-3} - k_{i-1})(k_{i-3} - k_i)} \\ &\quad + \dots + \frac{(k_i - x)_+^3}{(k_i - k_{i-4})(k_i - k_{i-3})(k_i - k_{i-2})(k_i - k_{i-1})} \tag{5.60} \end{aligned}Denoting Π4,i(x)=(x−ki−4)(x−ki−3)(x−ki−2)(x−ki−1)(x−ki)(5.61) We obtain Π4,i′(ki)=(ki−ki−4)(ki−ki−3)(ki−ki−2)(ki−ki−1)(5.62) Hence, Eq. (5.60) can be written as
s4,i(x)=Π4,i′(ki−4)(ki−4−x)+3+Π4,i′(ki−3)(ki−3−x)+3+Π4,i′(ki−2)(ki−2−x)+3+Π4,i′(ki−1)(ki−1−x)+3+Π4,i′(ki)(ki−x)+3=m=i−4∑iΠ4,i′(km)(km−x)+3(5.63)More generally, a B-spline of order n (degree n−1) is defined by
\begin{aligned} s_{n, i}(x) &= [k_{i-n}, k_{i-n+1}, \dots, k_i] \tag{5.64} \\ &= \sum_{m=i-n}^i \frac{(k_m - x)_+^3}{\Pi'_{n, i}(k_m)} \tag{5.65} \end{aligned}where Πn,i(x)=(x−ki−n)(x−ki−n+1)…(x−ki)(5.66) and Πn,i′(x) denoting its derivative with respect to x. From the definition of a divided difference, we have
[ki−4,ki−3,ki−2,ki−1,ki]=ki−ki−4[ki−3,ki−2,ki−1,ki]−[ki−4,ki−3,ki−2,ki−1]=ki−ki−4s3,i(x)−s3,i−1(x)(5.67)Thus, s4,i(x)=ki−ki−4s3,i(x)−s3,i−1(x),(5.68) which is a recurrence relation. Similarly, for B-splines of order n, we have the recurrence relation sn,i(x)=ki−ki−nsn−1,i(x)−sn−1,i−1(x)(5.69)
In practice, however, formulae given in Eqs. (5.58), (5.68) and (5.69) are not used since they are found to be computationally inefficient. Instead, a recurrence formula discovered independently by Cox [1972] and de Boor [1972] is found to be efficient. This formula is sn,i(x)=ki−ki−n(x−ki−n)sn−1,i−1(x)+(ki−x)sn−1,i(x),(5.70) for all x. For proof of Eq. (5.70), see Cox [1972].
From Eq. (5.70), it can be seen that the computation of sn,i(x) depends on sn−1,i−1(x) and sn−1,i(x). Thus, if the knots are ki−4,ki−3,ki−2,ki−1 and ki, then the cubic B-spline s4,i(x) can be computed, from left to right, as in the following Fig. 5.2.
Figure 5.2 — Array of elements for computing s4,i.
Further, simplification in the computation of the above array may be made by using the property s1,j=⎩⎨⎧kj−kj−110,if kj−1≤x<kjotherwise.(5.71)
For example, if ki−4≤x<ki−3, the array in Fig. 5.2 simplifies to the following Fig. 5.3.
Figure 5.3 — Simplified array of Fig. 5.2.
The numerical computation of B-splines will now become more simpler. The following examples demonstrate the use of formulae (5.64) and (5.70) for the computation of B-splines.
Therefore,
s4,4(1)=m=0∑4Π4,4′(km)(km−x)+3=Π4,4′(k0)(k0−1)+3+Π4,4′(k1)(k1−1)+3+Π4,4′(k2)(k2−1)+3+Π4,4′(k3)(k3−1)+3+Π4,4′(k4)(k4−1)+3=0+0+Π4,4′(2)1+Π4,4′(3)8+Π4,4′(4)27(ii)Now,
Π4,4′(2)Π4,4′(3)=(2−0)(2−1)(2−3)(2−4)=4,=(3−0)(3−1)(3−2)(3−4)=−6,and Π4,4′(4)=(4−0)(4−1)(4−2)(4−3)=24. Hence, (ii) gives
s4,4(1)=41−68+2427=241.(b) x=2 We have
s4,4(2)=Π4,4′(3)(3−2)+3+Π4,4′(4)(4−2)+3=−61+248=61.◀
Hence we need to compute the elements in the following array
0s1,200s2,2s2,30s3,3s3,4s4,4Now,
s2,2s2,3s3,3s3,4s4,4=k2−k0(1−k0)s1,1+(k2−1)s1,2=21,=k3−k1(1−k1)s1,2+(k3−1)s1,3=0,=k3−k0(1−k0)s2,2+(k3−1)s2,3=321=61,=k4−k1(1−k1)s2,3+(k4−1)s2,4=0,=k4−k0(1−k0)s3,3+(k4−1)s3,4=241.(b) x=2 We have 2≤x<3 Then s1,3=k3−k21=1. In this case, the array to be computed is given below.
00s1,300s2,3s2,4s3,3s3,4s4,4 s2,3s2,4=3−k1(2−k1)s1,2+(3−2)s1,3=21,=2(2−k2)s1,3+(4−2)s1,4=0,
s3,3s3,4=3(2−0)s2,2+(3−2)s2,3=61,=3(2−1)s2,3+(4−2)s2,4=61,and s4,4=4(2−0)s3,3+(4−2)s3,4=61. ◀
Let the set of data points be (xi,yi), i=1,2,…,m, and a≤x≤b. Let s(x) be the cubic spline with knots k1,k2,…,kp, where a<k1<k2<⋯<kp<b. To define the full set of B-splines, it is necessary to introduce eight additional knots, namely, k−3,k−2,k−1,k0, kp+1,kp+2,kp+3 and kp+4. These knots are chosen such that k−3<k−2<k−1<k0=aandb=kp+1<kp+2<kp+3<kp+4(5.72)
We now have (p+4) B-splines (of order 4) in the range a≤x≤b, and then the general cubic spline s(x) with knots k1,k2,…,kp has a unique representation, in the range a≤x≤b, of the form s(x)=i=1∑p+4αis4,i(x),a≤x≤b,(5.73) where αi are constants to be determined.
To determine the constants αi in Eq. (5.73), we substitute x=xr and obtain s(xr)=yr=i=1∑p+4αis4,i(xr),r=1,2,…,m(5.74) where m≫p+4. In matrix notation, Eq. (5.74) can be written as Aα=y(5.75) where A is an m×(p+4) band matrix and α, y are column vectors. The required solution is obtained by solving the normal equations ATAα=ATy(5.76)
An important application of the B-spline theory is in digital signal processing where the B-splines are used for noise reduction in wavelet domain. See, for example, Poornachandra et al. [2004], where B-splines are adopted to obtain noisefree signals.