Aug-18-2021, 08:16 AM
Hello everyone,
I have a problem in trying to make a code for the algorithm of bit-flipping decoding, the algorithm is in the figure in the attachment. And this is the code that I wrote:
I have a problem in trying to make a code for the algorithm of bit-flipping decoding, the algorithm is in the figure in the attachment. And this is the code that I wrote:
import numpy as np #declaration of parity-check matrix H = np.array([[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 0, 0, 1, 1], [0, 0, 1, 1, 0, 1]]) #setting the input and output of the LDPC c = np.array([0, 0, 1, 0, 1, 1]) y = np.array([0, 1, 1, 0, 1, 1]) #initialization of bit flipping decoding M = y[::].copy() w_r = 2 w_c = 3 m = np.size(H,0) N = np.size(H,1) E = np.zeros((m, N)) #initializing value of B_j B_j = np.where(H == 1) B = B_j[1].reshape(m, w_c) #setting value for i_prime for k in range (w_c): i_prime = np.array_split (B[k], 3) split_i = np.array_split (i_prime, w_c) #check message for j in range (m): for i in range (N): for i_prime in B: M_value = np.array_split(M[B], m) split_M = np.array_split(M_value, m) if split_i != i: print (E)I am stuck at line 11 of the algorithm, and I am looking forward to any helpers. Thanks...