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

function y = pulse1(t,r)
    t = mod(t,1);
    y = (t<r) .* (256*t.^4 .* (t/r-1).^4 ./ r.^4);
    
