function y = byte2bit(x)
% y = byte2bit(x)
% Transform a number of bytes into a number of bits.

x_n=numel(x);
y=zeros(1,x_n*8);
y_index=1;
for i=1:x_n
    for j=8:-1:1
%         for j=1:8
        y(y_index+8-j) = bitget(x(i),j);
    end
    y_index = y_index + 8;
end
y = uint8(y);
