Convolutional Code

Using MATLAB and C MEX

The program simulates convolutional code using soft-decoding viterbi algorithm. The choice of generator matrix (G) determines the code rate (1/R) and constraint length of the code (K).

 

The Programs

 

There are two main MEX codes: convEncoder.dll and convViterbi.dll (as well as convEncoder.mexglx and convViterbi.mexglx for Linux/Unix). convEncoder.dll is the convolutional code encoder, based on non recursive, non systematic convolutional encoder. The decoder convViterbi.dll is a soft decision viterbi decoder. Other function that uses MEX, bitErrFast.dll, is used to compare the resulting bits with the original one, similar to the built-in function biterr.m of MATLAB’s communication toolbox.

 

The main function convMainUseMex.m simply encodes and decodes a binary source under binary phase shift keying (BPSK) modulation and additive white Gaussian noise (AWGN) channel. From this function, you might have clearer picture on how to use all functions.

 

The Microsoft Windows version program consist of:

 

convMainUseMex.m

 

convEncoder.dll

  

 

codeWord.m

 

 

convViterbi.dll

 

bitErrFast.dll

 

All functions are organized here.

 

Non recursive, non systematic convolutional encoder.

 

Generates all possible encoder’s codeword for input ‘0’ and ‘1’.

 

Soft-decision viterbi decoder

 

Compares the resulting bits to the original one and find the error rate.

 

    Table 1. Functions (Microsoft Windows version)

 

Linux/Unix version:

 

convMainUseMex.m

 

convEncoder.mexglx

 

 

codeWord.m

 

 

convViterbi.mexglx

 

bitErrFast.mexglx

 

All functions are organized here.

 

Non recursive, non systematic convolutional encoder.

 

Generates all possible encoder’s codeword for input ‘0’ and ‘1’.

 

Soft-decision viterbi decoder

 

Compares the resulting bits to the original one and find the error rate.

 

    Table 2. Functions (Linux/Unix version)

 

The C source code:

 

convEncoder.c 

convViterbi.c

bitErrFast.c 

 

Reference

[1] John G. Proakis, "Digital Communication, 4th ed.", McGraw-Hill 2001.