function y = sp1(x,alpha)

if x < 0
  y = 0;
elseif x < 2
  y = alpha(1)*(2-x)/2 + alpha(2)*x/2;
elseif x < 4
  y = alpha(2)*(4-x)/2 + alpha(3)*(x-2)/2;
elseif x < 6
  y = alpha(3)*(6-x)/2 + alpha(4)*(x-4)/2;
else
  y = 0;
end;
