function out = coif6( n, t )
% Recursive function to generate the
% Coiflet 6 sca scaling function.
%
% M.V.Wickerhauser, 2008-04-01
%
sr2 = sqrt(2.0);
h0=sr2 * -0.0727326195125261;
h1=sr2 * 0.33789766245748;
h2=sr2 * 0.8525720202116;
h3=sr2 * 0.38486484686486;
h4=sr2 * -0.072732619512526;
h5=sr2 * -0.015655728135792;

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