ldpc.bp_decoder
- class ldpc.bp_decoder.bp_decoder
Bases:
object
A class implementing a belief propagation decoder for LDPC codes
- Parameters
parity_check_matrix (numpy.ndarray or spipy.sparse) – The parity check matrix of the binary code in numpy.ndarray or spipy.sparse format.
error_rate (float64, optional) – The bit error rate.
max_iter (int, optional) – The maximum number of iterations for the BP decoder. If max_iter==0, the BP algorithm will iterate n times, where n is the block length of the code.
bp_method (str or int, optional) – The BP method. Currently three methods are implemented: 1) “ps”: product sum updates; 2) “ms”: min-sum updates; 3) “msl”: min-sum log updates
ms_scaling_factor (float64, optional) – Sets the min-sum scaling factor for the min-sum BP method
channel_probs (list, optional) – This parameter can be used to set the initial error channel across all bits.
- bp_decoding
Getter. Returns the soft-decision propbability ratios on each bit from the last round of BP decoding.
- Returns
- Return type
numpy.ndarray
- bp_method
Getter for the BP method
- Returns
- Return type
str
- channel_probs
The initial error channel probabilities
- Type
numpy.ndarray
- converge
Getter. Returns `1’ if the last round of BP succeeded (converged) and `0’ if it failed.
- Returns
- Return type
int
- decode(self, input_vector) ndarray
Runs the BP decoder for a given input_vector.
- Parameters
input_vector (numpy.ndarray or scipy.sparse.spmatrix) – The syndrome to be decoded.
- Returns
The belief propagation decoding in numpy.ndarray format.
- Return type
numpy.ndarray
- iter
Getter. Returns the number of iterations in the last round of BP decoding.
- Returns
- Return type
numpy.ndarray
- log_prob_ratios
Getter. Returns the soft-decision log probability ratios from the last round of BP decoding.
- Returns
- Return type
numpy.ndarray
- max_iter
Getter. Returns the maximum interation depth for the BP decoder.
- Returns
- Return type
int
- ms_scaling_factor
Getter. Returns the min-sum scaling factor.
- Returns
- Return type
float64
- update_channel_probs(self, channel)
Function updates the channel probabilities for each bit in the BP decoder.
- Parameters
channel (numpy.ndarray) – A list of the channel probabilities for each bit
- Returns
- Return type
NoneType