Viterbi Block Decoding

797 views Asked by At

I don't know if this fits here but here goes:

I have some noisy data encoded using a Hamming Block Code and I'd like to decode them using a Viterbi Decoder.

I made my homework thus I know how the Viterbi Block Decoder works but I'd like to avoid implementing it all by myself as it would take quite some time and might be suboptimal.

My question is the following: do you know of any matlab function for Viterbi Block Decoder? I found comm.ViterbiDecoder but it is only for convolutional encoding.

In the mean time I tried to retrieve as many information as I could from the encoder in case it might be needed in the future (see code below).

% Parameters
codewordLength = 31;
messageLength = 26;
data = randi([0, 1], 1, messageLength);

% Encoder 1
encoder1 = comm.BCHEncoder(...
    'CodewordLength', codewordLength, ...
    'MessageLength', messageLength);

% Encoder 2
M = ceil(log2(codewordLength+1));
primitivePolynomialDe = primpoly(M, 'nodisplay');
primitivePolynomialBi = fliplr(de2bi(primitivePolynomialDe));
SL = (2^M-1) - codewordLength;
generatorPolynomial = bchgenpoly(codewordLength + SL, ...
    messageLength + SL, primitivePolynomialDe);
encoder2 = comm.BCHEncoder(...
    'CodewordLength', codewordLength, ...
    'MessageLength', messageLength, ...
    'PrimitivePolynomialSource', 'Property', ...
    'PrimitivePolynomial', primitivePolynomialBi, ...
    'GeneratorPolynomialSource', 'Property', ...
    'GeneratorPolynomial', generatorPolynomial);



dataEncoded1 = step(encoder1, data.').';
dataEncoded2 = step(encoder2, data.').';

sum(dataEncoded1~=dataEncoded2)
0

There are 0 answers