[SciPy-User] Splines in scipy.signal vs scipy.interpolation
Zachary Pincus
zachary.pincus@yale....
Wed Feb 10 11:56:04 CST 2010
>> I had always thought that the splines produced by fitpack were plain
>> (and local) non-uniform B-splines (as opposed to the uniform kind,
>> which Denis's really helpful demo code uses). However, the way that
>> those B-splines are fit to the given data by fitpack is definitely
>> global and can lead to odd artifacts if you're incautious.
>>
>> Is this correct?
>>
>> Then is reason that the B-splines from scipy.interpolate.fitpack and
>> from scipy.signal are a bit different is that the latter are also
>> strictly uniform? (E.g. evenly-spaced knot vector.) Probably this is
>> easy to test...
>
> Zach,
> if UnivariateSpline were local, its response to 0 0 1 0 0 1000
> should be 0 0 1 0 ...
> i.e. shouldn't see the 1000, right ? Doesn't look so --
Yeah -- the *fitting* procedure (fitpack.splrep / fitpack.splprep) is
global, as above. (Note that if you give s=0, this forces the spline
to interpolate the data, and you get as many knots as data points.)
However, I'm pretty sure that the splines that are then produced are
just regular, local non-uniform b-splines, in that altering the
control points can't alter the curve positions on knot spans that
aren't active.
As for your original question, I would figure that fitpack should be
able to evaluate the bsplines produced by scipy.signal properly,
assuming you are able to give it the right knot vector. But not vice-
versa, since fitpack produces non-uniform knot vectors in general, and
signal is just for uniform ones. Right?
Zach
More information about the SciPy-User
mailing list