Aug-20-2021, 08:40 AM
Hello everyone,
I would like to post today's update, in this program I can obtain the value of M[i_prime] when i != i_prime, but I am still stuck for representing line 11 of the algorithm into python
I would like to post today's update, in this program I can obtain the value of M[i_prime] when i != i_prime, but I am still stuck for representing line 11 of the algorithm into python
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 w_r = 2 w_c = 3 m = np.size(H,0) N = np.size(H,1) M = np.hsplit(y[::].copy(), N) E = 0 #initializing value of B B_j = np.where(H == 1) B = B_j[1].reshape(m, w_c) for j in range (m): for i in range (N): for i_prime in B[j]: if i != i_prime: print (M[i_prime], i, i_prime) E = M[i_prime] ^ M[i_prime + 1] #this part is for equation in line 11 of the algorithm print (E)