Why does poly2trellis generate a different trellis for equivalent inputs?

19 visualizaciones (últimos 30 días)
I am new to MATLAB and am trying to generate test data for a convolutional encoder. I used the following code to generate a trellis using the octal numbers(171 133) for my CodeGenerator parameter. I then tried using the string form to generate the same trellis, but obviously based on the output the second trellis is different. Why are the two trellises different?
>> msg=[1 0 1 0 1 0 1 0];
>> cg1 = [ 171 133 ];
>> cg2 = { '1+x+x^2+x^3+x^6', '1+x^2+x^3+x^5+x^6'};
>> tr1=poly2trellis(7, cg1);
>> tr2=poly2trellis(7, cg2);
>> isequal(tr1,tr2)
ans = logical 0

Respuesta aceptada

Suze Zhang
Suze Zhang el 20 de Sept. de 2017
Hi David,
The reason that the outputs of the two trellis are not equal is that when converting the coefficients of the the 6th degree polynomials to octal number representations, it should start with the highest degree. For your example,
>> cg2 = { '1+x+x^2+x^3+x^6', '1+x^2+x^3+x^5+x^6'};
The corresponding two octal numbers would be 1001111 and 1101101, which are 117 and 155.
>>tr1=poly2trellis(7, [117, 155]);
This tr1 will be equal to tr2 in your example code.
  1 comentario
David Jenks
David Jenks el 20 de Sept. de 2017
So if I understand correctly, then the polynomial form of cg1=[171 133] should have been cg2={'x6+x5+x4+x3+1', 'x6+x4+x3+x+1'}.
Thanks for clarifying the convention!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Error Detection and Correction en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by