function symbols = bits_to_symbols(bits, alphabet_bits) symbols_num = (length(bits) + alphabet_bits - 1) / alphabet_bits; alphabet_size = power(alphabet_bits, 2); % ToDo: align input bits to alphtbet bits division k = 1; for i = 1:symbols_num symbol = 0; mask = 1; for j = 1:alphabet_bits symbol = symbol + mask * bits(k); mask = mask * 2; k = k + 1; end symbols(i) = symbol; %symbols(i) = (alphabet_size / 2) - symbol; end