function x = BitToSymbolStream(B,Nbits); % x = BitToSymbolStream(B,Nbits); % % MSB first Lb = length(B); if mod(Lb,Nbits)~=0, error('Bitstream length is incompatible with symbol length'); end; Lx = Lb/Nbits; x = zeros(1,Lx); for n = 1:Nbits, x = x + 2^(Nbits-n)*B(n:Nbits:Lb); end;