Updating Existing BCH M-Code

If your existing M-code processes BCH codes, then you might want to update it to use the enhanced BCH capabilities. Here are some important points to keep in mind:

Converting Between Release 13 and Release 14 Representations of Code Data

To help you update your existing M-code that processes BCH codes, the example below illustrates how to encode data using the new bchenc function and the earlier encode and bchenco functions.

% Basic parameters for coding
n = 15; k = 11; % Message length and codeword length
w = 10; % Number of words to encode in this example

% R13 binary vector format
mydata_r13 = randint(w*k,1); % Long vector
% R13 binary matrix format
mydata_r13_mat = reshape(mydata_r13,k,w)'; % One message per row
% R13 decimal format
mydata_r13_dec = bi2de(mydata_r13_mat); % Convert to decimal.

% Equivalent R14 Galois array format
mydata_r14 = fliplr(gf(mydata_r13_mat));

% Encode the data using R13 methods.
code_r13 = encode(mydata_r13,n,k,'bch');
code_r13_mat = encode(mydata_r13_mat,n,k,'bch');
code_r13_dec = encode(mydata_r13_dec,n,k,'bch/decimal');
code_r13_bchenco = bchenco(mydata_r13_mat,n,k);

% Encode the data using R14 method.
code_r14 = bchenc(mydata_r14,n,k);
codeX = fliplr(double(code_r14.x)); % Retrieve from Galois array.

% Check that all resulting codes are the same.
% c1, c2, c3, and c4 should all be true.
c1 = isequal(de2bi(code_r13_dec),code_r13_mat);
c2 = isequal(reshape(code_r13,n,w)',code_r13_mat);
c3 = isequal(code_r13_bchenco,code_r13_mat);
c4 = isequal(code_r13_mat,codeX); % Compare R13 with R14.

Changes in Functionality

The encode and decode functions no longer perform BCH encoding and decoding. Use the bchenc and bchdec functions instead.

Obsolete Functions

The table below lists functions that are obsolete. Although they are included in Release 13 for backward compatibility, they might be removed in a future release. The second column lists functions that provide similar functionality. In some cases, the similar function requires different input arguments or produces different output arguments, compared to the original function.

Obsolete FunctionSimilar Function in R14
ademodamdemod, fmdemod, pmdemod, ssbdemod
ademodceUse passband demodulation instead: amdemod, fmdemod, pmdemod, ssbdemod
amodammod, fmmod, pmmod, ssbmod
amodceUse passband modulation instead: ammod, fmmod, pmmod, ssbmod
apkconstgenqammod or pskmod for mapping; scatterplot for plotting
bchdecobchdec
bchencobchenc
bchpolybchgenpoly
ddemodUse baseband demodulation instead: genqamdemod, pamdemod, pskdemod, qamdemod, fskdemod
ddemodcegenqamdemod, pamdemod, pskdemod, qamdemod, fskdemod
demodmapgenqamdemod, pamdemod, pskdemod, qamdemod
dmodUse baseband modulation instead: genqammod, pammod, pskmod, qammod, fskmod
dmodcegenqammod, pammod, pskmod, qammod, fskmod
modmapgenqammod, pammod, pskmod, qammod for mapping; scatterplot for plotting
qaskdecoqamdemod
qaskencoqammod for mapping; scatterplot for plotting


© 1994-2005 The MathWorks, Inc.