Turbo Code

Using MATLAB and C MEX

The program is the MEX version of the one from Wu Yufei’s MATLAB turbo code website. Please refer to the website for further information.


The software


First of all, download the turbo code demo software from Wu Yufei’s website. The MEX functions rscEncoder.dll and trellisMex.dll directly replace rsc_encode.m and trellis.m respectively, while logmapo.m and sova0.m will be replaced with another MATLAB's scripts logMap1.m and sova1.m which contain logMapMex.dll and sovaMex.dll. The complete files and the replacement structure can be seen on Table 1.


New functions

Old functions to be replaced






logMap1.m (contains trellisMex.dll and logMapMex.dll)


sova1.m (contains trellisMex.dll and sovaMex.dll)











Table 1. Functions replacement (for Microsoft Windows version) 


After all new functions sit in the working directory or folder, we need to alter some script in order to them to call the proper functions. Table 2 gives the list of the alterations (I cannot provide you the modified functions because I do not have permission to host Yufei’s codes). 











Replace logmapo( ) with logMap1( )

Replace sova0( ) with sova1( )


Replace rsc_encode( ) with rscEncoder( )


Table 2. Function alterations


The Linux/Unix version of the MEX functions are: rscEncoder.mexglx, trellisMex.mexglx, logMapMex.mexglx and sovaMex.mexglx.


The C source codes


The MEX C source codes can be downloaded here. There is an additional C source code for Max-Log-MAP algorithm.


There were some reports that website [1] seems has been removed. If you need those original Matlab's files, please email me. 



[1] Wu Yufei, http://www.ee.vt.edu/~yufei/turbo.html (no longer available)


[2] C. Berrou, A. Glavieux, and P. Thitimajshima, “Near Shannon Limit Error-Correcting Coding and Decoding: Turbo Codes," ICC, pp. 1064-1070, 1993.


[3] J. Hagenauer and P. Hoeher, "A Viterbi Algorithm with Soft-Decision Outputs and Its Application," GLOBECOM, pp. 1680-1686, November 1989.


[4] P. Robertson, E. Villebrun and P. Hoeher, "A Comparison of Optimal and Sub-Optimal Decoding Algorithms in the Log Domain," ICC Seattle, pp. 1009-1013, June 1995.