%see the matlab code test.m of CCA-ITQ. It is very simple. Only one sentence using random projection
XX = XX * randn(size(XX,2),bit);
Y = zeros(size(XX));
Y(XX>=0)=1;
Y = compactbit(Y);