Main Content

Error Detection and Correction

CRC codes and block and convolutional channel coding

Apply error detection and correction using:

  • Cyclic redundancy check (CRC) coding techniques. CRC generators and detectors that are optimized for HDL are also included.

  • Block coding techniques including linear block codes, Hamming codes, Bose–Chaudhuri–Hocquenghem (BCH) codes, Reed-Solomon (RS) codes, low-density parity-check (LDPC) codes, and turbo product codes (TPC). RS encoders and decoders that are optimized for HDL are also included.

  • Convolutional coding techniques including convolutional, turbo, a posteriori probability (APP), and Viterbi techniques. Turbo and Viterbi decoders that run with GPUs for processing speed improvement are also included.

  • Galois fields to enable manipulation of even and odd ordered elements of finite fields.

To learn more about error control codes, see Error Detection and Correction.

Functions

expand all

Linear Block Codes

cyclgenProduce parity-check and generator matrices for cyclic code
cyclpolyProduce generator polynomials for cyclic code
decodeBlock decoder
encodeBlock encoder
gfweightCalculate minimum distance of linear block code
gen2parConvert between parity-check and generator matrices
hammgenParity-check and generator matrices for Hamming code
syndtableProduce syndrome decoding table

BCH Codes

bchencBCH encoder
bchdecBCH decoder
bchgenpolyGenerator polynomial of BCH code
bchnumerrNumber of correctable errors for BCH code

Reed-Solomon Codes

rsencReed-Solomon encoder
rsdecReed-Solomon decoder
rsgenpolyGenerator polynomial of Reed-Solomon code
rsgenpolycoeffsGenerator polynomial coefficients of Reed-Solomon code

LDPC Codes

dvbs2ldpcLow-density parity-check (LDPC) codes from DVB-S.2 standard

Turbo Product Codes

tpcencTurbo product code (TPC) encoder
tpcdecTurbo product code (TPC) decoder
convencConvolutionally encode binary message
vitdecConvolutionally decode binary data by using Viterbi algorithm
distspecCompute distance spectrum of convolutional code
iscatastrophicTrue for trellis corresponding to catastrophic convolutional code
istrellisTrue for valid trellis structure
oct2decConvert octal to decimal numbers
poly2trellisConvert convolutional code polynomials to trellis description

Galois Field Computations — Even Order Finite Fields

convmtxConvolution matrix of Galois field vector
cosetsProduce cyclotomic cosets for Galois field
dftmtxDiscrete Fourier transform matrix in Galois field
fftDiscrete Fourier transform
filter (gf)1-D digital filter over Galois field
gfGalois field array
gftableGenerate file to accelerate Galois field computations
ifftInverse discrete Fourier transform
isprimitiveTrue for primitive polynomial for Galois field
logLogarithm in Galois field
minpolFind minimal polynomial of Galois field element
mldivideMatrix left division \ of Galois arrays
primpolyFind primitive polynomials for Galois field

Galois Fields of Odd Characteristic — Odd Order Finite Fields

gfaddAdd polynomials over Galois field
gfconvMultiply polynomials over Galois field
gfcosetsProduce cyclotomic cosets for Galois field
gfdeconvDivide polynomials over Galois field
gfdivDivide elements of Galois field
gffilterFilter data using polynomials over prime Galois field
gflineqFind particular solution of Ax = b over prime Galois field
gfminpolFind minimal polynomial of Galois field element
gfmulMultiply elements of Galois field
gfprettyPolynomial in traditional format
gfprimckCheck whether polynomial over Galois field is primitive
gfprimdfProvide default primitive polynomials for Galois field
gfprimfdFind primitive polynomials for Galois field
gfrankCompute rank of matrix over Galois field
gfrepcovConvert one binary polynomial representation to another
gfrootsFind roots of polynomial over prime Galois field
gfsubSubtract polynomials over Galois field
gftruncMinimize length of polynomial representation
gftupleSimplify or convert Galois field element formatting

Objects

expand all

comm.CRCGeneratorGenerate CRC code bits and append to input data
comm.CRCDetectorDetect errors in input data using CRC
comm.HDLCRCGeneratorGenerate CRC code bits and append to input data
comm.HDLCRCDetectorDetect errors in input data using CRC

BCH Codes

comm.BCHEncoderEncode data using BCH encoder
comm.BCHDecoderDecode data using BCH decoder

Reed-Solomon Codes

comm.RSEncoderEncode data using Reed-Solomon encoder
comm.RSDecoderDecode data using Reed-Solomon decoder
comm.HDLRSEncoderEncode message using Reed-Solomon encoder
comm.HDLRSDecoderDecode message using Reed-Solomon decoder

LDPC Codes

comm.LDPCEncoderEncode binary low-density parity-check (LDPC) code
comm.LDPCDecoderDecode binary low-density parity-check (LDPC) code
comm.gpu.LDPCDecoderDecode binary low-density parity-check (LDPC) code with GPU
comm.ConvolutionalEncoderConvolutionally encode binary data
comm.gpu.ConvolutionalEncoderConvolutionally encode binary data with GPU
comm.TurboEncoderEncode input signal using parallel concatenated encoding scheme
comm.APPDecoderDecode convolutional code by using APP method
comm.TurboDecoderDecode input signal using parallel concatenated decoding scheme
comm.gpu.TurboDecoderDecode input signal using parallel concatenation decoding with GPU
comm.ViterbiDecoderDecode convolutionally encoded data using Viterbi algorithm
comm.gpu.ViterbiDecoderDecode convolutionally encoded data using Viterbi algorithm with GPU

Blocks

expand all

General CRC GeneratorGenerate CRC code bits according to generator polynomial and append to input data frames
General CRC Syndrome DetectorDetect errors in received codeword frames according to generator polynomial
General CRC Generator HDL OptimizedGenerate CRC code bits and append them to input data
General CRC Syndrome Detector HDL OptimizedDetect errors in input data using CRC

Linear Block Codes

Binary Cyclic EncoderCreate systematic cyclic code from binary vector data
Binary Cyclic DecoderDecode systematic cyclic code to recover binary vector data
Binary Linear EncoderCreate linear block code from binary vector data
Binary Linear DecoderDecode linear block code to recover binary vector data
Hamming EncoderCreate Hamming code from binary vector data
Hamming DecoderDecode Hamming code to recover binary vector data

BCH Codes

BCH EncoderCreate BCH code from binary vector data
BCH DecoderDecode BCH code to recover binary vector data

Reed-Solomon Codes

Binary-Input RS EncoderCreate Reed-Solomon code from binary vector data
Binary-Output RS DecoderDecode Reed-Solomon code to recover binary vector data
Integer-Input RS EncoderCreate Reed-Solomon code from integer vector data
Integer-Output RS DecoderDecode Reed-Solomon code to recover integer vector data
Integer-Input RS Encoder HDL OptimizedEncode data using a Reed-Solomon encoder
Integer-Output RS Decoder HDL OptimizedDecode data using Reed-Solomon (RS) decoder

LDPC Codes

LDPC EncoderEncode binary low-density parity-check (LDPC) code
LDPC DecoderDecode binary low-density parity-check (LDPC) code

Turbo Product Codes

TPC EncoderTurbo product code (TPC) encoder
TPC DecoderTurbo product code (TPC) decoder
Convolutional EncoderCreate convolutional code from binary data
Turbo EncoderEncode binary data using parallel concatenated encoding scheme
APP DecoderDecode convolutional code using a posteriori probability (APP) method
Turbo DecoderDecode input signal using parallel concatenated decoding scheme
Viterbi DecoderDecode convolutionally encoded data using Viterbi algorithm

Topics

Error Detection and Correction

Detect errors using cyclic redundancy check (CRC) codes. Learn about various error-control channel coding techniques.

Transmit and Receive Shortened Reed-Solomon Codes

Transmit and receive standard and shortened RS-encoded, 64-QAM-modulated data through an AWGN channel.

Reed-Solomon Coding with Erasures, Punctures, and Shortening in Simulink

This model shows how to configure Reed-Solomon (RS) codes to perform block coding with erasures, punctures, and shortening.

Punctured Convolutional Encoding

This model shows how to use the Convolutional Encoder and Viterbi Decoder blocks to simulate a punctured coding system.

Creation, Validation, and Testing of User Defined Trellis Structure

Use MATLAB® to create and validate a user defined trellis structure, then use a unit test bench built in Simulink® to test the implementation.

Estimate Turbo Code BER Performance in AWGN

Simulate an end-to-end communication link employing 16-QAM using turbo codes in an AWGN channel.

Working with Galois Fields

This example shows how to work with Galois fields.

Character Representation of Polynomials

You can specify polynomials as a character vector or string using a variety of syntaxes that correspond to those found in literature.

Featured Examples