0

How can I perform binary image expansion on the Reed Solomon Hmatrix.I have a 7,4 RS code filled with symbols and I'm trying to represent the matrix in it binary form 3 bits for each symbol

I have tried using a lookup dictionary and assigning the symbol to its bit representation then use a for loop however I'm getting errors

  • Could you post a minimal reproducible example of the code you've produced, along with the expected and actual outputs? This will be difficult for you to obtain any answer if you don't even tell what the errors you get are – GregoirePelegrin Mar 30 '23 at 09:11
  • lookup = { int("000"): 0, int("001"): 1, int("010"): 2, int("011"): 3, int("100"): 4, int("101"): 5, int("110"): 6, int("111"): 7 } c = [1, 2, 3, 4, 5, 6, 7, 4] input_str = ''.join(format(i, '03b') for i in c) output = [] for i in range(0, len(input_str), 3): input_bits = int(input_str[i:i+3], 2) if input_bits < 0 or input_bits > 7: print(f"Invalid input value: {input_bits}") continue output.append(lookup.get(input_bits, -1)) print(output) – Journey Mar 30 '23 at 10:38
  • It would be better if you would add this as an edit to your post (you will have more space, and other users can see it without the need to look into the comments). Additionally, please use backticks to display code inline, and triple backticks to display blocks of code. – GregoirePelegrin Mar 30 '23 at 12:10

0 Answers0