Punctured Convolutional Encoding
This model shows how to use the Convolutional Encoder and ViterbiDecoder blocks to simulate a punctured coding system. Thecomplexity of a Viterbi decoder increases rapidly with the code rate.Puncturing is a technique that allows the encoding and decoding ofhigher rate codes using standard rate 1/2 encoders and decoders.
The example is somewhat similar to the one that appears in Soft-Decision Decoding, whichshows convolutional coding without puncturing.
Structure of the Example
This example contains these blocks.
- Bernoulli Binary Generator:Create a sequence of random bits to use as a message.
- Convolutional Encoder:Encode the message using the convolutional encoder.
- BPSK Modulator Baseband:Modulate the encoded message.
- AWGN Channel: Passthe modulated signal through a noisy channel.
- Error Rate Calculation:Compute the number of discrepancies between the original and recoveredmessages.
Open the example, doc_punct_conv_code,by entering the following at the MATLAB® commandprompt.
Convolutional Codes & Viterbi Decoding. Decoding and the Viterbi Algorithm. Parity Check Matrix: 1 1 1 0 1 0 0. These k code words are said to be generators of the code. 3 Convoltuional Code Convolutional codes k = number of bits shifted into the encoder at one time k=1 is usually used!! N = number of encoder output bits corresponding to the k information bits r = k/n = code rate K = constraint length, encoder memory Each encoded bit is a function of the present input bits and their past ones.
Generating Random Data
The Bernoulli Binary Generator block producesthe information source for this simulation. The block generates aframe of three random bits at each sample time. The Samplesper frame parameter determines the number of rows of theoutput frame.
Convolutional Encoding with Puncturing
The Convolutional Encoder block encodes the datafrom the Bernoulli Binary Generator. This example usesthe same code as described in Soft-Decision Decoding.
The puncture pattern is specified by the Puncturevector parameter in the mask. The puncture vector is abinary column vector. A 1 indicates that the bit in the correspondingposition of the input vector is sent to the output vector, while a0 indicates that the bit is removed.
For example, to create a rate 3/4 code from the rate 1/2, constraintlength 7 convolutional code, the optimal puncture vector is [1 1 01 1 0].' (where the .' after the vector indicates the transpose).Bits in positions 1, 2, 4, and 5 are transmitted, while bits in positions3 and 6 are removed. Now, for every 3 bits of input, the puncturedcode generates 4 bits of output (as opposed to the 6 bits producedbefore puncturing). This makes the rate 3/4.
In this example, the output from the Bernoulli BinaryGenerator is a column vector of length 3. Because the rate1/2 Convolutional Encoder doubles the length of eachvector, the length of the puncture vector must divide 6.
Transmitting Data
The AWGN Channel block simulates transmissionover a noisy channel. The parameters for the block are set in themask as follows:
- The Mode parameter for this blockis set to
Signal to noise ratio (Es/No)
. - The Es/No parameter is set to2 dB. This value typically is changed from one simulation run to thenext.
- The preceding modulation block generates unit powersignals so the Input signal power is set to 1Watt.
- The Symbol period is set to 0.75seconds because the code has rate 3/4.
Demodulating
In this simulation, the Viterbi Decoder blockis set to accept unquantized inputs. As a result, the simulation passesthe channel output through a Simulink®Complexto Real-Imag block that extracts the real part of the complexsamples.
Viterbi Decoding of Punctured Codes
The Viterbi Decoder block is configured to decodethe same rate 1/2 code specified in the Convolutional Encoder block.
![Download Free C Program For Convolutional Code Generator Download Free C Program For Convolutional Code Generator](/uploads/1/2/6/3/126369942/394323806.jpg)
In this example, the decision type is set to
Unquantized
.For codes without puncturing, you would normally set the Tracebackdepth for this code to a value close to 40. However, fordecoding punctured codes, a higher value is required to give the decoderenough data to resolve the ambiguities introduced by the punctures.Since the punctured bits are not transmitted, there is no informationto indicate their values. As a result they are ignored in the decodingprocess.
The Puncture vector parameter indicatesthe locations of the punctures or the bits to ignore in the decodingprocess. Each 1 in the puncture vector indicates a transmitted bitwhile each 0 indicates a puncture or the bit to ignore in the inputto the decoder.
In general, the two Puncture vector parametersin the Convolutional Encoder and Viterbi Decoder mustbe the same.
Calculating the Error Rate
The Error Rate Calculation block compares thedecoded bits to the original source bits. The output of the ErrorRate Calculation block is a three-element vector containingthe calculated bit error rate (BER), the number of errors observed,and the number of bits processed.
In the mask for this block, the Receive delay parameteris set to 96, because the Traceback depth valueof 96 in the Viterbi Decoder block creates a delayof 96. If there were other blocks in the model that created delays,the Receive delay would equal the sum of allthe delays.
BER simulations typically run until a minimum number of errorshave occurred, or until the simulation processes a maximum numberof bits. The Error Rate Calculation block uses its Stopsimulation mode to set these limits and to control theduration of the simulation.
Evaluating Results
Generating a bit error rate curve requires multiple simulations. You can perform multiple simulations using the
sim
command. Follow these steps:- In the model window, remove the Display blockand the line connected to its port.
- In the AWGN Channel block, set the Es/No parameterto the variable name
EsNodB
. - In the Error Rate Calculation block,set Output data to
Workspace
andthen set Variable name toBER_Data
. - Save the model in your working directory under a differentname, such as
my_punct_conv_code.slx
. - Execute the following code, which runs the simulationmultiple times and gathers results.
To confirm the validity of the results, compare them to an establishedperformance bound. The bit error rate performance of a rate r =(n-1)/n punctured code is boundedabove by the expression:
In this expression,
erfc
denotes the complementaryerror function, r is the code rate, and both dfree andωd are dependent on the particular code.For the rate 3/4 code of this example, dfree =5, ω5 = 42, ω6 =201, ω7 = 1492, and so on. See reference[ 1 ] for more details.The following commands compute an approximation of this boundusing the first seven terms of the summation (the values used for
nerr
arefound in Table 2 of reference [ 2 ]:To plot the simulation and theoretical results in the same figure,use the commands below.
In some cases, at the lower bit error rates, you might noticesimulation results that appear to indicate error rates slightly abovethe bound. This can result from simulation variance (if fewer than500 bit errors are observed) or from the finite traceback depth inthe decoder.
References
[1] Yasuda, Y., K. Kashiki, and Y. Hirata, 'High Rate PuncturedConvolutional Codes for Soft Decision Viterbi Decoding,' IEEE Transactionson Communications, Vol. COM-32, March, 1984, pp. 315-319.
[2] Begin, G., Haccoun, D., and Paquin, C., 'Further resultson High-Rate Punctured Convolutional Codes for Viterbi and SequentialDecoding,' IEEE Transactions on Communications, Vol. 38, No. 11, November,1990, p. 1923.