1
\$\begingroup\$

I am working on a realisation the convolutional encoder/decoder with constraint length K=7. Encoder and decoder were implemented and currently I am testing these functions

My test file looks like:

snr = 0.2;
len = 1000;
Din = GenData(len);  % generate a random data
% Encoder
EncOut = VitEnc(Din, len);

% create a channel 
noise = 10^(-snr/20);
    for i = 1: len,
        for j = 1: 2
            ChannelOut(j,i) = (EncOut(j,i) + (noise * randn));
            
            ChannelOut(j,i) = ChannelOut(j,i) * 2;
            if  ChannelOut(j,i) > 7     ChannelOut(j,i) = +7; end;
            if  ChannelOut(j,i) < -8    ChannelOut(j,i) = -8; end;
        end;
    end;
% Decoder 
DecOut = vitdec(len, ChannelOut);  

The last my step is computation bit error. It was suggest to use the following equation:

BitError = sum(abs( Din - DecOut));

If i add this equation in my simulation, I will get a number. For example, ´BitError = 27´. Could someone explain what the result of ´BitError ´ means? Is a bigger or a smaller number better?

EDIT 1:

  1. I have thougth to compute bit error as a difference between input data and decoded data, but it was suggested to take a sum of the differences...I dont understand why?
\$\endgroup\$
5
  • \$\begingroup\$ hm, so, what do you think? Why let us walk in the dark when you already have a though? (I'm pretty sure you have a thought on this, the name is pretty descriptive, and you implemented a whole convolutional decoder, so you know what a bit error is.) \$\endgroup\$ Dec 17, 2021 at 10:41
  • 1
    \$\begingroup\$ @MarcusMüller I have thougth to compute bit error as a difference between input data and decoded data, but it was suggested to take a sum of the differences...I dont understand why? \$\endgroup\$ Dec 17, 2021 at 11:02
  • \$\begingroup\$ please add that to your question, it's very different to what you're currently asking. What do you mean when you say "difference between input data and decoded data", how would you implement that? \$\endgroup\$ Dec 17, 2021 at 11:07
  • \$\begingroup\$ Hint: think what it means to have DecOut - DecIn equal or different to zero. \$\endgroup\$
    – Renan
    Dec 17, 2021 at 12:05
  • \$\begingroup\$ I’m voting to close this question because it's about software \$\endgroup\$ Dec 24, 2021 at 18:14

1 Answer 1

1
\$\begingroup\$
BitError = sum(abs( Din - DecOut));

Assuming Din is the input data sequence and DecOut is the decoded output sequence.

Din - DecOut will compute the differences of the sequences. For example:

Din = [0 1 1 1 0]
DecOut = [0 1 0 1 1]
Din - DecOut = [0 0 1 0 -1]

Taking the absolute value returns a 1 in all of the location where there was a bit error and a zero where the bits are the same:

abs([0 0 1 0 -1]) = [0 0 1 0 1]

Now summing over that result tells you the total number of bit errors.

In general, more bit errors are worse and fewer bit errors are better as the goal is usually to faithfully reproduce the signal.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.