In [1]:
using Splines

ts = [linspace(-10,10,50);] # knot sequence
vs = cos(ts) # signal values at knots
m = 4 # cubic splines

S = Spline(vs, ts, m)
;

In [ ]:
using PyPlot

xs = [linspace(-10,10,150);]
ys = S(xs)
plot(xs, ys)
;

In [6]:
using Splines
using PyPlot

ts = [linspace(-10.,10.,50);] # knot sequence
vs = cos(ts) # values at knots
m = 6 # spline order

S = Spline(vs, ts, m)

xs = [linspace(-6,6,150);] # points to evaluate splines at

plot(xs, S(xs), "blue")
plot(xs, S(xs, 1), "red")
plot(xs, S(xs, 2), "green")
;



In [7]:
# still using the Spline on cosine input
plot(xs, S(xs), "blue")
plot(xs, 2*S(xs), "red")
plot(xs, S(xs)/2, "green")
;



In [8]:
plot(xs, S(xs), "blue") # cos(x)
plot(xs, S(xs, 0, true), "red") # should be sin(x)
;



In [ ]: