I am using fec encoding followed by viterbi decoding. In this process, I observed that the viterbi decoder error correction capability doesn't go hand in hand with theoretical calculations.
For example, in this case, I am using 1/2 rate convolutional encoder for encoding. Theoretically, for 1/2 rate, dfree = 10 and according to error correction capability t = (df-1)/2 , which will intend to 4.5 approximating it to 4. This means, that it should correct 4 errors atleast.
In the following code, I am introducing two errors (randomly) for every 14 bits, vitdec is unable to correct them, it works fine when I introduce one error.
Can someone help me in understanding the reasoning behind it ? Your help will be highly appreciated. Thank you!
dataIn = randi([0 1],700,1);
t = poly2trellis(7,[171,133]);
coderate = 1/2;
encoded = convenc(dataIn,t);
for i = 1:14:(length(encoded))
temp = encoded(i:i+13);
u = randi([1 13],1,2);
temp(u(1)) = ~temp(u(1));
temp(u(2)) = ~temp(u(2));
tbl = 30;
dataOut = vitdec(encoded,t,tbl,'cont','hard');
numErrsInFrameHard = biterr(dataIn(1:end-tbl),dataOut(tbl+1:end));