function y=haar2d(y)
    n=length(y);
    for i=1:n
        y(i,:)=haar1d(y(i,:));
    end
    for i=1:n
        y(:,i)=haar1d(y(:,i));
    end
end
