Skip to content

Commit

Permalink
Bug fix for ldpc_bp_decode
Browse files Browse the repository at this point in the history
`out_llrs` array was being overwritten by the output LLR values of a single
block. This has been fixed by writing the output LLRs of each block to their
corresponding position within the `out_llrs` array
  • Loading branch information
Liu, Andrew Z committed Feb 18, 2021
1 parent 5dba9a4 commit aaedc5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commpy/channelcoding/ldpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ def ldpc_bp_decode(llr_vec, ldpc_code_params, decoder_algorithm, n_iters):
message_matrix.data *= -1
message_matrix.data += parity_check_matrix.multiply(msg_sum + llr_vec[i_start:i_stop]).data

out_llrs = msg_sum + llr_vec[i_start:i_stop]
np.signbit(out_llrs, out=dec_word[i_start:i_stop])
out_llrs[i_start:i_stop] = msg_sum + llr_vec[i_start:i_stop]
np.signbit(out_llrs[i_start:i_stop], out=dec_word[i_start:i_stop])

# Reformat outputs
n_blocks = llr_vec.size // ldpc_code_params['n_vnodes']
Expand Down

0 comments on commit aaedc5f

Please sign in to comment.