ON THE USE OF SPLINE FUNCTIONS
FOR DATA SMOOTHING*
Abstract - The appropriateness of various numerical procedures for obtaining valid time-derivative data recently reported in the literature (Zernicke et a/., 1976: McLaughlin er al., 1977; Pezzack et u/., 1977) is discussed. A case for the use of quintic natural splines is presented. based on the smoothness of higher derivatives and flexibility in application. \‘ES;/\
=
.
_J”P
JGTc,
-
z7
SE=5
:;yz,s’sy
___
‘/CL:2
_
OUINT
Fig. 1. Second derivatives of cubic and quintic spline approximations to vertical jump data from Miller and Nelson (1973). CUBIC = cubic spline; QUINT = quintic spline; VALID = ground reaction force values.
INTRODL’CTION
In recent years several papers have been published which deal with the computation of valid derivative measures from digitized position-time data. The use of cubic splines was advocated by Zemicke et al. (1976) and this method has been shown to be superior to traditional polynomial and.finite difference techniques (McLaughlin et al., 1977). Pezzack et al. (1977) have shown that valid derivative data can also be obtained by digital filtering followed by finite differences differentiation. These authors further suggest that the placement of “knots” in the use of cubic splines necessarily encumbers that procedure and that a spline is likely to oversmooth in regions of complex change. However, the spline approximation procedure commonly employed is that of Reinsch (1967; 1971) which provides a natural spline functiont y(t) of degree (2m - 1) for a set of N position-time data [(yi,ti),i=l, 2,..., N] with knots at each t,. A set of N - 1 polynomials of degree (Zm- I) or less is pieced together in such a way that the “smoothness integral”
Q=
l
Received 22
1“[s”(t)]*dr
J:1
(1)
November 1978.
t Spline functions are piecewise polynomials of some degree n joined at points called knots in such a manner as to have n - 1 continuous derivatives. A spline of odd degree (n=Zm-l,m=l.Z ,..., etc.) is called a natural spline if it is given in each of the two intervals (-co, t,), (tN.co) by some polynomial of degree m - I (rather than 2m - 1) or less (Greville, 1969).
is minimized under the boundary condition that the fit is within the “accuracy of measurement*’ i,
[VJ
< S,
(2)
where the 6y, are standard errors of measurement and S is a parameter that controls the extent of smoothing. Such a spline function has the properties that &t,) = #(t,v) = ~(j=~ ,..., 2m-2):
(3)
it has (2m - 2) continuous derivations and is the smoothest possible function that fits the data within the specified accuracy (Wold, 19741.
CL’BIC m QUINTIC
SPLINES
While cubic splines (m = 2) are conventionally used for data smoothing purposes, there are some inherent weaknesses in modelling biomechanical data with a spline of this order. First, the third derivative (jerk) has jump discontinuities, and to assume that forces acting within the body act in a nonsmooth manner would seem to be inappropriate. Secondly, the boundary conditions in (3) often impose unrealistic endvalues for the second derivative g*. To illustrate these points, Figs. 1 and 2 present time-derivative data plots for cubic (m=2) and quintic (m= 3) spline approximations to the vertical displacement of the mass center of a person during a standing jump take-off. The position-time data were taken from Table 4.3 in Miller and Nelson (1973). A digitized representation of the ground reaction force (normalized) has been superimposed on the two acceleration curves (Fig. 1)
477
Technical Notes
478
Fig. 2. Third derivatives of cubic and quintic spline approximations to vertical jump data from Miller and Nelson (1973). CUBIC = cubic spline; QUINT = quintic spline.
and highlights the more appropriate fit of the quintic model in terms of the smoothness of the function and valid terminal values. The discontinuities inherent in the third derivative of the cubic spline function lends further support to this contention (Fig. 2). The validity of quintic spline approximations is further demonstrated by approximation to data extracted from Pexzack et al. (1977). As can be seen in Fig. 3, the quintic spline provides an excellent fit to the raw angular displacement data extracted from film by these authors, and the second derivative conforms closely to a digitized representation of their analogue acceleration trace (Fig. 4).
DISCUSSION It is acknowledged that Pexxack et a/. (1977) also obtained excellent conformity between digital and analogue
PEZZFlCK’
S
DRTU
acceleration-time curves, but the usual requirement of equidistant abscissae for digital filtering and finite difference calculus algorithms can be an undesirable limitation, given that some data acquisition systems do not provide exact time increments. Further, the provision for timedependent error variance estimates in the least squares splining procedure avoids the assumption implicit in digital filtering that the “noise” is uncorrelated with the”signal”. Spbnefunctions also have the desirable property (cf. polynomials and recursive filters) that their behaviour in one region may be totally unrelated to their behaviour in another region (Rice. 1969). Finally, some useful generalizations of spline functions have been formulated in recent years, based on variations to the boundary conditions stated in equation (3). Of these the periodic spline [g$,) = g$,.,); (j=O.. . . , Zm -2)], the parametric spline and the cyclic spline [smooth curves through a set of arbitrary points (x,.y,), i= 1, 2, . . . , X] have obvious application for kinematic analyses (see SpZth, 1974).
-
SE=S
I GtlR/6N
_
QUINT
8
4’.00
0.80
L .60
TIME
2.40 (SEC1
3.20
4 -00
Fig. 3. Quintic spline approximation to film data from Pexzack et ul. (1977).
Technical Notes
479
::i
yo,. 05
i .60 r:rliE
3.80
2.40
3.20
4
.oo
[SEC:
Fig. 4. Second derivative of quintic spline approximation to film data from Pezzack et al. (1977). QUINT = second derivative of quintic spline function; VALlD = accelerometer data. Deparrmenrs of Human :Moremenr and Recreation Studies, and ,Mathemarics, Unicersir_r of Western Australia. Nedlands. Wesrern Australia. 6009, Australia.
GRAEME
A.
WOOD
LESS. JENNINGS
Miller, D. I. and Nelson, R. C. (1973) Eiamechanics ofSport, pp. 56-57. Lea & Febiger, Philadelphia. Pezzack, J. C., Norman, R. W. and Winter, D. A. (1977) An assessment of derivative determining techniques used for motion analysis. J. Biomech. IO, 377-382. Reinsch, C. H. (1967) Smoothing by spline functions. Num. kfarh. 10, 177-183. Reinsch. C. H. (1971) Smoothing by spiine functions II. Num. Marh. 16, 451-454. Rice. J. R. (1969) The Approximation of Funcrions II, pp.
REFERESCES
Greville, T. N. E. (1969) Introduction
to spline functions.
Theory and Application of Spline Functions (Edited by
Greville, T. N. E.), pp. l-35. Academic Press, New York. McLaughlin, T. M., Diliman, C. J. and Lardner, T. J. (1977) Biomechanical analysis with cubic splines. Res. Q. 48, 569-582.
123-159. Addison-Wesley, Reading. Spath, H. (1974) Spline Algorithms for Curves and Surfnces. Utilitas Mathematics, Winnipeg. Weld, S. (1974) Spline functions in data analysis. Technometrics 16, l-l 1. Zernicke. R. F., Caldwell, G. and Roberts, E. M. (1976) Fitting biomechanical data with cubic spline functions. Res. Q. 47, 9-19.