ldpc.bposd_decoder

class ldpc.osd.bposd_decoder

Bases: ldpc.bp_decoder.bp_decoder

A class implementing a belief propagation plus ordered statistics decoding 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.

  • osd_order (str or int, optional) – Sets the OSD order.

  • osd_method (str or int, optional) – The OSD method. Currently three methods are availbe: 1) “osd_0”: Zero-oder OSD; 2) “osd_e”: exhaustive OSD; 3) “osd_cs”: combination-sweep OSD.

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+OSD decoder for a given syndrome.

Parameters

input_vector (numpy.ndarray or scipy.sparse.spmatrix) – The syndrome to be decoded.

Returns

The BP+OSD 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

osd0_decoding

Getter. Returns the recovery vector from the last round of BP+OSD0 decoding.

Returns

Return type

numpy.ndarray

osd_method

Getter. Returns the OSD method.

Returns

Return type

str

osd_order

Getter. Returns the OSD order.

Returns

Return type

int

osdw_decoding

Getter. Returns the recovery vector from the last round of BP+OSDW decoding.

Returns

Return type

numpy.ndarray

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