MATLAB in Software Maker EAN13 in Software MATLAB

5 MATLAB generate, create gs1-13 none on software projects console app % % % %. ln of n! ln of k! ln of (n-k)! result ` contains the func Software GS1-13 tion nchoosek = n!/ k!(n k)! as a standard m- le. The routine given here is named nkchoose in order to avoid an obvious con ict with mchoosek. The technique given here uses logarithms to increase the dynamic range of the computation and is handy in those applications where n is so large that n! results in an over ow.

. i i i i i TranterBook 2 Software EAN-13 Supplement 5 003/11/18 16:12 page 332 #350. Postprocessing 8 . The MATLAB routine fo r computing the performance curves for a (15,11) Hamming code and a triple error correcting (23,12) Golay code follows: (Note that PSK modulation and an AWGN channel is assumed.) % File c8 cerdemo zdB = 0:0.1:10; z = 10.

^(zdB/10); ber1 = Q(sqrt(2*z)); ber2 = Q(sqrt(12*2*z/23)); ber3 = Q(sqrt(11*z*2/15)); berg = cer2ber(2,23,7,3,ber2); berh = cer2ber(2,15,3,1,ber3); semilogy(zdB,ber1,zdB,berg,zdB,berh) xlabel( E b/N o in dB ) ylabel( Bit Error Probability ) % End of scrit file. % % % % % % % % % % set Eb/No axis in dB convert to linear scale PSK result CSER for (23,12) Golay code CSER for (15,11) Hamming code BER for Golay code BER for Hamming code plot results label x axis label y axis. The preceding MATLAB EAN-13 Supplement 5 for None code makes use of the function cer2ber, which converts the channel symbol error probability to the approximation of the decoded bit error probability given by (8.44). The MATLAB code for implementing this function is as follows: function [ber] = cer2ber(q,n,d,t,ps) % Converts channel symbol error rate to decoded BER.

lnps = length(ps); % length of error vector ber = zeros(1,lnps); % initialize output vector for k=1:lnps % iterate error vector cer = ps(k); % channel symbol error rate sum1 = 0; sum2 = 0; % initialize sums % % first loop eveluates first sum % for i=(t+1):d term = nkchoose(n,i)*(cer^i)*((1-cer))^(n-i); sum1 = sum1+term; end % % second loop evaluates second sum % for i=(d+1):n term = i*nkchoose(n,i)*(cer^i)*((1-cer)^(n-i)); sum2 = sum2+term; end % % compute BER (output) %. i i i i i TranterBook 2 EAN13 for None 003/11/18 16:12 page 333 #351. Section 8.3. Coding ber(k) = (q/(2*(q-1)) )*((d/n)*sum1+(1/n)*sum2); end % End of function file. The result of these computations are illustrated in Figure 8.13.

. Uncoded PSK Bit Error Probability (15,11) Hamming code 10 (23,12) Golay code 10 5 E b /No in dB Figure 8.13 Performance comparisons for Hamming and Golay block codes. Analytic Approach to Convolutional Coding A number of analytic approximations can be used to map the channel symbol error probability to a decoded bit error probability for the convolutional code case. These mappings take the form of upper bounds on the error probability and are therefore the convolutional code equivalent of (8.44).

These bounds are usually based on the Viterbi decoding algorithm, which asymptotically approaches the maximum likelihood decoder performance, and is the standard for decoding convolutional codes. A frequently used bound is based on the transfer function of the convolutional code. The transfer function describes the distance properties of the convolutional code and can be derived from the state transition diagram of the code.

. i i i i i TranterBook 2 003/11/18 16:12 page 334 #352. Postprocessing 8 . ck,1. bk bk bk - 1 bk - 2. ck,2. Figure 8.14 Rate 1/2 convolutional coder for Example 8.6. The transfer function Software EAN 13 for the rate 1/2 convolutional coder shown in Figure 8.14 is given by [18, 19] T (D, L, I) = D 5 L3 I 1 DL(1 + L)I (8.48).

Expressing (8.48) in polynomial form gives T (D, L, I) =. D5+k L3+k (1 + L)k I 1+k = D5 L3 I + D6 L4 (1 + L)I 2 + (8.49). which describes the d EAN13 for None istance properties of various paths in the trellis for the code that starts at state 0 and merge to state 0 later on. The power of D denotes the Hamming distance (the number of binary ones) separating the given path from the all-zeros path in the decoding trellis. The power of L indicates the length of a given path.

In other words, the exponent of L is incremented each time a branch in the trellis is traversed. The power of I is incremented if the branch transition results from a binary one input, and is not incremented if the branch transition results from a binary zero input. For example, the term D5 L3 I represents a path having Hamming distance 5 from the all-zeros path.

This path has length 3 and results from input data having 1 binary one and 2 binary zeros (100 to be exact). The next term, D6 L4 (1 + L)I 2 = D6 L4 I 2 + D6 L5 I 2 , represents two paths, each of which lie Hamming distance 6 from the all-zeros path. One path has a length of 4 branches and the other path has a length of 5 branches.

The path of length 4 results from an input of 2 ones and 2 zeros, and the second a results from an input having 2 ones and 3 zeros. The smallest output weight of all the paths that begin and merge with the state of all zeros represents the minimum free distance, df , of the code, which is 5 in this case..

Copyright © . All rights reserved.