%   p is a triangular pulse.  The peak is at
%   k = 10.  The pulse exists for k from 1 to 20.
function y=p(k)
if k<10
   y=k/10;
elseif k<20
   y=2-k/10;
else
   y=0;
end
