% pulse2(x,r) is a periodic function of x with period 1.
% For 0 < x < r, the function is a polynomial "spike" with
% area 1.  For r < x < 1, the function is zero.  Outside
% of 0<x<1, the function is defined to be periodic.
%
% Example:
%    x = 0:.005:2;
%    y = pulse2(x,.2);
%    plot(x,y)

function y = pulse2(x,r)
    x = mod(x,1);
    y = (x<r) .* (630*x.^4 .* (x/r-1).^4 ./ r.^5);
    