Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Decode binary low-density parity-check code

The `LDPCDecoder`

object decodes a binary low-density
parity-check code.

This object performs LDPC decoding, on the soft-decision output (log-likelihood ratio of received bits) from demodulation, using the belief-passing or message-passing algorithm, implemented as the log-domain sum-product algorithm. For more information, see Algorithms. To decode a binary low-density parity-check code:

Define and set up your binary low-density parity-check decoder object. See Construction.

Call

`step`

to decode a binary low-density parity-check code according to the properties of`comm.LDPCDecoder`

. The behavior of`step`

is specific to each object in the toolbox.

Starting in R2016b, instead of using the `step`

method
to perform the operation defined by the System
object™, you can
call the object with arguments, as if it were a function. For example, ```
y
= step(obj,x)
```

and `y = obj(x)`

perform
equivalent operations.

`h = comm.LDPCDecoder`

creates a binary low-density
parity-check (LDPC) decoder System
object, *h*.
This object performs LDPC decoding based on the specified parity-check
matrix, where the object does not assume any patterns in the parity-check
matrix.

`h = comm.LDPCDecoder(`

creates
an LDPC encoder object, `'PropertyName'`

,`'ValueName'`

)*h*, with each specified
property set to the specified value. You can specify additional name-value
pair arguments in any order as (`'PropertyName1'`

,`'PropertyValue1'`

,...,`'PropertyNameN'`

,`'PropertyValueN'`

).

`h = comm.LDPCDecoder(P)`

creates an LDPC
decoder object, *h*, where the input `P`

specifies
the parity check matrix.

step | Decode input using LDPC decoding scheme |

Common to All System Objects | |
---|---|

`release` | Allow System object property value changes |

Transmit an LDPC-encoded, QPSK-modulated bit stream through an AWGN channel, then demodulate, decode, and count errors.

hEnc = comm.LDPCEncoder; hMod = comm.PSKModulator(4, 'BitInput',true); hChan = comm.AWGNChannel(... 'NoiseMethod','Signal to noise ratio (SNR)','SNR',1); hDemod = comm.PSKDemodulator(4, 'BitOutput',true,... 'DecisionMethod','Approximate log-likelihood ratio', ... 'Variance', 1/10^(hChan.SNR/10)); hDec = comm.LDPCDecoder; hError = comm.ErrorRate; for counter = 1:10 data = logical(randi([0 1], 32400, 1)); encodedData = step(hEnc, data); modSignal = step(hMod, encodedData); receivedSignal = step(hChan, modSignal); demodSignal = step(hDemod, receivedSignal); receivedBits = step(hDec, demodSignal); errorStats = step(hError, data, receivedBits); end fprintf('Error rate = %1.2f\nNumber of errors = %d\n', ... errorStats(1), errorStats(2))