function out = bspline( n, t )
% Recursive function to generate the
% biorthogonal dual scaling function of the hat function.
%
% M.V.Wickerhauser, 2008-04-01
%
h0= (-1.0/8.0);
h1= (1.0/4.0);
h2= (3.0/4.0);
h3= (1.0/4.0);
h4= (-1.0/8.0);

if (n>0)
   out = h0*bspline(n-1,2*t) + h1*bspline(n-1,2*t-1) + ...
        h2*bspline(n-1,2*t-2) + h3*bspline(n-1,2*t-3) + ...
        h4*bspline(n-1,2*t-4) ;
else
   if ((t>=0) && (t<1) )
       out = 1;
   else
       out = 0;
   end
end
