You are on page 1of 6

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS

COLLEGE OF COMPUTER SCIENCES & ENGINEERING


COMPUTER ENGINEERING DEPARTMENT
COE 540 Computer Networks
Assignment 1 Due Date March 21
st
, 2011 - Solution Key
Suppose that a channel has the ideal low-pass frequency response () = 1 for
0

0
and () = 0 elsewhere.
Problem 1 (10 points): On the subject of signals and channels
a) Compute the impulse response for the channel.
b) If the channel is excited by a train of impulses spaced by
0
. In other words, compute
the channel response, (), for an input equal to () = (

0
), where () is the
unit impulse signal.
Solution:
a) The i mpulse response h(t) i s the inverse Fourier Transform for H(f). Using the textbook
material (and/or slides page 15), h(t) is the sinc function given by:

)
=
2

sin
(
2
)
2

= 2
0
sin
(
2
0

)
2
0


where we substi tuted in the Raised cosine function pair with = 0 and
1

=
0
. This means the
impulse response is a sinc function that is zero at
0
for = 1, 2, .

b) The above h(t) is the response for () (i.e. one i mpulse at t equal to 0). If we have
(

)
=
(

0
), then h(t) is equal to 2
0
sin2
0
(

0
)
2
0
(

0
)
. This a sinc pulse shifted at n/f0.
{note to the grader: the material below is not required from students in this assignment}
For a train of pulses, the input i s given by
(

)
=

(

0
),
+
=
then the output should be

2
0
sin2
0
(

0
)
2
0
(

0
)
+
=
= 2
0

sin2
0
(

0
)
2
0
(

0
)
+
=
.
The student should realize that the above is the sum of overlapping sinc functions.

Consider a GSM mobile channel whose bandwidth is equal to 200 kHz. The current
implementation of GSM uses a modem technology that achieves a channel bit rate equal to
273. kb/s.
Problem 2 (10 points): On channel capacity (Nyquist and Shannon Theorems)
a) Ignoring noise and interference, what is the theoretical capacity limit on the GSM channel?
b) Accounting for noise and interference and considering a working GSM system whose SNR
is equal to 14 dBs, what is the theoretical capacity limit on the GSM channel?
c) Given the limit specified in (b), what is the efficiency of the current implementation?
d) One important figure of merits for transmission on channels is the spectral efficiency.
This is simply the number of bits per second achieved per hertz. Compute this figure for
current implementation and for the theoretical limit computed in (b).
a) When ignoring noise (and interference), Nyquist capacity li mi t applies and the theoretical
capacity limi t for the B = 200 kHz channel is given by C = 2*B log
2
(M) = 400 log
2
(M). That is the
capacity can be made as large as desired depending on the selection of M the transmi ssion
alphabet size.
Solution:
b) When noise and interference are considered, then Shannon capacity li mi t applies and i t is
given by C = Blog
2
(1+SNR) = 200log
2
(1+10
14/10
) = 941 kb/s. Note SNR 14 dB should be converted
to linear scale = 10
14/10
= 25.1.
c) The efficiency of the current i mplementation = 273/941 = 29%.
d) Spectral efficiency for current i mplementation = 273/200 = 1.365 b/s/Hz
Spectral efficiency for theoretical capacity = 941/200 = 4.707 b/s/Hz

Consider a CRC error detection scheme with
Problem 3 (15 points):
4
( ) 1 g D D D = + + .
a) Encode the bits 10010011011.
b) Suppose the channel introduces the error pattern 100010000000000 (i.e. a flip from 1 to 0
or from 0 to 1 in the positions 1 and 5). What is the received frame? Can the error be
detected?
c) Repeat part (b) with error pattern 100110000000000.
Show the computation for all parts.
a. Divide D
10
+ D
7
+ D
4
+ D
3
+ D + 1 by D
4
+ D + 1. The remainder is D
3
+ D
2
. The CRC bi ts
are 1100. The string 100100110111100 is sent.
Solution:
b. The string 000110110111100 is received, corresponding to D
11
+ D
10
+ D
8
+ D
7
+ D
5
+
D
4
+ D
3
+ D
2
. The remainder after division by D
4
+ D + 1 is D
3
+ D
2
+ D , which is
nonzero. The errors are detected.
c. The string 000010110111100 is recei ved, corresponding to D
10
+ D
8
+ D
7
+ D
5
+ D
4
+
D
3
+ D
2
. The remainder after di vision by D
4
+ D + 1 is zero. The errors are not
detected.


Consider simple parity checking depicted in figure.
Problem 4 (10 points):
The n data bits s
1
s
2
...s
n
are used to generate the
parity bit c such that the number of ones in the string s
1
s
2
s
n
c is even. It is desired to
evaluate the strengt h of this simple parity code. Assume that any bit of the string s
1
s
2
s
n
c
can be in error with probability 0 < < 1 and that errors in bits are independent.

a) Compute (or count) the fraction of erroneous code words that will not be detected for
= 1, 2, 3, 7, and 15.
a) Plot the probability that an erroneous code word will not be detected by this simple parity
scheme. Give your plot as a function of the bit error probability p for n = 3, 7, 15, 31 and 63.
Consider the range of p from 10
-2
to 1.
c) State your conclusions regarding the strength of this parity code and its relation to n and
channel error probability, p.
Hi nt:

Part (a) is a counting problem. In part (b) it is required to compute a probability number. Remember that
the probability of bits in error in a string of bits is given by the binomial distribution

(1 )

.

Solution:
a) For n = 1, the code word is of length 2 there are three (four minus one) different error
pattern. Even errors can be only 2 errors (i.e. both bi ts are in error). Therefore, the fraction is
1/3. Note that 0 bits in error does not count as an error pattern. That is why it is discounted
above.
For n = 2, the code word i s of length 3 there are seven (eight minus one) different error
patterns. Only three out of the seven patterns have even number of errors. Those are 0xx, x0x,
xx0. Therefore, the fraction is 3/7.
For n = 3, the code word is of length 4 there are 15 different error patterns. Only 7 of
those are for even error patterns. Therefore, the fraction is 7/15
For larger n, the fraction approaches 0.5;

(b) As covered in class, the probability distribution of the number of bi ts in error is given by a
binomial distribution with parameters n+1 and p. That is,
| | ( )
1
1
Pr ob bits in error 1
n k
k
n
k p p
k
+
+ | |
=
|
\ .

The probability of an error not detected is the probability of having 2, 4, , 2*m where m =
(n+1)/2. Therefore, the probability of undetected errors i s given by
| | ( )
( ) 1 2
1 2
2
1
1
Pr ob errors not detected 1
2
n
n k
k
k
n
p p
k
+

+
=
+ | |
=
|
\ .


The following Matlab code implements the above formula and produces the desi red curves.
s1 s2 sn-1 sn c
0001 clear all
0002 % Assign 1 problem 4
0003 FontSize = 14; LineWidth = 2; MarkerSize = 10;
0004 LowPe = 1e-2; HiPe = 1-LowPe; NoOfPoints = 30;
0005 ps = logspace(log10(LowPe), log10(HiPe), NoOfPoints);
0006 ns = [3 7 15 31 63];
0007 P_NotDetected = zeros(length(ps), length(ns));
0008 for i=1:length(ps);
0009 for j=1:length(ns);
0010 n = ns(j);
0011 p = ps(i);
0012 P_NotDetected(i,j) = OddParityFun_Analytical(n, p);
0013 end
0014 end
0015 figure(1);
0016 h = semilogx(ps, P_NotDetected(:,1),'-o', ...
0017 ps, P_NotDetected(:,2),'--x', ...);
0018 ps, P_NotDetected(:,3),'-.d', ...
0019 ps, P_NotDetected(:,4),':s', ...
0020 ps, P_NotDetected(:,5),'-^');
0021 set(h, 'LineWidth', LineWidth, 'MarkerSize', MarkerSize);
0022 set(gca, 'FontSize', FontSize);
0023 xlabel('Probability of bit error');
0024 ylabel('Fraction of not detected errors');
0025 legend('n=3', 'n=7', 'n=15', 'n=31', 'n=63', 2);grid;

( a) Mat lab code t o comput e pr obabi l it y of undet ect ed er r or .
0001 function NotDetected = OddParityFun_Analytical(n, p);
0002 NotDetected = 0;
0003 for k=1:floor((n+1)/2)
0004 NotDetected = NotDetected + ...
0005 factorial(n+1)/(factorial(n+1-2*k)*factorial(2*k))...
0006 *p^(2*k)*(1-p)^(n+1-2*k);
0007 end

( b) OddPar it y Fun_Analyt ical. m f unct ion used by main Mat lab code f or analyt ical
met hod.

( c) Sample r esult s.

10
-2
10
-1
10
0
0
0.2
0.4
0.6
0.8
1
Probability of bit error
F
r
a
c
t
i
o
n

o
f

n
o
t

d
e
t
e
c
t
e
d

e
r
r
o
r
s
n=3
n=7
n=15
n=31
n=63
c) It can be observed from the figures that as n increases, the fraction of undetected errors
approaches 50% for significant error probability p. For very small p, this fraction is lower than
50% for all the considered lengths n.

You might also like