Need help for ns3::UanPhyPerUmodem

40 views
Skip to first unread message

Muhammad Syirajuddin Suja'i

unread,
Nov 25, 2015, 10:20:25 PM11/25/15
to ns-3-users
Hi all,

I wonder if you can help me to understand the source code from UanPhyPerUmodem::CalcPer().

uint32_t d[] =
  { 12, 14, 16, 18, 20, 22, 24, 26, 28 };
  double Bd[] =
  {
    33, 281, 2179, 15035LLU, 105166LLU, 692330LLU, 4580007LLU, 29692894LLU,
    190453145LLU
  };

  // double Rc = 1.0 / 2.0;
  double ebno = std::pow (10.0, sinr / 10.0);
  double perror = 1.0 / (2.0 + ebno);
  double P[9];

  if (sinr >= 10)
    {
      return 0;
    }
  if (sinr <= 6)
    {
      return 1;
    }

  for (uint32_t r = 0; r < 9; r++)
    {
      double sumd = 0;
      for (uint32_t k = 0; k < d[r]; k++)
        {
          sumd = sumd + NChooseK (d[r] - 1 + k, k) * std::pow (1 - perror, (double) k);
        }
      P[r] = std::pow (perror, (double) d[r]) * sumd;

    }

  double Pb = 0;
  for (uint32_t r = 0; r < 8; r++)
    {
      Pb = Pb + Bd[r] * P[r];
    }
 
d[and  Bd[] are arrays that each of them contains 9 values. But we can see at the Pb calculation that the last value of the P[] and Bd[] arrays are excluded from the calculation. Why is that?

and how to obtain the d[] and Bd[] (weighting coefficients) values?

Thank you,

Syirajuddin.

Tommaso Pecorella

unread,
Nov 26, 2015, 5:12:08 AM11/26/15
to ns-3-users
Hi,

the missing element could be a bug. Cant say for sure ut it smells like one.
The coefficients are (most probably) calculated from some theoretical curve. I'm not the UAN maintainer, so I'm not sure about that either. However usually they're calculated from theory. Perhaps there's a clue in the documentation, have you checked ?

Cheers,

T

Muhammad Syirajuddin Suja'i

unread,
Nov 26, 2015, 9:36:49 PM11/26/15
to ns-3-users
Hi,

Thank you for responding my questions. The documentation mentioned that the equations can be found in the book, Digital Communications, by Proakis. I believe the equations are :



I need your suggestion to make sure again, whether it's a bug or not.

For d[and  Bd[] values, I'm going to review again from the textbook. Thanks again.

Syirajuddin.

Tommaso Pecorella

unread,
Nov 27, 2015, 6:45:55 PM11/27/15
to ns-3-users
Hi,

it seems that you're on the right track. I found in the documentation this statement, if it can be helpful:
The FH-FSK PER model calculates probability of error assuming a rate 1/2 convolutional code with constraint length 9 and a CRC check capable of correcting up to 1 bit error.

I'm quite sure that the algorithm is trying to calculate the probability according to this.

Cheers,

T.

Muhammad Syirajuddin Suja'i

unread,
Nov 28, 2015, 10:28:22 PM11/28/15
to ns-3-users
Hi,

Thank you Mr. T. :-D

Syirajuddin
Reply all
Reply to author
Forward
0 new messages