% recursive version of the haar1d
function y=haar1dr(y)
    n=length(y)/2;
    if(n>=1)
        e=y(1:2:2*n-1);
        o=y(2:2:2*n);
        y(n+1:2*n)=(e-o)/sqrt(2.0);
        y(1:n)=haar1dr((e+o)/sqrt(2.0));
    end
end
