src/lte/test/reference/bernuolliDistribution.m
author mmiozzo
Tue, 22 May 2012 16:40:24 +0200
changeset 8794 a68aeda2d85b
parent 8532 fa4eceab8756
child 8890 311667416cd2
permissions -rw-r--r--
Update PEM model with new BLER curves based on standard ECR
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8532
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     1
% Generation of the quantiles of the Bernoulli distribution at 95%
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     2
% related to phy error model test
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     3
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     4
n = 1000;
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8532
diff changeset
     5
p_vect = [0.33 0.11 0.02 0.3 0.55 0.14];
8532
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     6
for i=1:length(p_vect)
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     7
  p = p_vect(i)
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     8
  cdf = 0.0;
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     9
  kmin = 0.0;
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    10
  kmax = 0.0;
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    11
  lambda = n * p
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    12
  for k=1:n
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    13
    pk = bincoeff(n,k)* p^k * (1-p)^(n-k);
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    14
    cdf = cdf + pk;
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    15
    if cdf > 0.025 & kmin == 0.0
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    16
      kmin = lambda - k
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    17
    end
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    18
    if cdf > 0.975 & kmax == 0.0
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    19
      kmax = k - lambda
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    20
    end
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    21
  end
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    22
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    23
end
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    24
fa4eceab8756 Update PEM doc with test section and annex with MCSs BLER figures
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    25