Problem with shortened Reed-Solomon codes in MATLAB

2 visualizaciones (últimos 30 días)
BN
BN el 8 de Feb. de 2017
Respondida: Shashank el 21 de Feb. de 2017
I want to use a MATLAB system object for shortened Reed-Solomon code. This is my code (MATLAB R2015a):
N = 255; % code word length
K = 239; % message length
S = 152; % short message length
gp = rsgenpoly(N,K,[],0);
Enc = comm.RSEncoder('BitInput',true, ...
'CodewordLength', N, ...
'MessageLength', K, ...
'ShortMessageLengthSource', 'Property', ...
'ShortMessageLength', S, ...
'GeneratorPolynomialSource', 'Property', ...
'GeneratorPolynomial', gp, ...
'PrimitivePolynomialSource', 'Property', ...
'PrimitivePolynomial',[1 0 0 0 1 1 1 0 1]);
input = randi([0 1], 152*8 ,1);
coded = step(Enc,input);
But it gives the following error:
Error using zeros
Size inputs must be integers.
Error in comm.RSEncoder/setupImpl (line 446)
data = zeros(outputLength, 1);
Error in test (line 52)
coded = step(Enc,input);
Does anyone know what the problem is?
UPDATE
Apparently, there is a bug in RS encoder system object of the MATLAB R2015a. The code works with later releases of MATLAB.

Respuestas (1)

Shashank
Shashank el 21 de Feb. de 2017
This is a bug in RS encoder system object in MATLAB R2015a and it has been corrected in MATLAB R2016a. You can try the same and verify.
Regards,
Shashank

Categorías

Más información sobre Communications Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by