Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bit-flipping decoding
#6
Hello everyone, especially to @jefsummers
I will try to explain the algorithm:

  1. I have M = [0 1 1 0 1 1] and the value will be taken individually later.
  2. The explanation of B_j is the same as in my previous reply.
  3. In the loop of j in range 4 and i in range 6, I will do the equation E[j, i] = XOR of all M[i'].
    For example: when j = 0, i = 0, B_0 = 0, 1, 3, i' = 0, 1, 3, E[0, 0] = M[1] ^ M[3] (M[0] is not included because i' = i).
    Same thing also happened in i = 1 at E[0, 1] = M[0] ^ M[3] (M[1] is not included because i' = i)
    But when j = 0, i = 2, E[0, 2] = M[0] ^ M[1] ^ M[3]. How to implement this condition in python?

Here is the update of my code:
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)
E = np.zeros((m, N))
#Code for obtain each value of matrix M
M = np.hsplit(y[::].copy(), N)

#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]:
            print (i_prime)
            #this part is supposed to be for line 11 of the algorithm and I am stuck at it
            if i_prime != i:
                E[j, i] = M[i_prime != i] ^ M[i_prime != i]
Reply


Messages In This Thread
bit-flipping decoding - by divon - Aug-18-2021, 08:16 AM
RE: bit-flipping decoding - by jefsummers - Aug-18-2021, 02:15 PM
RE: bit-flipping decoding - by divon - Aug-19-2021, 02:16 AM
RE: bit-flipping decoding - by Larz60+ - Aug-18-2021, 06:57 PM
RE: bit-flipping decoding - by divon - Aug-19-2021, 02:31 AM
RE: bit-flipping decoding - by divon - Aug-19-2021, 10:32 AM
RE: bit-flipping decoding - by divon - Aug-20-2021, 08:40 AM
RE: bit-flipping decoding - by divon - Aug-24-2021, 11:33 PM
RE: bit-flipping decoding - by divon - Aug-25-2021, 12:52 AM
RE: bit-flipping decoding - by Larz60+ - Aug-25-2021, 03:13 AM
RE: bit-flipping decoding - by divon - Aug-26-2021, 11:25 PM
RE: bit-flipping decoding - by Larz60+ - Aug-27-2021, 02:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  base64 decoding paul18fr 0 1,322 Mar-13-2022, 05:56 PM
Last Post: paul18fr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020