Convolutional code: Difference between revisions

Content deleted Content added
Removed "Matlab implementation", which was not an implementation at all
Tag: section blanking
Line 189:
==Turbo codes: replacing convolutional codes==
Simple Viterbi-decoded convolutional codes are now giving way to [[turbo code]]s, a new class of iterated short convolutional codes that closely approach the theoretical limits imposed by [[Shannon's theorem]] with much less decoding complexity than the Viterbi algorithm on the long convolutional codes that would be required for the same performance. [[Concatenated code|Concatenation]] with an outer algebraic code (e.g., [[Reed-Solomon]]) addresses the issue of [[error floor]]s inherent to turbo code designs.
 
== MATLAB implementation ==
 
[[MATLAB]]'s Communications System Toolbox supports convolutional codes.
For example, the encoder shown on Img. 1 can be implemented as follows:
<source lang="matlabsession">
>> G1 = 7;% octal 7 corresponds to binary 111 n_1 = m_1 + m_0 + m_{-1}
>> G2 = 3;% octal 3 corresponds to binary 011 n_1 = m_0 + m_{-1}
>> G3 = 5;% octal 5 corresponds to binary 101 n_1 = m_1 + m_{-1}
>> constLen = 3; % Constraint length
>> % Create the trellis that represents the convolutional code
>> convCodeTrellis = poly2trellis(constLen, [ G1 G2 G3 ]);
>> uncodedWord = [1 ];
>> codedWord1 = convenc(uncodedWord, convCodeTrellis)
codedWord1 =
1 0 1
 
>> uncodedWord = [1 0 0 0];
>> codedWord2 = convenc(uncodedWord, convCodeTrellis)
codedWord2 =
1 0 1 1 1 0 1 1 1 0 0 0
</source>
 
The bits of the first output stream are at positions {{tmath|1,4,7,...,3k+1,...}} in output vector {{mono|''codedWord''}},
respectively second stream at positions {{tmath|2,5,...,3k+2,...}} and the third {{tmath|3,6,...,3k,...}}
 
Initial state is by default initialized by all zeros.
 
Convolution code can also be implemented using [[Verilog HDL]] language,by making use of corresponding state diagrams and state tables.
 
==See also==