Escolar Documentos
Profissional Documentos
Cultura Documentos
Second Edition
2013
Chapter 2
Problem 2.1
2t5
-
119t
44
P1
2.tnis a sum of shifted triangular pulses. Note that the sum of the left and right side
n0
of triangular pulses that are displaced by one unit of time is equal to 1, The plot is given below
(t)
x2
1
t
1
0.8
0.6
0.4
0.2
-0.2
-0.4
-1-0.8-0.6-0.4-0.200.20.40.60.81
3
Problem 2.2
1.xnsinc3n=9sincn=3.
0.8
0.6
0.4
0.2
-0.2
-0.4
-20-15-10-505101520
nn
1111
2.xn4. If4, i.e.,2n10, we havexn1.
3232
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-20-15-10-505101520
4
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-505101520
Problem 2.3
x1n1 andx2ncos2 n1, for alln. This shows that two signals can be dierent but
Problem 2.4
T11 andT2. The necessary and sucient condition for the sum to be periodic is that T1be a
T2
rational number.
Problem 2.5
1.The frequencies are 2000 and 5500, their ratio (and therefore the ratio of the periods) is
2. The frequencies are 2000 and5500. Their ratio is not rational, hence the sum is not periodic.
5
Problem 2.6
1)
88
>>>et>>>et
t >0t >0
><><
x1tett <0=)x1tett <0 x1t
>>>>>>
>:>:
0t00t0
3)
x3tejtj=)x3tejtjejtjx3t
4)
88
><t><0
t0t0
x4t=
>:0)x4t>:t
t <0 t <0
The signalx4tis neither even nor odd. The even part of the signal is
8
t
<t
tx4t>20jtj
x4;etx4
t
2>:t2
2 <0
5)
x5tx1tx2t=)x5tx1tx2tx1tx2t
Clearlyx5tx5tsince otherwisex2t08t. Similarlyx5tx5tsince otherwise
tx5t
x5;etx5x1t
2
tx5t
x5;otx5 x2t
2
6
Problem 2.7
Rax
For the rst two questions we will need the integralIecos2xdx.
ZZ
11
I1cos2x deaxeaxcos2xeaxsin 2x dx
aaa
11Zax
ax2
sin 2x de
aecosxa2
112Zax
ax2ax
esin 2xecos 2x dx
aecosxa2a2
112Zax
ax2ax2
esin 2xe2 cosx1 dx
aecosxa2a2
112Zax4
ax2ax
esin 2xedxI
aecosxa2a2a2
Thus,
I1acos2xsin 2x2eax
4a2a
1)
T ZT
Z
22
Exlimx2tdxlime2tcos2tdt
T!1T1T!10
2
T
hi2
lim12 cos2tsin 2t1e2t
T!180
T3
lim12 cos2sinT1eT3
T!1828
2)
T ZT
Z
22
Exlimx2tdxlime2tcos2tdt
T!1T2T!1T
22
2ZZT3
0
2
lim4Te2tcos2tdte2tcos2tdt5
T!10
2
But,
Z0
hi0
lime2tcos2tdtlim12 cos2tsin 2t1e2t
T!1TT!18T
22
T
lim132 cos21sinT eT 1
T!182
since 2cossin >0. Thus,Ex 1since as we have seen from the rst question the second
integral is bounded. Hence, the signalx2tis not an energy-type signal. To test ifx2tis a
7
T
R2
But limT!11e2tcos2dtis zero and
T0
Z0
T
lim1e2tcos2dtlim12 cos21sinTeT
T!1TTT!18T2
2
>lim1eT>lim11TT2 >limT 1
T!1TT!1TT!1
3)
T ZTZT
Z
222
Exlimx2tdxlimsgn2tdtlimdtlimT 1
T!1T3T!1TT!1TT!1
222
T ZT
Z
22
Pxlim1sgn2tdtlim1dtlim1T1
T!1TTT!1TTT!1T
22
4)
2X2f
limAcos2 f tdtAcos2 f tdt0
T!1Tk1
22f
k1
so that
T ZT
Z
22
limA2cos22 f tdtlim1A2A2cos22f tdt
T!1TT!12T
22
T
Z
2
lim1A2dtlim1A2T 1
T!12TT!12
2
T
Z
2
ExlimA2cos22 f1tB2cos22 f2t2ABcos2 f1tcos2 f2tdt
T!1T
2
T ZT
Z
22
limA2cos22 f1tdtlimB2cos22 f2tdt
T!1TT!1T
22
T
Z
2
ABlimcos22 f1f2cos22 f1f2dt
T!1T
2
1101
Thus the signal is not of the energy-type. To test if the signal is of the power-type we consider two
8
Iff1f2then
T
Z
2
Pxlim1A2cos22 f1tB2cos22 f2t2ABcos2 f1tcos2 f2tdt
T!1TT
2
"#
2222
lim1ATBTAB
T!1T2222
Thus the signal is of the power-type and iff1f2the power content isAB2=2 whereas iff1f2
Problem 2.8
P1
1.Letxt2tt, thenx1txt4n. First we plotxtthen by shifting
2n1
it by multiples of 4 we can plotx1t.xtis a triangular pulse of width 4 and height 2
from which a standard triangular pulse of width 1 and height 1 is subtracted. The result is a
trapezoidal pulse, which when replicated at intervals of 4 gives the plot ofx1t.
(t)
x1
1
t
22 66
2.This is the sum of two periodic signals with periods 2and 1. Since the ratio of the two
periods is not rational the sum is not periodic (by the result of problem 2.4)
Problem 2.9
1)
T ZT
Z
2212
Pxlim1A2ej2 f0tdtlimA2dtlim1A2TA2
T!1TTT!1TTT!1T
22
2)
T ZTZT
Z2
2222
Pxlim1A2cos22 f0t dtlim1Adtlim1Acos4 f0t2 dt
T!1TTT!1TT2T!1TT2
222
AsT! 1, the there will be no contribution by the second integral. Thus the signal is a power-type
2
signal and its power content isA.
2
9
3)
T ZT
Z
22
Pxlim1u2tdtlim1dtlim1T1
T!1TT1T!1T0T!1T22
2
Thus the unit step signal is a power-type signal and its power content is 1=2
4)
T ZT
ZT
2211 =2
Exlimx2tdtlimK2t2dtlim2K2t2
T!1TT!10T!1
20
p1
lim2K2T2 1
T!1
T ZT
Z
221
Pxlim1x2tdtlim1K2t2dt
T!1TTT!1T0
2
p
1T =211 1
lim12K2t2lim2K2T =22lim2K2T20
T!1T0T!1TT!1
SincePxis not bounded away from zero it follows by denition that the signal is not of the power-type
Problem 2.10
88
>>>t>>>1
1;1t0t >0
><><
tt1;0t1u1t1=2t0
>>>>>>
>:>:
0;o.w.0t <0
xetxtxt1t
22
8
>>>0
t1
>>>
>>>t
1
>><21t <0
xotxtxt0t0
2>>>
>>>t1
>>>20< t1
>>:
0 1t
10
Problem 2.11
1) Suppose that
xtx1tx1tx2tx2t
eoeo
x1txtxt
e
2
x2tx2tx2tx2t
eoeo
2
2x2tx2tx2t
eoo2
t
2xe
Thusx1tx2tandx1txtx1txtx2tx2t
eeoeeo
ytx1tx2t=)ytx1tx2tx1tx2tyt
eeeeee
ztx1tx2t=)ztx1tx2tx1tx2tzt
oooooo
Thus the product of two even or odd signals is an even signal. Forvtx1tx1twe have
eo
vtx1tx1tx1tx1t x1tx1t vt
eoeoeo
Problem 2.12
. . . . . . . . . . . . . . . . . .1
11
22
11
2)
8
>>>0
; t <1=2
>>>
>>>
1=4; t 1=2
>>>
>><
t1;1=2< t0
x2ttt
>>>t
1;0t <1=2
>>>
>>>
1=4; t1=2
>>>
>>:
0;1=2< t
..
1
. . . . . . . . .....4
....
11
22
P1
3)x3tt2n
n1
1
... ...
31 31
.2
.
.
.
.1
.
.
.
.
0
12
1
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
-3-2-10123 4
-4
Problem 2.13
Z1Z1
tsinctt0sinc0sinc0tt
11
Thus sinctthas the same eect as the function sinc0tand we conclude that
x1tsincttsinc0tt
2) sinctt3sinc3t30.
3)
1
X
x3tt ?t2n
n1
1Z1
X
t2nd
n11
1Z1
X
t2nd
n11
1
X
t2n
n1
13
4)
Z1
x4tt ? 0tt0d
1
8
>>>0
t <1
>>>
>>>1
>>>2t 1
>>>
>>>11< t <0
<
1dt0t0t0
d0>>>
>>>
1 0< t <1
>>>
>>>1
>>>2t1
>>>
:0
1< t
5)x5tcos2t3t1cos2tt1cost. Hencex5t1t.
333336
6)
7)
Z1
sincttdtsinc01
1
8)
Z1
sinct1tdtsinc10
1
Problem 2.14
tj
Butejis an even function for everyso thattis even. Sincetis even, we obtain
tt=)0t 0t
ddd
k1k1k
dttdttdtt1t
14
Thus, ifn2l(even)
Z1Z1
tntdttntdt
11
Z1 Z1
tntdttntdt
11
Problem 2.15
Z1
xt ? ntxnt d
1
The signalntis even ifnis even and odd ifnis odd. Consider rst the case thatn2l. Then,
Z1
d2ldn
xt ? 2ltx2lt d12lxxt
1d2ltdtn
Z1
d2l1
xt ? 2l1tx12l1t d112l1x
1d2l1t
dn
xt
dtn
In both cases
n
xt ? ntdxt
dtn
Z1
xt ? u1txu1td
1
Zt
xt ? u1txd
1
Problem 2.16
1) Nonlinear, since the response toxt0 is notyt0 (this is a necessary condition for linearity
2) Nonlinear, if we multiply the input by constant1, the output does not change. In a linear system
15
3) Linear, the output to any input zero, therefore for the inputx1tx2tthe output is zero
5) Nonlinear. The system is not homogeneous for if <0 andxt >0 thenytT xt0
whereasztT xt.
T x1tx2tx1tx2tet
T x1tx2tx1tx2tut
1
X
ytxtyt1xtn
n0
Then forxtx1tx2t
1
X
ytx1tnx2tn
n0
11
XX
x1tnx2tn
n0n0
y1ty2t
9) Linear. Assuming that only a nite number of jumps occur in the interval1; tand that the
magnitude of these jumps is nite so that the algebraic sum is well dened, we obtain
NN
XX
ytT xtJxtnJxtnT xt
n1n1
whereNis the number of jumps in1; tandJxtnis the value of the jump at time instanttn,
that is
Jxtnlimxtnxtn
!0
Forxtx1tx2twe can assume thatx1t,x2tandxthave the same number of jumps
and at the same positions. This is true since we can always add new jumps of magnitude zero to the
NNN
XXX
ytJxtnJxtnJxtn
12
n1n1n1
16
Problem 2.17
Only if (=))
Tx1tx2tTx1tTx2t
Tx1tTx1t
If ((=)
Suppose that both conditions 1) and 2) hold. Thus the system is homogeneous and additive. Then
Tx1tx2t
Tx1tTx2t(homogeneous system)
Problem 2.18
17
10. Homogeneous and additive.
Problem 2.19
TnxtnTxt
forn2 N. The proof is by induction onn. Forn2 the previous equation holds since the system
is additive. Let us assume that it is true fornand prove that it holds forn1.
Tn1xt
Tnxtxt
n1Txt
xtmyt
Txt Tyt
m
Txt1Txt
mm
Tkxt TkxtkTxtkTxt
Problem 2.20
Clearly, for any
88
222
><xt><xt
x0t00x0t0
0
ytT xtxtxtT xt
>:00>:00
xt0xt0
18
Thus the system is homogeneous and if it is additive then it is linear. However, ifxtx1tx2t
thenx0tx0tx0tand
12
x1tx2t2x2tx2t
12
x0tx0tx0tx0t
1212
tc2x2t2cx1tc2
T x1tx2tx11
x0tx0t
11
and
2
t
T x1tT x2tx1
x0t
1
ThusT x1tx2tT x1tT x2tunlessc0. Hence the system is nonlinear since the
As another example of a system that is homogeneous but non linear is the system described by
8
><x
txt1 xtxt1 >0
T xt
>:0
otherwise
Problem 2.21
Any zero input signal can be written as 0xtwithxtan arbitrary signal. Then, the response
of the linear system isyt L0xtand since the system is homogeneous (linear system) we
obtain
yt L0xt0 Lxt0
Problem 2.22
Tx1tx2tTx1tTx2t
for every,andxts.
Tx1tx2tx1tx2tcos2 f0t
Tx1tTx2t
Thus the system is linear. In order for the system to be time-invariant the response toxtt0
19
Problem 2.23
nonlinear.
2) False. For if
88
><t><1
xt t0xt t0
T1xtT2xtt
>:0>:0
t0t0
Then the output of the systemytdepends only on the inputxfortThis means that the
system is causal. However the response to a causal signal,xt0 fort0, is nonzero for negative
Problem 2.24
ytxtu1t=)ytt0xtt0u1tt0
ytt0
ZtZt
t0
ytxd=)ytt0xd
11
ZtZt
t0
ztxt0dxvdvytt0
11
20
where we have used the change of variablevt0.
P1
6) Time-invariant system. Writingytasxtnwe get
n1
1
X
ytt0xtt0nT xtt0
n1
Problem 2.25
The dierentiator is a LTI system (see examples 2.19 and 2.1.21 in book). It is true that the output of
a system which is the cascade of two LTI systems does not depend on the order of the systems. This
Leth1tbe the impulse response of a dierentiator, and letytbe the output of the systemh2t
h1t ? yty0t
Problem 2.26
The integrator is is a LTI system (why?). It is true that the output of a system which is the cascade
of two LTI systems does not depend on the order of the systems. This can be easily seen by the
Leth1tbe the impulse response of an integrator, and letytbe the output of the systemh2t
Zt
zth2t ?x dh2t ? h1t ? xt
1
h2t ? h1t ? xth1t ? h2t ? xt
Zt
h1t ? yty d
1
Problem 2.27
The output of a LTI system is the convolution of the input with the impulse response of the system.
Thus,
Z1Zt
thetu1tdhetd
11
21
Dierentiating both sides with respect totwe obtain
Zt"Zt#
0ttd
tehedehed
1dt1
tethtettht
Thus
htt0t
Z1
ytxt0td
1
Z1Z1
xtdx0td
11
xtdxt
dt
Problem 2.28
For the system to be causal the output at the time instantt0should depend only onxtfortt0.
t0TZt0Zt0T
1Z11
yt0xdxdxd
2TtT2TtT2Tt
000
We observe that the second integral on the right side of the equation depends on values ofxfor
Problem 2.29
This system is causal since the output at the time instanttdepends only on values ofxfort
(actually it depends only on the value ofxfort, a stronger condition.) However, the response
of the system to the impulse signaltis one fort <0 so that the impulse response of the system
22
2.This is a rectangular signal of width 6 centered att03, for negativets it is zero, therefore
Problem 2.31
Problem 2.32
Lethtdenote the the impulse response of a dierentiator. Then for every input signal
xt ? htdxt
dt
t ? htht0t
this caseZ1
ytxt ? 0tx0tddxt
1dt
Assume that the impulse response of a system which delays its input byt0isht. Then the
t ? httt0
t ? xtxt
23
Problem 2.33
ZtZtZt
y1tx1x2dx1dx2d
tTtTtT
ZtZt
t0
y1txt0dxvdvytt0
tTtt0T
where we have used the change of variablesvt0. Thus the system is time invariant. The
ZtZtZt
T
htdddu1tu1tT
tT11
Problem 2.34
1)
Z1Zt
etu1t ? etu1teu1etu1tdetd
10
8
><tt
et >0
>:0
t <0
2)
1Zt1
Z1Z
22
xtt ?ttdtdvdv
11t1
22
t 3=)xt0
2
t1t1
22
3 1Z1139
)xtv1dvv2vt2t
2< t2=21228
1
0Zt1
2
11Z
)xtv1dvv1dv
2< t2=10
t
2
1
101t23
222
t
2vvt12vv04
2
11
13Z1139
)xtv1dvv2vt2t
2< t2=12t1228
t
22
3
)xt0
2< t=
24
Thus,
8
>>>0 3
t
>>>2
>>>1
393 1
>><2t2t< t
2822
xtt231< t1
422
>>>
>>>13913
>>>2t22t82< t2
>>:3
0< t
2
Problem 2.35
Using the rst formula for the convolution and observing thath0; <0 we obtain
Z0Z1Z1
ytxthdxthdxthd
100
we obtain
Zt
ytxhtd
1
R1
The last is true sinceht0 fort < so thatxhtd0
t
Problem 2.36
In order for the signals ntto constitute an orthonormal set of signals in; T0the following
mn
But
ZT
0nm
2t1j2t
h nt; mti1pejT0peT0dt
T0T0
T0
1Zj2nmt
eT0dt
T0
2nmt
IfnmthenejT01 so that
ZT
0T0
25
Whennmthen,
j2 nmT0=T0
Problem 2.37
ii12i12i
AB2A22B2
A
with equality ifikorikifor alli. Summing both sides fromi1 tonwe obtain
iB
nn2n2
XiXiXi
i11
i1AB2i1A22i1B2
1nX21nX211
A2B21
2A2i2B2i2A22B2
i1i1
Thus,
1231
232
nnn2
XXX
1nX42
25
4
1)5i
ABiiiii
i1i1i1i1
2) The second equation is trivial sincejxiyj jxijjyj. To see this writexiandyiin polar
ii
012012
n2nn2nn
XXXXX
@zA
zizi;Rjzi;I@zi;RAi;I
i1i1i1i1i1
nn
XX
zi;Rzm;Rzi;Izm;I
i1m1
26
Sincezi;Rzm;Izm;Rzi;I20 we obtain
zi;Rzm;Rzi;Izm;I2z2z2z2z2
i;Ri;Im;Rm;I
n2nn
XXX
zizi;Rzm;Rzi;Izm;I
i1i1m1
nn
XX1
1
z2z22z2z22
i;Ri;Im;Rm;I
i1m1
0101012
nnn
X1X1X1
@z222A@z222A@z222A
i;Rzi;Im;Rzm;Ii;Rzi;I
i1m1i1
Thus
012
n2nnn
XX1XX
zi@z2z22Aorzijzij
i;Ri;I
i1i1i1i1
zm;R
The inequality now follows if we substitutezixiy. Equality is obtained ifzi;Rk1or
izzm
i;I;I
\zi\zm.
3) From 2) we obtain
n2n
XX
xiyjxijjyij
i
i1i1
1 231
232
nnn2
XXX
4j25
jxijjyij4jxij25yij
i1i1i1
1 231
232
n2nn2
XXX
4j25
xiy4jxij25yij
i1i1i1
From part 1) equality holds ifikiorjxij kjyijand from part 2)xiy jxiyjej. Therefore,
ii
the two conditions are8
><j
xij kjyij
>:\
xi\yi
4) The same procedure can be used to prove the Cauchy-Schwartz inequality for integrals. An easier
27
Then
Z1Z1
0jxtytj2dtxtytxtytdt
11
Z1Z1Z1Z1
jxtj2dtxtytdtxtytdt jaj2jytj2dt
1111
R1R1
The inequality is true forxtytdt0. Suppose thatxtytdt0 and set
11
R1
1jxtj2dt
R1
1xtytdt
Then,
Z1R1R1
jxtj2dt2jytj2dt
0jxtj2dt11R1
1jxtytdtj2
1
and
Z1Z11Z11
22
xtytdtjxtj2dtjytj2dt
111
Problem 2.38
1)
Z12
N
2Xt
xtidt
1
i1
01
Z10N1N
@xXiA@xXtAdt
titt
1jj
i1j1
Z1Z1Z1
NN
XX
jxtj2dtitxtdttxtdt
i
11j1j
i1j1
NNZ1
XX
iitjdt
j
i1j11
Z1Z1Z1
NNN
XXX
jxtj2dtjj2txtdttxtdt
iii
11j1j
i1i1j1
Z1Z1Z1
N2N2
22XtXt
jxtjdtxtdtixtdt
11i1i
i1i1
The rst two terms are independent ofs and the last term is always positive. Therefore the
itxtdt
1i
28
which causes the last term to vanish.
Z1Z1
N2
22Xt
jxtjdtxtdt
11i
i1
Z1
N
X
jxtj2dtjj2
i
1
i1
Problem 2.39
x1tcos2 tcos4 t
1
i2 tj2 tj4 tj4 t
2eeee
x2tcos2 tcos4 t =3
1
i2 tj2 tj4 t =3j4 t =3
2eeee
1111
i2 tj2 tj2 =3j4 tj2 =3j4 t
2e2e2ee2ee
from this we conclude thatx2;11andx2;2x1ej2 =3, and for all other values ofn,
22;22
x2;n0.
in parts 1 and 2 we see thatx3;11 andx3;2xj, and for all other values ofn,x3;n0.
3;2
4) The signalx4tis periodic with periodT02. Thus
1Z1
1Zjn1
x4;nte22tdttej ntdt
2121
0Z1
1Zj1
t1e ntdtt1ej ntdt
2120
1j10j0
j ntj ntj nt
ee
2 nte2n212 n1
1j11j1
j ntj ntj nt
ee
2 nte2n202 n0
111
j nj n
2222ee221cos n
n2nn
Whenn0 then
1
1Z1
x4;0tdt
212
29
Thus
1
X1
x4t121cos ncos nt
22n2
n1
Z1
1
x5;0t1dt1t2t1
0202
Forn0
Z1
x5;nt1ej2 ntdt
0
j11j1
j2 ntj2 ntj2 nt
ee
2 nte42n202 n0
j
2n
Thus,
1
X1
x5t1sin 2 nt
2n
n1
4f
0
1Z1
Z
4f4f
00
f0cos2 f012ntdtf0cos2 f012ntdt
11
4f4f
00
114f114f
12nt0sin2 f012nt0
2 12nsin2 f014f2 12n14f
00
1n11
12n12n
Problem 2.40
It follows directly from the uniqueness of the decomposition of a real signal in an even and odd part.
1
Xn
xta0ancos2tbnsin2nt
2T0T0
n1
30
The even part ofxtis
xetxtxt
2
0
11Xnn
@a
ancos2tcos2t
20T0T0
n1
bnsin2ntsin2nt
T0T0
a01Xn
cos2t
2anT0
n1
provides sinsinsinsin0.
xotxtxt
2
1
Xn
bnsin2t
n1T0
Problem 2.41
xtT ej2 f0tej2 f0Tso thatytis periodic ifTT0(the period ofxt) andf0Tkfor some
T0
1Zj2nt
ynxteT0ej2 f0tdt
T0
T0
1Zj2nkt
xteT0dtxn
T0k
31
3) The signalytis periodic with periodTT0=.
T
0
TZjn
1Zjn2t
ynyte2TtdtxteT0dt
TT0
T0
1Zj2nv
xveT0dvxn
T0
Problem 2.42
T0ZT01j2 n1j2 m
1Z1XTtXTt
xtytdtxne0ye0dt
T0T0m
n1m1
11ZT
XX10j2 nm
t
xnyeT0dt
m
n1m1T0
111
XXX
xnymnxny
mn
n1m1n1
Problem 2.43
1nT 1hji
ej2T1te2 nT 1
Tj2n10j2 nT
T
1Tj2 n
TT
1e
j2 nT1eT242n2
jbn
If we writexnanwe obtain the trigonometric Fourier series expansion coecients as
2
2T4 n
an1eT; bn1eT
T242n2T242n2
b)The signal is periodic with period 2T. Since the signal is odd we obtainx00. Forn0
TZT
1Zjn1tn
xnxte22Ttdtej22Ttdt
2TT2TTT
T
1Zjn
teTtdt
2T2T
!T
1jTnT2n
jtjt
TT
e
2T2 nte2n2T
"#
1jT2T2jT2T2
j nj nj nj n
eee
j
n
n1
32
The trigonometric Fourier series expansion coecients are:
2
an0; bn1n1
n
Ifn0 then
T
2n
1Zj
xnxte2Ttdt
TT
2
Z
T T
2n4n
1Zj1
e2Ttdtej2Ttdt
TTTT
24
TT
jn2jn4
j2tj2t
TT
2 neT2 neT
24
jhjnni
nj njj
22
2 neeee
1n1n
nsin22sinc2
2
a03; ; a20; ; a21l; ; bn0;8n
ll1
2l1
T
1Z2
x0xtdt
T03
Ifn0 then
T
TZ3
1Zjn13n
xnxte2Ttdttej2Ttdt
T0T0T
2TZT
3nn
1Zj13
e2Ttdtt3ej2Ttdt
TTT2TT
33
!T
3jTnT2n3
j2tj2t
TT
e
T22 nte42n20
!T
3jTnT2n
j2tj2t
TT
e
T22 nte42n22T
3
2T
jn33jTnT
j2tj2t
TT
2 neTT2 ne2T
33
32 n
cos1
22n23
33
The trigonometric Fourier series expansion coecients are:
432 n
a0; ancos1; bn0;8n
32n23
e)The signal is periodic with periodT. Since the signal is oddx0a00. Forn0
Z
T T
24n
1Z1
xnxtdtej2Ttdt
TTTT
22
T T Z
4n2n
1Z41
j2tj2t
TT
edt
TTTtedtTT
44
!T
4jTnT2n4
j2tj2t
TT
e
T22 nte42n2T
4
TT
1jTn41jTn2
j2tj2t
TT
T2 neTT2 neT
24
" n#
j2 sinjn
n2n
n1 n n1sinc2
Forneven, sincn0 andxnj. The trigonometric Fourier series expansion coecients are:
2n
8
><1
n2l
an0;8n; bn l
>:221l
2l11 2l1 n2l1
Forn0
T
0Z3
1Z3n13n
xnt2ej2Ttdtt2ej2Ttdt
TTTT0T
3
!0
3jTnT2n
j2tj2t
TT
e
T22 nte42n2T
3
!T
3jTnT2n3
j2tj2t
TT
e
T22 nte42n20
T
2jTn02jTn3
j2tj2t
TT
T2 neTT2 ne0
3
312 n12 n
22cossin
n23 n3
34
Problem 2.44
1)Hf 10f. The system is bandlimited with bandwidthW2. Thus at the output of the
4
system only the frequencies in the band2;2will be present. The gain of the lter is 10 for allf
yt10a0a1cos2 tb1sin2 t
2
5a2cos22tb2sin22t
With
24 n
an1e1; bn1e1
142n2142n2
we obtain
yt1e12020cos2 t40sin2 t
142142
1040
cos22tsin22t
11621162
b)Since the period of the signal is 2T2 andan0, for alln, we have
1
Xn
xtbnsin2t
n12
yt20sin2 t20sin2 t
22
2023t10
3sin24sin22t
2
a03; ; a20; ; a21l; ; bn0;8n
ll1
2l1
Hence,
1
X
xt3a2cos2 2l1t
2l1
l0
At the output of the channel only the frequencies for which 2l12 will be present so that
yt103102cos2 t
2
35
d)Sincebn0 for alln, and the period of the signal isT1, we have
1
X
xta0ancos2 nt
2
n1
yt2030cos21cos2 t
323
154
cos1cos22t
423
204545
cos2 tcos22t
3282
8
><1
n2l
bn l
>:221l
2l11 2l1 n2l1
we obtain
yt1010231cos21sin2cos2 t
2
233
5231cos41sin4cos22t
422323
"p#"p#
102033cos2 t1033cos22t
22
244
2) In general
1
Xnn
ytxnHej2Tt
n1T
The DC component of the input signal and all frequencies higher than 4 will be cut o.
36
a)For this signalT1 andxn1j2 n1e1. Thus,
142n2
1j22
yt1j21e1jej2 t1e1jej22t
1421424
1j231j24
1j23t1j24t
14291eje142161eje
1j21j22
1e1jej2 t1e1jej22t
1421424
1j231j24
1j23t1j24t
14291eje142161eje
4
X2
1e1sin2 nt2 ncos2 nt
n1142n2
81
XjXj
yt1njej nt1njej nt
n1 nn8 n
81
X1nX1
ej nt1njej nt
n1 nn8 n
Hence
1
yt1jej2 t1jej23t
3
11
1jej2 tjej23t
3
11
2sin2 t6sin23t
e)Withxnj1nsincnwe obtain
n2
41
X1X1
yt1nsincn1nsincn
n1 n2n4 n2
37
f)Working similarly with the other cases we obtain
4
X3
yt1cos2 n1sin2 njej2 nt
22
n1n23 n3
1
X3
12 n12 n
j2 nt
22cossinje
n4n23 n3
Problem 2.45
Using Parsevals relation (Equation 2.2.38), we see that the power in the periodic signal is given by
P1
n1jxnj2. Since the signal has nite power
T0
1Z2
jxtjdtK <1
T0
P1
Thus,jxnj2K <1. The last implies thatjxnj !0 asn! 1. To see this write
n1
1MM1
XXXX
jxnj2jxnj2jxnj2jxnj2
n1n1
nMnM
Each of the previous terms is positive and bounded byK. Assume thatjxnj2does not converge to
zero asngoes to innity and choose1. Then there exists a subsequence ofxn,xn, such that
k
jxnj> 1;fornk> NM
k
Then
11
XXX
jxnj2jxnj2jxnj2 1
k
nMnNnk
P1
This contradicts our assumption thatjxnj2is nite. Thusjxnj, and consequentlyxn, should
nM
converge to zero asn! 1.
Problem 2.46
F221
ejtj-!
2 222
2 f42
42f
and the duality property of the Fourier transform:Xf Fxt)xf FXtwe obtain
23
21
F425ejfj
422
42t
F1 e2jfj
1t2
38
2)
Fxt Ft3t3
2sincf cos23f
4)
Ftsinct1Fsin tjf1f1
222
The same result is obtain if we recognize that multiplication bytresults in dierentiation in the
Ftsincjdf jf1f1
2df222
5)
1
Ftcos2 f0tjd1ff0ff0
2df22
j
00
ff0
4ff0
Problem 2.47
10003000
39
Problem 2.48
Z1
F1t1t11t1t1ej2 f tdt
2221222
1
j fj f
2eecos f
Xf Fxt=)xf FXt
we obtain
2ef22ef2
j1j1
2f22f2
Problem 2.49
b)
c)
Z1Z0Z1
Xfxtej2 f tdtt1ej2 f tdtt1ej2 f tdt
110
!0
j1j0
ej2 f tej2 f t
2 ft42f212 f1
!1
j1j1
ej2 f tej2 f t
2 ft42f202 f0
f1sin f
40
e) We can writextasxtt1tt1. Hence,
f) We can writextas
" ! !#
xt2f0t12f0t1sin2 f0t
4f04f0
Then
" ! !#
21f1fj21f
Xf1sincfej4f0since4f0
2f02f02f02f0
?jff0ff0
2
!!!!
1ff0ff01ff0ff0
sincsinsincsin
2f02f02f02f02f02f0
Problem 2.50
(Convolution theorem:)
Fxt ? yt FxtFytXf Y f
Thus
F1Fsinct Fsinct
F1f f F1f
sinct
Problem 2.51
Z1
Fxtytxtytej2 f tdt
1
Z1Z1
Xej2 tdytej2 f tdt
11
Z1Z1
Xytej2 ftdtd
11
Z1
XY fdXf ? Y f
1
41
Problem 2.52
1) Clearly
11
XX
x1tkT0xtkT0nT0xtnkT0
n1n1
1
X
xtmT0x1t
m1
2)
1
X
x1txt ?tnT0
n1
This is because
Z1Z1
111
XXX
xtnT0dxtnT0dxtnT0
11
n1n1n1
3)
11
XX
Fx1t Fxt ?tnT0 FxtFtnT0
n1n1
11
XnXn
Xf 1f1Xfn
T0T0T0T0T0
n1n1
Problem 2.53
1) By Parsevals theorem
Z1Z1Z1
sinc5tdtsinc3tsinc2tdtf T f df
111
where
T f Fsinc3t Fsinc2tsinctf ?f
But
1Zf1
Z1Z
22
f ?ffdfdvdv
11f1
22
42
Forf 3=)T f 0
2
Zf11
2f2
39
For3< f 1=)T fv1dv1v2v1f2f
22121228
Z0Zf1
2
For1< f1=)T fv1dvv1dv
22f10
2
1
101f23
222
f
2vvf12vv04
2
Z1
1
39
For1< f3=v1dv1v2v1f2f
22)T ff12f1228
22
For3< f=)T f 0
2
Thus,
8
>>>0 3
f
>>>2
>>>1
393 1
>><2f2f< f
2822
T ff231< f1
422
>>>
>>>13913
>>>2f22f82< f2
>>:3
0< f
2
Hence,
Z0
1
Z1Z
2
393
f T f df1f2ff1dff2f1df
1122814
2
Z1
1
Z
2
3139
f2f1dff2ff1df
041228
2
41
64
2)
Z1Z1
etsinctdtetu1tsinctdt
01
1
Z1Z
121
f dfdf
1j2 f1j2 f
2
1 1=21j1
1
j2lnj2 f1=2j2lnjtan
3)
Z1Z1
etcostdtetu1tcostdt
01
1
1Z1
21j2 ff2f2dt
111
2jj22
43
Problem 2.54
Y f Xf Hf 11
j2 fj2 f
1111
j2 fj2 f
Thus
yt F1Y f 1etetu1t
1
yt F1Y f F12tetu1t
j2 f
T ZT
Z
22
Eylimjytj2dtlim1etet2dt
T!1TT!102
2
"T#
=2T =2T =2
12
lim11e2te2tet
T!1220200
11121
2
222
Problem 2.55
8
><x
t t < T0
xt
>:0
otherwise
Thus
Z1ZT
0
Xfxtej2 f tdtxtej2 f tdt
1
ZT
0n
2t
XnxtejT0dtT0xn
T0
wherexnare the coecients in the Fourier series expansion ofxt. ThusXnis independent of
T0
the choice of.
44
Problem 2.56
111
XX1Xjn
t
xtnTsxt ?tnTsxt ?e2Ts
n1n1Tsn1
" 1#
1Xn
F1Xff
TsTs
n1
"1#
1Xnn
F1Xf
TsTsTs
n1
11Xnjn
t
Xe2Ts
TsTs
n1
111
XX1Xn
xnTsxmTsX
n1m1Tsn1Ts
Problem 2.57
1) We know that
F2
ejtj-!
222
4f
11
XX2
ejnj
222
n1n14n
2) Use the Fourier transform pairt!sincf in the Poissons sum formula withTsK. Then
11
X1Xn
nKsinc
n1Kn1K
ButnK1 forn0 andnK0 forjnj 1 andK2 f1;2; : : :g. Thus the left side of the
previous relation reduces to 1 and
1
Xn
Ksinc
n1K
3) Use the Fourier transform pairt!sinc2f in the Poissons sum formula withTsK. Then
11
X1X2
nKsincn
n1Kn1K
P1
Reasoning as before we see thatnK1 since forK2 f1;2; : : :g
n1
8
><1
n0
nK
>:0
otherwise
P1
Thus,Ksinc2n
n1
K
45
Problem 2.58
But
1
Fetcostu1t F1etu1tejtetu1tejt
22
23
111
45
2
j2 fj2 f
22
so that23
11
5
Y f Fytj2 f4
2
j2 fj2 f
22
Using the linearity property of the Fourier transform, the Convolution theorem and the fact that
0F
t-!j2 fwe obtain
ytetcostu1tetcostu1t ? 0t
etcosttetsintu1t
tetsintu1t
Problem 2.59
2)
xtdxt
dt
Withxtejtjwe obtainytejtjejtjsgnt.
3)
Z1
ythxtd
1
ZtZt
eetdeted
00
46
If)yttetu1t
1t1hti
)ytetetu1teetu1t
Problem 2.60
Let the response of the LTI system behtwith Fourier transformHf . Then, from the convolution
theorem we obtain
Y f Hf Xf =)f f Hf
However, this relation cannot hold sincef 0 for1<jfjwhereasf 0 for 1<jfj 1=2.
2
Problem 2.61
1) No. The inputthas a spectrum with zeros at frequenciesfk, (k0,k2 Z) and the
information about the spectrum of the system at those frequencies will not be present at the output.
The spectrum of the signalcos2 tconsists of two impulses atf 1 but we do not know the
2)
h2t ?ttcos2 t ?t
hi
t1F1f1sinc2f f1sinc2f
2
hi
t1F1f1sinc21f1sinc21
2
t
Thus both signals are candidates for the impulse response of the system.
3)Fu1t1f 1. Thus the system has a nonzero spectrum for everyfand all the
2j2 f
frequencies of the system will be excited by this input.Featu1t1. Again the spectrum
aj2 f
is nonzero for allfand the response to this signal uniquely determines the system. In general the
spectrum of the input must not vanish at any frequency. In this case the inuence of the system will
"#
2 f1j2 f
F\Asin2 f0t jsgnf A1ff0ej2f0ff0e2f0
2j2j
Aj2 fj2 f
ff0e2f0sgnf0ff0e2f0
2sgnf0
Aj2 fj2 f
e2f0ff0e2f0
2ff0
AFcos2 f0t
Problem 2.63
Thus,
\1j2 f0t
ej2 f0t Fjsgnf0ff0 jsgnf0e
Problem 2.64
23
\
d
F4xt5 F\xt ? 0t jsgnf Fxt ? 0t
dt
jsgnf j2 f Xf 2 fsgnf Xf
2jfjXf
Problem 2.65
Fxtj2 f Fxt0
Taking the inverse Fourier transform of both sides of the previous relation we obtain, [0txt0
x
48
Problem 2.66
1) The spectrum of the output signalytis the product ofXf andHf . Thus,
ff00f j
Y f Hf Xf Xf Af0ejf0ff0
ytis a narrowband signal centered at frequenciesf f0. To obtain the lowpass equivalent
signal we have to shift the spectrum (positive band) ofytto the right byf0. Hence,
f 0f jjf0f 0f j
Ylf uff0Xff0Af0ejf0ff0Xlf Af0eff0
2) Taking the inverse Fourier transform of the previous relation, we obtain
h 0i
ylt F1Xlf Af0ejf0ejff jff0
Af0xlt10f j
2ff0
WithytReyltej2 f0tandxltVxtejxtwe get
ytReyltej2 f0t
t10f j
ReAf0Vxt10f jej2 f0tejx2ff0
2ff0
Af0Vxttgcos2 f0tf0xt10f j
2ff0
Af0Vxttgcos2 f0tf0xt10f j
2 f02ff0
Af0Vxttgcos2 f0ttpxt10f j
2ff0
where
1 1f0 1f
tg0f j; tp
2ff02f02 fff
0
3)tgcan be considered as a time lag of the envelope of the signal, whereastpis the time
Problem 2.67
8
>>>cos
jsin f >0
><
Hf0f0cosjsgnf sin
>>>
>:
cosjsin f <0
Thus,
ht F1Hf cost1sin
t
49
2)
cosxt ? tsin1? xt
t
cosxtsinxt
3)
Z1Z1
jxtj2dtjcosxtsinxtj2dt
11
Z1Z1
cos2jxtj2dtsin2jxtj2dt
11
Z1Z1
cossinxtxtdtcossinxtxtdt
11
R1R1R1
Butjxtj2dtjxtj2dtExandxtxtdt0 sincextandxtare orthogonal.
111
Thus,
ExExcos2sin2Ex
Computer Problems
1
1Zj
xne2 nt=4dt
41
1hji
2 n=4j2 n=4
2j nee(2.1)
1n
2sinc2(2.2)
sincxsin x(2.3)
x
>>>n (2.4)
>>>cnsinc
2
>>>
:0
n;
50
1.2
n=1
n=3
n=9
n=7
1
x(t)
n=5
0.8
0.6
n=0
x(t)
0.4
0.2
-0.2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
bura
Figure 2.1: Various Fourier series approximations for the rectangular pulse
Note that for evenns,xn0 (with the exception ofn0, wherea0c01 andx01. Using
2
these coecients, we have
1
X1
xtsincnej2 nt=4
n122
11Xnn
2sinc2cos2 t4(2.5)
n1
A plot of the Fourier series approximations to this signal over one period forn0;1;3;5;7;9 is
3) Note thatxnis always real. Therefore, depending on its sign, the phase is either zero or. The
magnitude of thexns is1sincn:The discrete and phase spectrum are shown in Figure 2.2.
22
51
0.5
0.45
0.4
0.35
0.3
0.25
x(n)
0.2
0.15
0.1
0.05
0
-20-15-10-505101520
n
3.5
2.5
\x(n)
1.5
0.5
0
-20-15-10-505101520
n
52
0.5
0.45
0.4
0.35
0.3
n
0.25
x
0.2
0.15
0.1
0.05
0
-10-50510
n
1) We have
T0=2
1Zj
xnxte2 nt=T0dt(2.6)
T0T=2
0
1
1Zj
te ntdt(2.7)
21
1
1Zj
te ntdt(2.8)
21
1
(2.9)
2Ftfn=2
1n
2
2sinc2(2.10)
(2.11)
where we have used the facts thattvanishes outside the1;1interval and that the Fourier
transform oftissinc2f . This result can also be obtained by using the expression fortand
integrating by parts. Obviously, we havexn0 for all even values ofnexcept forn0.
2) A plot of the discrete spectrum ofxtis presented in Figure 2.3
53
0.5
0.45
0.4
0.35
0.3
n
0.25
y
0.2
0.15
0.1
0.05
0
-20-15-10-505101520
n
The common magnitude spectrum is presented in Figure 2.5. The two phase spectrum of the two
54
1.6
1.4
1.2
0.8
magnitude
0.6
0.4
0.2
0
-505
f
4
X(f)
1
X(f)
3
2
-1
phase in radians
-2
-3
-4
-0.1-0.0500.050.10.15
f
Figure 2.6: The phase spectrum of the signalsx1tandx2t
55
The MATLAB script for this problem follows.
1
1j2 f
Figures 2.7 and 2.8 present the magnitude and phase spectrum of the input signalxt.
8
><1
jfj 1:5
yf1j2 f
>:0
otherwise
The magnitude and phase spectrum ofytis given in Figures 2.9 and 2.10, respectively.
3) The inverse Fourier transform of the output signal is parented in Figure 2.11
56
16
14
12
10
8
|x(f )|
0
-4-3-2-101234
f
plot(f,abs(yf));
axis([1.5 1.5 0 16]);
gure;
plot(f,angle(yf));
yf(401) = 10^30;
yt=it(yf,symmetric);
gure;20
plot(yt)
Hz. Choosing a desired frequency resolution ofdf0:5 Hz, we have the following.
1) Plots of the signal and its magnitude spectrum are given in Figures 2.12 and 2.13, respectively.
2) Choosingf0200 Hz, we nd the lowpass equivalent toxtby using the loweq.m function.
Then using tseq.m, we obtain its spectrum; we plot its magnitude spectrum in Figure 2.14. The
1.5
0.5
0
\x(f )
-0.5
-1
-1.5
-2
-4-3-2-101234
f
function[M,m,df]=tseq(m,ts,df)
% [M,m,df]=tseq(m,ts,df)
% [M,m,df]=tseq(m,ts)
%FFTSEQ generates M, the FFT of the sequence m.
% The sequence is zero-padded to meet the required frequency resolution df.
% ts is the sampling interval. The output df is the nal frequency resolution.
% Output m is the zero-padded version of input m. M is the FFT.
fs=1/ts;
if nargin ==2
n1=0;10
else
n1=fs/df;
end
n2=length(m);
n=2^(max(nextpow2(n1),nextpow2(n2)));
M=t(m,n);
m=[m,zeros(1,nn2)];
df=fs/n;
function xl=loweq(x,ts,f0)
% xl=loweq(x,ts,f0)
%LOWEQ returns the lowpass equivalent of the signal x
% f0 is the center frequency.
% ts is the sampling interval.
58
16
14
12
10
8
|y(f )|
0
-1.5-1-0.500.511.5
f
%
t=[0:ts:ts*(length(x)1)];
z=hilbert(x);
xl=z.*exp(j*2*pi*f0*t);
It is seen that the magnitude spectrum is an even function in this case because we can write
xtResinc100tej400 t(2.12)
Comparing this to
xtRexltej2f0t(2.13)
we conclude that
xltsinc100t(2.14)
which means that the lowpass equivalent signal is a real signal in this case. This, in turn, means that
Plots ofxctandV tare given in Figures 2.15 and 2.16, respectively. Note that choosingf0to be
59
2
1.5
0.5
0
\y(f )
-0.5
-1
-1.5
-2
-4-3-2-101234
f
The Remez algorithm requires that we specify the length of the FIR lterM, the passband edge
frequencyfp, the stopband edge frequencyfs, and the ratio2=1. Here,1and2denote passband
p
M20 log1012131
14:6f
1) Figure 2.17 shows the impulse response coecients of the FIR lter.
2) Figures 2.18 and 2.19 show the magnitude and phase of the frequency response of the lter,
respectively.
60
27
x 10
2.5
1.5
0.5
-0.5
-1
-1.5
-2
-2.5
0100200300400500600700800900
(f )
Figure 2.11: Inverse Fourier transform
0.8
0.6
0.4
0.2
x(t)
0
-0.2
-0.4
-0.6
-0.8
-2-1.5-1-0.500.511.52
time
61
-3
x 10
6
3
|X(f)|
0
-5000500
frequency
0.012
0.01
0.008
0.006
|Xl(f)|
0.004
0.002
0
-5000500
frequency
62
1
0.8
0.6
0.4
xc(t)
0.2
-0.2
-0.4
-2-1.5-1-0.500.511.52
time
0.9
0.8
0.7
0.6
0.5
V(t)
0.4
0.3
0.2
0.1
0
-2-1.5-1-0.500.511.52
time
63
0.6
0.5
0.4
0.3
h(n)
0.2
0.1
-0.1
0510152025303540
n
delta1=(10^(Rp/20)1)/(10^(Rp/20)+1);
delta2=(1+delta1)*(10^(As/20));
%Calculate approximate lter length
Mhat=ceil((20*log10(sqrt(delta1*delta2))13)/(14.6*df)+1);10
f=[0fp fs1];
m=[1 1 0 0];
w=[delta2/delta11];
h=remez(Mhat+20,f,m,w);
[H,W]=freqz(h,[1],3000);
db= 20*log10(abs(H));
% plot results
stem(h);
gure;
plot(W/pi,db)20
gure;
plot(W/pi,angle(H));
2) The magnitude of the frequency response of the lter is given in Figure 2.21.
64
20
-20
-40
-60
|H|in decibels
-80
-100
-120
-140
-160
00.20.40.60.81
w/
20
65
4
\H
0
-1
-2
-3
-4
00.20.40.60.81
w/
2) The magnitude of the frequency response of the lter is presented in Figure 2.23.
3) The lter outputynandxnare presented in Figure 2.24. It should be noted thatynis the
derivative ofxn.
66
0.4
0.3
0.2
0.1
0
h(n)
-0.1
-0.2
-0.3
-0.4
051015202530354045
n
67
20
-20
-40
|H|
-60
-80
-100
-120
00.20.40.60.81
w/
68
0.5
0.4
0.3
0.2
0.1
0
|h(n)|
-0.1
-0.2
-0.3
-0.4
-0.5
051015202530
n
69
10
-10
-20
-30
|H|indecibels
-40
-50
-60
00.20.40.60.81
w/
70
6
y(n)
x(n)
-2
-4
-6
020406080100
n
71
Chapter 3
Problem 3.1
utmtctAmtcos24103t
A2 cos2200t4 sin2250tcos24103t
3
200200
Acos2 4103tAcos2 4103t
250250
2Asin2 4103t2Asin2 4103t
33
Uf Af200f2002ej3f2502ej3f250
jj
?1f4103f4103
2
A200200
33
2f410f410
250250
2ej6f41032ej6f4103
200200
f4103f4103
250250
2ej6f41032ej6f4103
The next gure depicts the magnitude and the phase of the spectrumUf .
. . . . . . . . . . . . . . . . . . . . . .|U (f )|
A
. . . . . . . . . . . . . . . . . . . . . . .A/2
fc250fc200fc+200fc+250fc250fc200fc+200fc+250
\U (f )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
200200
u2tA2cos22 4103tA2cos22 4103t
250250
4A2sin22 4103t4A2sin22 4103t
33
terms of cosine and sine functions in the rst power
72
Hence,
T
Z2
22 4A24A2
Plimu2tdtAA5A2
T!1T2222
2
Problem 3.2
utmtctAsinctsinc2tcos2 fct
Uf Af f ?ffcffc
2
A
ffcffcffc
2ffc
Problem 3.3
The following gure shows the modulated signals forA1 andf010. As it is observed
both signals have the same envelope but there is a phase reversal att1 for the second signal
Am2tcos2 f0t(right plot). This discontinuity is shown clearly in the next gure where we
plottedAm2tcos2 f0twithf03.
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0
0.20.40.60.811.21.41.61.8 2
73
1
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0
0.20.40.60.811.21.41.61.8 2
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0.20.40.60.811.21.41.61.8 2
0
Problem 3.4
ytxt1x2t
2
74
Taking the Fourier transform of the previous, we obtain
Y f Mf 1Mf ? Mf 1MffcMffc
22
1 11
ffcf2fcf2fc
4f2ffc8
1/2
1/4
1/8
Problem 3.5
utmtct
Thus,
Uf 100f2000f20005f3000f3000
22
?f50000f50000
50f52000f480005f530005f47000
22
f52000f480005f530005f47000
22
A plot of the spectrum of the modulated signal is given in the next gure
........................
125
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
Problem 3.6
2mtcos22fc
75
The lowpass lter will cut-o the frequencies aboveW, whereWis the bandwidth of the message
ztAmtcos
2
2
If the power ofmtisPM, then the power of the output signalztisPoutPMAcos2. The
4
2
power of the modulated signalutAmtcos2 fctisPUAPM. Hence,
2
Pout1
2
PU2cos
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
00.511.522.53 3.5
Theta (rad)
Problem 3.7
Uf 20ffcffc
2
2
1500ffc1500
4ffc
ffc1500ffc1500
10
3000ffc3000
4ffc
ffc3000ffc3000
76
......................................
10
............................1/2
. . . . . . . . . . . . . . . . . . . . . . .5/2
If we integrateu2tfromTtoT, normalize the integral by1and take the limit asT! 1, then
22T
all the terms involving cosines tend to zero, whereas the squares of the cosines give a value of1.
2
Hence, the power content at the frequencyfc105Hz isPf400200, the power content at
c2
the frequencyPfis the same as the power content at the frequencyPfand equal to1,
c1500c15002
whereasPfPf25.
c3000c30002
3)
2011cos21500t1cos23000tcos2 fct
102
mt1cos21500t1cos23000t
102
cos221500t1cos21500t1
102
400
4)
ut20 cos2 fctcos2 fc1500tcos2 fc1500t
112525
Psidebands26
2222
77
The total power isPtotalPcarrierPsidebands20026226. The ratio of the sidebands power to
Ptotal226
Problem 3.8
1)
utmtct
2cos2 fc
200
2000tcos2 fc2000t
2cos2 fc
Uuf 25ffc1000ffc1000
50ffc2000ffc2000
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
Problem 3.9
If we let 0101
tTptTp
44
@A
xt@TAT
pp
22
then using the results of Problem 2.56, we obtain
1
X
vtmtstmtxtnTp
n1
1
Xnn
2t
mt1XejTp
TpTp
n1
78
where
20T10T13
tptp
44
@A@A5
Xn F4T
TppTpn
22fTp
TpTpTpTp
j2 fj2 f
44
2sincf2eefn
Tp
Tpn
2sinc22jsinn2
1
Xn
V f 1sinc2jsinnMfn
222Tp
n1
The bandpass lter will cut-o all the frequencies except the ones centered at1, that is forn 1.
Tp
Thus, the output spectrum is
Uf sinc1jMf1sinc1jMf1
2Tp2Tp
2121
jMfjMf
TpTp
"#
41111
Mf ?ff
2jTp2jTp
ut4mtsin21t
Tp
which has the form of a DSB-SC AM signal, withct4sin21tbeing the carrier signal.
Tp
Problem 3.10
P
Assume thatstis a periodic signal with periodTp, i.e.stxtnTp. Then
n
1
X
vtmtstmtxtnTp
n1
1
Xnn
2t
mt1XejTp
TpTp
n1
11Xnj2nt
XmteTp
TpTp
n1
11Xnn
XMf
TpTpTp
n1
79
The bandpass lter will cut-o all the frequency components except the ones centered atfc 1.
Tp
Hence, the spectrum at the output of the BPF is
Uf 1X1Mf11X1Mf1
TpTpTpTpTpTp
21t11j21t
ut1X1mtejTpXmteTp
TpTpTpTp
"#
11j21t1j21t
mtXeTpXeTp
TpTpTp
111
2ReXmtcos2t
TpTpTp
As it is observeduthas the form a modulated DSB-SC signal. The amplitude of the modulating
Problem 3.11
V f AMffcMffc
2
Uf AMffcu1ffcMffcu1ffc
2
Multiplying the output of the HPF withAcos2 fcW tresults in the signalztwith spectrum
Zf AMffcu1ffcMffcu1ffc
2
?AffcW ffcW
2
A2
fcW u1ffcWfc
4Mffc
MffcfcW u1ffcWfc
Mf2fcW u1f2fcW
Mf2fcW u1f2fcW
A2
fW MfW u1fW
4MfW u1
Mf2fcW u1f2fcW Mf2fcW u1f2fcW
The LPF will cut-o the double frequency components, leaving the spectrum
2
Y f AMfW u1fW MfW u1fW
4
80
Y(f)
-W W
2)As it is observed from the spectrumY f , the system shifts the positive frequency components to
the negative frequency axis and the negative frequency components to the positive frequency axis.
If we transmit the signalytthrough the system, then we will get a scaled version of the original
spectrumMf .
Problem 3.12
utmtcos2 fct
qq
Vutu2ctu2stm2tcos2m2tsin2
q
m2t jmtj
Hence, the envelope is proportional to the absolute value of the message signal.
Problem 3.13
ut1001mtcos28105t
500 cos22103tcos28105t
Uf 50f8105f8105
"#
1
251f8105103f8105103
jj
"#
1
251f8105103f8105103
jj
hi
125f81052103f81052103
hi
125f81052103f81052103
50f8105f8105
hi
25f8105103ej2f8105103ej2
hi
25f8105103ej2f8105103ej2
hi
125f81052103f81052103
hi
125f81052103f81052103
|U (f )|
. . . . . . . . . . . . . . . . . . . . . .125
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
. . . . . . . . . . . . . . . . . . . . . . . . . . . 25
fc+2103fc2103fc2103fcfcfc+2103
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \U (f )2
fc103fc+103
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
A21002
Pcarrierc5000
22
50250225022502
Psidebands65000
2222
mtsin2103t5 cos22103t
10 sin2103tsin2103t5
82
4)The power delivered to the load is
jutj210021mt2cos22 fct
Pload
5050
1006:0252
maxPload72:6012
50
Problem 3.14
1)
2011cos200 tcos2000 t
2
3)The power of the carrier component isPcarrier400200, whereas the power in the sidebands is
2
2
Psidebands40050. Hence,
2
Psidebands501
Pcarrier2004
Problem 3.15
h
Uf 50ffc103ffc103
i
ffc103ffc103
h
25ffc3103ffc3103
i
ffc3103ffc3103
83
The spectrum of the signal is depicted in the next gure
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
. . . . . . . . . . . . . . . . . . . .25
1002
PfPf5000
c1000c1000
2
502
PfPf1250
c3000c3000
2
Problem 3.16
iscos21000t. Thus
mtsin21000t2 cos21000t
SubstitutingAc100,mtcos21000t2sin21000tandmtsin21000t
Ulf 50ffc1000ffc1000
100jffc1000ffc1000
50100jffc100050100jffc1000
Hence, the magnitude spectrum is given by
p
jUlf j5021002ffc1000ffc1000
p
10125ffc1000ffc1000
84
Problem 3.17
2sin2 f1
If we selectf1such thatjf1fmj< Wandf1fm> W, then the two lowpass lters will cut-o the
frequency components outside the intervalW ; W , so that the output of the upper and lower LPF
is
yutcos2 f1fmt
yltsin2 f1fmt
which has the form of a SSB signal sincesin2 f1fmtis the Hilbert transform ofcos2 f1
fmt. If we writeutas
utcos2 f1f2fmt
fcfmwe obtain the LSSB signal. In both cases the choice offcandf1uniquely determinef2.
Problem 3.18
y1tx2tmtcos2 f0t2
m2t11cos22f0t2mtcos2 f0t
22
Y1f Mf ? Mf 1f 1f2f0f2f0Mff0Mff0
24
85
and its bandwidth isW12f0. The bandpass lter will cut-o the low-frequency components
Mf ?Mf 1f and the terms with the double frequency components 1f2f0f2f0.
24
Thus the spectrumY2f is given by
Y2f Mff0Mff0
with spectrum
Y3tMf 1Mff0Mff0
2
and bandwidthW3f0W. The lowpass lter will eliminate the spectral components1Mf
2
f0Mff0, so thaty4tmtwith spectrumY4Mf and bandwidthW4W. The next
. . . . . . . . . . . . .1X(f )
2
W Wf0f0
Y1(f )
. . . . . .1
4
2f0f0Wf0+W2W2W f0W f0+W2f0
Y2(f )
f0+Wf0Wf0W f0+W
Y3(f )
W W f0+Wf0Wf0+Wf0W
Y4(f )
W W
86
Problem 3.19
1)
ytaxtbx2t
amtbm2tacos2 f0t
2)The lter should reject the low frequency components, the terms of double frequency and pass
only the signal with spectrum centered atf0. Thus the lter should be a BPF with center frequency
uta12bmtcos2 f0t
a
2bAm
Problem 3.20
1)When USSB is employed the bandwidth of the modulated signal is the same with the bandwidth of
WUSSBW104Hz
2)When DSB is used, then the bandwidth of the transmitted signal is twice the bandwidth of the
WDSB2W2104Hz
WAM2W2104Hz
87
Problem 3.21
8
><11 W
fjfj
Hlf 2u1ffcHffc2W22
>:1W
2<fW
ZW
hlt F1HlfHlf ej2 f tdf
W
2
W ZW
Z
2
21f1ej2 f tdf2ej2 f tdf
WW
2 W22
!W
W
2112122W
j2 f tj2 f tj2 f tj2 f t
eee
Wj2 tf e42t2Wj2 tWj2 tW
222
1j
j2 W t
j te2t2Wsin W t
jhji
2Wt
tsincW te
Note that
Problem 3.22
utAmtcos2 f0t
88
Hence,
xctAmtcos
xstAmtsin
q
V tA2m2tcos2sin2 jAmtj
!
tarctanAmtcosarctantan
Amtsin
xctAmt
xstAmt
qq
V tA2m2tm2tAm2tm2t
tarctanmt
mt
xctAmt
xst Amt
qq
V tA2m2tm2tAm2tm2t
tarctanmt
mt
utA1mtcos2 f0t
Hence,
xctA1mtcos
xstA1mtsin
q
V tA21mt2cos2sin2Aj1mtj
!
tarctanA1mtcosarctantan
A1mtsin
89
Problem 3.23
Provided that the spectrum ofmtdoes not contain any impulses at the originPMP1and
M2
A2PMA2P1
PSSBMA2PM400200
222
The bandwidth of the modulated signalutis the same with that of the message signal. Hence,
WSSB10000 Hz
2)In the case of DSB-SC modulationutAmtcos2 f0t. The power content of the modulated
signal is
A2PM1
PDSB200100
22
utA1mtcos2 f0t
A2A22PM
PAM2002000:620:5236
22
A2
PFM200
2
Bc21W2500001W120000 Hz
W
Problem 3.24
1)The next gure illustrates the spectrum of the SSB signal assuming that USSB is employed and
K3. Note, that only the spectrum for the positive frequencies has been plotted.
K=3
KHz211713 181410
90
2)WithLK60 the possible values of the pairL; K(orK; L) aref1;60; 2;30; 3;20; 4;15; 6;10g.
and
Computer Problems
1) Figures 3.1 and 3.2 present the message and modulated signals, respectively.
3) Figures 3.5, 3.6, 3.7 and 3.8 present the message signal, modulated signal, spectrum of the message
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.020.040.060.080.1
Time
M=M/fs;% scaling
[U,u,df1]=tseq(u,ts,df);% Fourier transform
U=U/fs;% scaling
f=[0:df1:df1*(length(m)1)]fs/2;% frequency vector20
% plot the message signal
gure;
plot(t,m(1:length(t)))
xlabel(Time)
% plot the modulated signal.
gure;
plot(t,u(1:length(t)))
xlabel(Time)
% plot the magnitude of the message and the
% modulated signal in the frequency domain.30
gure;
plot(f,abs(tshift(M)))
xlabel(Frequency)
axis([1000 1000 0 9*10^(3)]);
gure;
plot(f,abs(tshift(U)))
xlabel(Frequency)
axis([1000 1000 0 4.5*10^(3)]);
92
1
0.8
0.6
0.4
0.2
0
u(t)
-0.2
-0.4
-0.6
-0.8
-1
00.020.040.060.080.1
Time
The message signalmtand the modulated signalutare presented in Figures 3.9 and 3.10,
respectively.
2)The spectrum of the message signal is presented in Figure 3.11. Figure 3.12 presents the spectrum
3) Figures 3.13, 3.14, 3.15 and 3.16 present the message signal, modulated signal, spectrum of the
|M(f )|
4
0
-1000-50005001000
Frequency
94
-3
x 10
4.5
3.5
2.5
|U (f )|
2
1.5
0.5
0
-1000-50005001000
Frequency
95
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.050.10.150.20.250.30.350.4
Time
0.8
0.6
0.4
0.2
0
u(t)
-0.2
-0.4
-0.6
-0.8
-1
00.050.10.150.20.250.30.350.4
Time
96
-3
x 10
9
|M(f )|
4
0
-1000-50005001000
Frequency
97
-3
x 10
4.5
3.5
2.5
|U (f )|
2
1.5
0.5
0
-1000-50005001000
Frequency
98
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.020.040.060.080.1
Time
1.5
0.5
0
u(t)
-0.5
-1
-1.5
-2
00.020.040.060.080.1
Time
0.009
0.008
0.007
0.006
0.005
|M(f )|
0.004
0.003
0.002
0.001
0
-1000-50005001000
Frequency
1) Figures 3.17 and 3.18 present the message signal and its Hilbert transform, respectively. The
100
0.06
0.05
0.04
0.03
U (f )
0.02
0.01
0
-1000-50005001000
Frequency
2) The spectrum of the message signalmtand the modulated LSSB signalutare presented in
3) Figures 3.22, 3.23, 3.24, 3.25 and 3.26 present the message signal, its Hilbert transform, modulated
signal, spectrum of the message signal and the spectrum of the modulated signal fort00:4,
respectively.
101
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.050.10.150.20.250.30.350.4
Time
1.5
0.5
0
u(t)
-0.5
-1
-1.5
-2
00.050.10.150.20.250.30.350.4
Time
0.009
0.008
0.007
0.006
0.005
|M(f )|
0.004
0.003
0.002
0.001
0
-1000-50005001000
Frequency
103
0.06
0.05
0.04
0.03
|U (f )|
0.02
0.01
0
-1000-50005001000
Frequency
xlabel(Frequency)
axis([1000 1000 0 0.005]);
1) The message signalmtand the modulated signalutare presented in Figures 3.27 and 3.28,
respectively.
2) The demodulation output is given in Figure 3.29 for0; =8; =4, and =2.
4) The demodulation output is given in Figure 3.30 for0; =8; =4, and =2.
104
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.020.040.060.080.1
Time
0.5
-0.5
m(t)
-1
-1.5
-2
00.020.040.060.080.1
Time
105
0.4
0.3
0.2
0.1
u(t)
-0.1
-0.2
-0.3
-0.4
-0.5
00.020.040.060.080.1
Time
106
-3
x 10
|M(f )|
4
0
-1000-50005001000
Frequency
107
-3
x 10
5
4.5
3.5
2.5
|U (f )|
2
1.5
0.5
0
-1000-50005001000
Frequency
108
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.050.10.150.20.250.30.350.4
Time
0.5
-0.5
m(t)
-1
-1.5
-2
00.050.10.150.20.250.30.350.4
Time
109
0.4
0.3
0.2
0.1
u(t)
-0.1
-0.2
-0.3
-0.4
-0.5
00.050.10.150.20.250.30.350.4
Time
for i= 1:4
= [0pi/8pi/4pi/2];
tit= [a,b,c,d];
y=u.*cos(2*pi*fc.*t+(1));
dem=lter(h, 1,y);
gure(3);
subplot(2,2,i);
plot(t,dem(1:length(t)))
xlabel(t)40
title(a);
[Y,y,df1]=tseq(y,ts,df);
ncuto=oor(fcuto/df1);
f=[0:df1:df1*(length(y)1)]fs/2;
H=zeros(size(f));
H(1:ncuto)=2*ones(1,ncuto);
H(length(f)ncuto+1:length(f))=2*ones(1,ncuto);
Y=Y/fs;
DEM=H.*Y;
dem=real(it(DEM))*fs;50
gure(4);
subplot(2,2,i);
plot(t,dem(1:length(t)))
xlabel(t);
title(tit(i));
end
110
-3
x 10
|M(f )|
4
0
-1000-50005001000
Frequency
111
-3
x 10
5
4.5
3.5
2.5
|U (f )|
2
1.5
0.5
0
-1000-50005001000
Frequency
112
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.020.040.060.080.1
t
1) The message signalmt, the modulated signalutand the Hilbert transform of the message
2) The demodulation output is given in Figure 3.34 for0; =8; =4, and =2.
4) The demodulation output is given in Figure 3.35 for0; =8; =4, and =2.
113
1
0.8
0.6
0.4
0.2
0
u(t)
-0.2
-0.4
-0.6
-0.8
-1
00.020.040.060.080.1
t
plot(t,m(1:length(t)))
xlabel(t)
gure;
plot(t,mh(1:length(t)))
xlabel(t)
gure;
plot(t,u(1:length(t)))
xlabel(t)20
% design the lter
fs= 0.16;
fp= 0.0999;
f=[0fp fs1];
m=[1 1 0 0];
delta1= 0.0875;
delta2= 0.006;
df=fsfp;
w=[delta2/delta11];30
h=remez(31,f,m,w);
fcuto=100;
for i= 1:4
= [0pi/8pi/4pi/2];
tit= [a,b,c,d];
y=u.*cos(2*pi*fc.*t+(1));
114
=0= /8
0.60.6
0.40.4
0.20.2
00
-0.2-0.2
00.050.100.050.1
tt
-16
= /4= /2
x 10
0.32
0.21
0.10
0-1
-0.1-2
00.050.100.050.1
tt
115
=0= /8
11
0.50.5
00
-0.5-0.5
00.050.100.050.1
tt
= /4= /2
11
0.50.5
00
-0.5-0.5
00.050.100.050.1
tt
116
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.020.040.060.080.1
t
dem=lter(h, 1,y);
gure(4);
subplot(2,2,i);40
plot(t,dem(1:length(t)))
xlabel(t)
title(a);
[Y,y,df1]=tseq(y,ts,df);
ncuto=oor(fcuto/df1);
f=[0:df1:df1*(length(y)1)]fs/2;
H=zeros(size(f));
H(1:ncuto)=2*ones(1,ncuto);
H(length(f)ncuto+1:length(f))=2*ones(1,ncuto);
Y=Y/fs;50
DEM=H.*Y;
dem=real(it(DEM))*fs;
gure(5);
subplot(2,2,i);
plot(t,dem(1:length(t)))
xlabel(t);
title(tit(i));
end
117
1
0.8
0.6
0.4
0.2
0
u(t)
-0.2
-0.4
-0.6
-0.8
-1
00.020.040.060.080.1
t
1) The message signal and modulated signal are presented in Figures 3.36 and 3.37
3) In the demodulation process above, we have neglected the eect of the noise-limiting lter, which
is a bandpass lter in the rst stage of any receiver. In practice, the received signal is passed
through the noise-limiting lter and then supplied to the envelope detector. In this example, since
the message bandwidth is not nite, passing the received signal through any bandpass lter will
cause distortion on the demodulated message, but it will also decrease the amount of noise in the
demodulator output.
0.4
0.2
-0.2
m(t)
-0.4
-0.6
-0.8
-1
00.020.040.060.080.1
t
119
=0=0
0.60.6
0.40.4
0.20.2
00
-0.2-0.2
00.050.100.050.1
tt
=0=0
0.60.6
0.40.4
0.20.2
00
-0.2-0.2
00.050.100.050.1
tt
120
=0= /8
11
0.50.5
00
-0.5-0.5
00.050.100.050.1
tt
= /4= /2
11
0.50.5
00
-0.5-0.5
00.050.100.050.1
tt
121
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.020.040.060.080.1
Time
1.5
0.5
0
u(t)
-0.5
-1
-1.5
-2
00.020.040.060.080.1
Time
2.5
1.5
1
demodulated signal
0.5
-0.5
00.020.040.060.080.1
Time
123
Chapter 4
Problem 4.1
kfmaxjmtjkf10
f6=)kf120
WW
Zt
utAcos2 fct2 kfmd
1
Zt
100 cos2 fct 21200sinc400d
1
fmaxW62001200
f
3)Since the modulated signal is essentially a sinusoidal signal with amplitudeA100, we have
2
PA5000
2
4)Using Carsons rule, the eective bandwidth of the modulated signal can be approximated by
Bc2f1W2612002800 Hz
Problem 4.2
maxkpmaxjmtjkp
ZtZt
t2 kfmd2 kfmd
10
8Rt
>>>22
kfd kft0t <1
0
>>>R
>< kt
f2 kf1d kf2 kft11t <2
t
>>> kRd
f2 kf2 kf23 kf2 kft22t <3
>>>
>:
kf3t
124
The maximum value oftis achieved fort2 and is equal to 3 kf. Thus, the desired relation
betweenkpandkfis
kp3 kf
1d1d
fitfctfckpmt
2dt2dt
For themtgiven in Fig. P-4.2, the maximum value ofdmtis achieved fortin0;1and it is
dt
equal to one. Hence,
1
maxfitfc
2
maxfitfckffc1
Problem 4.3
For an angle modulated signal we havextAccos2 fctt, therefore The lowpass equivalent
88
>>>Aenvelope>>>Aenvelope
cc
>>>>>>R
<k<2t
mtphase kfm dphase
PMpFM1Rt
>>>A>>>A
ccoskpmtin-phase comp.ccos2 kf1m din-phase comp.
>>>>>>R
:A:At
csinkpmtquadrature comp.csin2 kf1m dquadrature comp.
Problem 4.4
1)Since an angle modulated signal is essentially a sinusoidal signal with constant amplitude, we have
22
PAc=)P1005000
22
125
2)The maximum phase deviation is
maxmaxj4 sin2000 tj 4
1d
fifct
2dt
4
fccos2000 t2000fc4000 cos2000 t
2
fmaxmaxjfifcj 4000
4)The angle modulated signal can be interpreted both as a PM and an FM signal. It is a PM signal
Problem 4.5
1
X
utAcJncos2 fcnfmt
n1
2
The power in the frequency componentffckfmisPkAcJ2. Hence, the power in the
2n
2
carrier isPcarrierAcJ2and in order to be zero the modulation indexshould be one of the
20
roots ofJ0x. The smallest root ofJ0xis found from tables to be equal 2:404. Thus,
min2:404
Problem 4.6
utAcos2 f0tt
u1tAcos2 n1f0tn1t
126
After mixing with the output of the second frequency multiplieru2tAcos2 n2f0twe obtain
the signal
A2
n2f0n1tcos2 n1n2f0n1t
2cos2 n1
The bandwidth of the signal isW15 KHz, so the maximum frequency deviation isffW
0:1151:5 KHz. In order to achieve a frequency deviation off75 KHz at the output of the
f75
n150
f1:5
2
ytAcos2 n1n2f0n1t
2
n1n2100104103=)n1n21040 orn2990
2)The maximum allowable drift (df) of the 100 kHz oscillator should be such that
2
n1n2df2=)df:0019 Hz
1040
Problem 4.7
Tm
1Zj
cnemtej2 nfmtdt
Tm0
TmZT
2m
1Zj1
ej2ejTm
ej2 nfmtej2 nfmt
2
2 njee>:sin
2l11 n2l1
127
Hence,
1
X2
ejmtsin1ej2 lfmt
l1 2l1
and
23
1
hiX2
utAcReej2 fctejmtAcRe4ej2 fctsin1ej2 lfmt5
l1 2l1
1
X2
sin1
Accos2 fclfmtl
l1 2l1
Problem 4.8
1d1
fitfctfc100mt
2dt2
. . . . .500
fc+
2
................
fc
. . .500
fc
2
0t
fmaxkfmaxjmtj1005250
2
Problem 4.9
fmfm104
1
X
utAcJncos2 fcnfmtn
n1
1
X
100Jn2cos2 108n104tn
n1
128
2
The power of the unmodulated carrier signal isP1005000. The power in the frequency
2
componentffck104is
1002J22
Pfk
ckfm
2
The next table shows the values ofJk2, the frequencyfckfm, the amplitude 100Jk2and the
0.223910822.39250.63
1.576710810457.671663.1
2.3528108210435.28622.46
3.1289108310412.8983.13
4.034010841043.405.7785
As it is observed from the table the signal components that have a power level greater than
500 (10% of the power of the unmodulated signal) are those with frequencies 108104and
signal components that have a power of at least 10% of the power of the unmodulated signal. The
components with frequencies 108104, 108104have an amplitude equal to 57:67, whereas the
Bc21fm2211046104Hz
Problem 4.10
1)
pkpmaxjmtj1:523
kfmaxjmtj30002
f6
fm1000
BFM2f1fm14100014000
1
X
utAJnpcos2 106n103t
n1
129
The next gure shows the amplitude of the spectrum for positive frequencies and for these compo-
J130:3391,J230:4861,J330:3091 andJ430:1320.
J(3)
. . . . . . . .A2
2
. . . . .AJ4(3)
2
fHz106
03
10
8103
utAcos2 fctfsin2000 t
1
X
AJn6cos2 106n103tn
n1
The next gure shows the amplitude of the spectrum for positive frequencies and for these compo-
n01234567
Jn6.1506-.2767-.2429.1148.3578.3621.2458.1296
. . . . . . . . . .AJ5(6)
2
f6
10
14103
pkpmaxjmtj1:5
kfmaxjmtj3000
f3
fm1000
BFM2f1fm810008000
The amplitude spectrum of the PM and FM modulated signals is plotted in the next gure for positive
frequencies. Only those frequency components lying in the previous derived bandwidth are plotted.
130
AJ(1.5)
1
2
AJ(1.5)
22
fHz6
10
5103
AJ(3)
22
AJ(3)
42
106fHz
8103
pkpmaxjmtj1:523
kfmaxjmtj30002
f3
fm2000
BPM2p1fm8200016000
BFM2f1fm8200016000
The amplitude spectrum of the PM and FM modulated signals is plotted in the next gure for positive
frequencies. Only those frequency components lying in the previous derived bandwidth are plotted.
Note that doubling the frequency has no eect on the number of harmonics in the bandwidth of the
PM signal, whereas it decreases the number of harmonics in the bandwidth of the FM signal from 14
to 8.
2103
AJ(3)
22
AJ4(3)
2
fHz6
10
16103
131
Problem 4.11
n01234
Jn.4720.5668.2497.0690.0140
2
The total power of the modulated signal isPtot1005000. To nd the eective bandwidth of
2
the signal we calculate the indexksuch that
kk
X1002X
J20:995000=J20:99
n)n
nk22nk2
By trial end error we nd that the smallest indexkis 2. Hence the eective bandwidth is
Be41034000
In the the next gure we sketch the magnitude spectrum for the positive frequencies.
3
10
100
J1()
2
2
fHz108
BPM2p1fm2110005141:6
2
As it is observed, Carsons rule overestimates the eective bandwidth allowing in this way some
Problem 4.12
1)Assuming thatutis an FM signal it can be written as
Z1
ut100 cos2 fct2 kfcos2 fmd
1
kf
100 cos2 fctsin2 fmt
fm
132
k
Thus, the modulation index isff4 and the bandwidth of the transmitted signal
fm
BFM2f1fm10 KHz
BFM2f12fm20 KHz
BPM2p1fm10 KHz
BPM2p12fm20 KHz
Problem 4.13
signal
utAcmtcos2 fct
Acm1tm2tcos2 fct
u1tu2t
where the inequality follows from the nonlinearity of the cosine function. Hence, angle modulation is
133
Problem 4.14
R
s
HsRL
RLs1s2Rs1
CsLLC
Thus,
2
42Rf2
L
jHf j2
12R
22
LC42f242Lf
f1p
2LC
Since this lter is to be used as a slope detector, we require that the frequency content of the signal,
which is806;806MHz, to fall inside the region over whichjHf jis almost linear. Such a
region can be considered the intervalf10; f90, wheref10is the frequency such thatjHf10j
5010311
42f22 f1010:1220
10
LLC
5010311
42f22 f9010:9220
90
LLC
L14:98 mHC0:018013 pF
Problem 4.15
The case oftcos2 fmthas been treated in the text, the modulated signal is
1
X
utAcJncos2 fcnfm
n1
1
X
100Jn5cos2 103n10
n1
n012345
Jn5-.178-.328.047.365.391.261
134
In the next gure we plot the magnitude and the phase spectrum for frequencies in the range
. . . . . . . .|U (f )|
00
J4(5)
12
fHz1000 1050950
\U (f )
.......
fHz95010501000
5
Z
4fm
cnfmejsin2 fmtej2 nfmtdt
1
4fm
2
1Zjn
ecosujnuej2du
20
n
ej2Jn
Hence,
"1#
X
utAcRecnej2 fctej2 nfmt
n1
"1#
Xn
AcReej2 fcnfmt2
n1
The magnitude and the phase spectra ofutfor5 and frequencies in the interval950;1000
Hz are shown in the next gure. Note that the phase spectrum has been plotted modulo 2in the
interval ; .
135
. . . . . . . .|U (f )|
00
J4(5)
12
fHz1000 1050950
\U (f )
..................
.......
2
.
.
.fHz95010501000
. . . . . . . . . . . . . . . . . . ...
2
Problem 4.16
fdtfitfckfmt
Zt
dt2 kfmd
1
In the next gure we plot the frequency and the phase deviation whenmtis as in Fig. P-4.16 with
kf25.
d(t)fd(t)
. . . . .. . . . . . . . . . .
5050
................ . . . . . . . . .
2525
5
.................41 3 6tt1 3 4 5 6
2525
. . . . . . . . . . . . .50
Problem 4.17
136
Using Carsons rule we obtain
8
>>>20020
kf10
<
kfmaxjmtj>
Bc21W21W20200k100
f
W>>>
>:
22000kf1000
Problem 4.18
fm812:5
Zt
ut10 cos22000t2 kf10 cos28d
1
1
X
10Jn12:5cos2 2000n8tn
n1
At the output of the BPF only the signal components with frequencies in the interval2000
32;200032will be present. These components are the terms ofutfor whichn 4; : : : ;4. The
1024X102
22
12:52J12:5500:263013:15
2J02n
n1
2
Since the total transmitted power isPtot1050, the power at the output of the bandpass lter is
2
only 26.30% of the transmitted power.
Problem 4.19
fitfckfm1t
1dkpd
fitfctfcm1t
2dt2dt
137
3)The maximum value ofm2tsinc2104tis 1 and it is achieved fort0. Hence,
maxfitmaxfckfm2t1061031:001 MHz
kfmaxjmtj
B21W22 KHz
W
Problem 4.20
we conclude that in order for the image frequencyf0to fall outside the interval88;108MHZ, the
c
minimum frequencyfIFis such that
2fIF10888=)fIF10 MHz
138
Computer Problems
1) Figures 4.1 and 4.2 present the message signal and its integral, respectively.
3) Using MATLABs Fourier transform routines, we obtain the expression for the spectrum of message
4)In this question, the bandwidth of the message signal is not nite, therefore to dene the index of
modulation, an approximate bandwidth for the message should be used in the expression
kfmaxjmtj
W(4.16)
dening the bandwidth as the width of the main lobe of the spectrum ofmtresults in
W20 Hz
and so
502
2010
1.5
0.5
0
m(t)
-0.5
-1
-1.5
-2
00.050.10.15
Time
1) Figures 4.6 and 4.7 present the message signal and its integral, respectively.
140
0.06
0.04
0.02
integral ofm(t)
-0.02
-0.04
-0.06
00.020.040.060.080.10.120.140.16
Time
Figure 4.2: The integral of the message signal for Computer Problem 4.1
1.5
0.5
0
u(t)
-0.5
-1
-1.5
-2
00.050.10.15
Time
141
0.12
0.1
0.08
0.06
|M(f )|
0.04
0.02
0
-500005000
Frequency
Figure 4.4: The magnitude spectrum of the message signal for Computer Problem 4.1
0.03
0.025
0.02
0.015
|U (f )|
0.01
0.005
0
-500005000
Frequency
Figure 4.5: The magnitude spectrum of the modulated signal for Computer Problem 4.1
142
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
-0.1-0.0500.050.1
Time
0.8
0.6
0.4
0.2
-0.2
integral ofm(t)
-0.4
-0.6
-0.8
-1
-0.1-0.0500.050.1
Time
Figure 4.7: The integral of the message signal for Computer Problem 4.2
143
-3
x 10
12
10
u(t)
4
-2
-0.1-0.0500.050.1
Time
3) The spectrum of the message and the modulated signals are shown in Figures 4.9 and 4.11,
respectively.
4) The plot of the demodulated signal is shown in Figure 4.11. As you can see, the demodulated
144
0.012
0.01
0.008
0.006
|M(f )|
0.004
0.002
0
-500005000
Frequency
Figure 4.9: The magnitude spectrum of the message signal for Computer Problem 4.2
0.1
0.09
0.08
0.07
0.06
0.05
|U (f )|
0.04
0.03
0.02
0.01
0
-500005000
Frequency
Figure 4.10: The magnitude spectrum of the modulated signal for Computer Problem 4.2
145
1
0.8
0.6
0.4
0.2
demodulated signal
0
-0.2
-0.4
-0.1-0.0500.050.1
Time
end
echo on ;20
[M,m,df1]=tseq(m,ts,df);% Fourier transform
M=M/fs;% scaling
f=[0:df1:df1*(length(m)1)]fs/2;% frequency vector
u=cos(2*pi*fc*t+2*pi*kf*intm);% modulated signal
[U,u,df1]=tseq(u,ts,df);% Fourier transform
U=U/fs;% scaling
[v,phase]=envphas(u,ts,250);% demodulation, nd phase of u
phi=unwrap(phase);% Restore original phase.
dem=(1/(2*pi*kf))*(di(phi)/ts);% demodulator output, dierentiate and scale phase
pause% Press any key to see a plot of the message and the modulated signal.30
subplot(2,1,1)
plot(t,m(1:length(t)))
xlabel(Time)
title(The message signal)
subplot(2,1,2)
plot(t,u(1:length(t)))
xlabel(Time)
title(The modulated signal)
pause% Press any key to see plots of the magnitude of the message and the
% modulated signal in the frequency domain.40
subplot(2,1,1)
plot(f,abs(tshift(M)))
xlabel(Frequency)
title(Magnitude spectrum of the message signal)
146
subplot(2,1,2)
plot(f,abs(tshift(U)))
title(Magnitude-spectrum of the modulated signal)
xlabel(Frequency)
pause% Press any key to see plots of the message and the demodulator output with no
% noise.50
subplot(2,1,1)
plot(t,m(1:length(t)))
xlabel(Time)
title(The message signal)
subplot(2,1,2)
plot(t,dem(1:length(t)))
xlabel(Time)
title(The demodulated signal)
function[v,phi]=envphas(x,ts,f0)
% [v,phi]=envphas(x,ts,f0)
% v=envphas(x,ts,f0)
%ENVPHAS returns the envelope and the phase of the bandpass signal x
% f0 is the center frequency.
% ts is the sampling interval.
%
if nargout ==2
z=loweq(x,ts,f0);
phi=angle(z);10
end
v=abs(hilbert(x));
function xl=loweq(x,ts,f0)
% xl=loweq(x,ts,f0)
%LOWEQ returns the lowpass equivalent of the signal x
% f0 is the center frequency.
% ts is the sampling interval.
%
t=[0:ts:ts*(length(x)1)];
z=hilbert(x);
xl=z.*exp(j*2*pi*f0*t);
147
Chapter 5
Problem 5.1
Let us denote byrn(bn) the event of drawing a red (black) ball with numbern. Then
5.E5 fr2; r4; b2g [fr2; r3; r4g \ fr1; r2; b1; b2g
Problem 5.2
Solution:
Since the seven balls equally likely to be drawn, the probability of each eventEiis proportional to its
cardinality.
33453
P E1; P E2; P E3; P E4; P E5
77777
Problem 5.3
Solution:
Let us denote byXthe event that a car is of brand X, and byRthe event that a car needs repair
1)
P RP A; RP B; RP C; R
100100100100100100
11:5
100
2)
148
Problem 5.4
Solution:
If two events are mutually exclusive (disjoint) thenP A[BP A[P Bwhich implies that
P A\B0. If the events are independent thenP A\BP A\P B. Combining these two
P A\BP AP B0
Problem 5.5
Let us denote bynSthe event thatnwas produced by the source and sent over the channel, and by
1)
:8:7:2:3:62
where we have used the fact thatP 1S:7,P 0C:3,P 1Cj0C:2 andP 1Cj1S1:2:8
2)
Problem 5.6
1)Xcan take four dierent values. 0, if no head shows up, 1, if only one head shows up in the four
ips of the coin, 2, for two heads and 3 if the outcome of each ip is head.
3)
01
k
XB3
Cm
FXk@Ap1p3m
m0m
Hence
8
>>>0
k <0
>>>
>>>3
1pk0
>>>
>><3
1p3p1p2k1
FXk
>>>1322
p3p1p3p1p k2
>>>
>>>3
1p3p1p23p21pp31k3
>>>
>>:
1k >3
149
CDF
. . . . . . . . . . . . .1
.........
.....
1p3
43210-1
4)
01
3
XB3
Ck
P X >1@Ap1p3k3p21p1p3
k2k
Problem 5.7
1) The random variablesXandYfollow the binomial distribution withn4 andp1=4 and 1=2
respectively. Thus
0101
41044414
33BC1
C
P X0B@A8P Y0@A4
0442022
0101
41133414
334BC4
C
P X1B@A8P Y1@A4
1442122
0101
41223414
332BC6
C
P X2B@A8P Y2@A4
2442222
0101
4131414
334BC4
C
P X3B@A8P Y3@A4
3442322
0101
4140414
31BC1
C
P X4B@A8P Y4@A4
4442422
2)
34334234223421886
2122122122122124096
150
3)
P Y2P X3P X4
P Y3P X4
535
4096
P5Pl
4) In generalP XY5P XlmP Ym. However it is easier to nd
l0m0
P XY5throughP XY51P XY >5because fewer terms are involved in the
10.
4096
Problem 5.8
3)
113
P 1< X1FX1FX1
2244
4)
1111
P 1< X <1FX1FX
22244
5)
P X >21P X21FX2110
151
Problem 5.9
1)
x <1)FXx0
Zx
x
1x0)FXxv1dv1v2v1x2x1
12122
Z0Zx
0x1)FXxv1dvv1dv 1x2x1
1022
1x)FXx1
2)
171
pX >11FX1
2288
and
pX >0; X <1FX1FX03
pX >0X <122
2pX <117
21pX >2
pXx; X >1
FXxX >1pXxX >12
22pX >1
2
FXxFX1
FXxX >12
21F1
X
2
8
fXx1
><x
1>2
fXxX >11FX2
2>:01
x
2
4)
Z1
1FX1=21
2
Z1
11
8xx1dx81x3x2
11
2322
2
152
Problem 5.10
P X > Qm
Therefore,
P X >7Q74Q10:158
3
P 0< X <9Q04Q941Q1:33Q1:660:858
33
Problem 5.11
1) The random variableXis Gaussian with zero mean and variance2108. ThusP X > x
Qxand
!
4
P X >104Q10Q1:159
104
!
4
P X >4104Q410Q43:17105
104
P 2104< X1041Q1Q2:8182
2)
44
3)ygxxux. ClearlyfYy0 andFYy0 fory <0. Ify >0, then the equation
FY0FY0FX01
2
The general expression for ndingfYycan not be used becausegxis constant for some interval
153
4)
Z1
EYyfYydy
1
Z1
yfXyuy1ydy
12
12
y
1Z2
pye2dyp
2 202
5)ygx jxj. For a giveny >0 there are two solutions to the equationygx jxj, that is
x1fXx2
fYyfXfXyfXy
jsgnx1jjsgnx2j
2
2y
pe22
22
Problem 5.12
1)ygxax2. Assume without loss of generality thata >0. Then, ify <0 the equation
yax2has no real solutions andfYy0. Ify >0 there are two solutions to the system, namely
p
x1;2y=a. Hence,
x1fXx2
fYyfX
jg0x1jjg0x2j
pp
fXy=afXy=a
pp
2ay=a2ay=a
1y
2
ppe2a
ay2 2
gxb < yfor everyx; henceFYy1. At the pointsy b,FYyis discontinuous and the
discontinuities equal to
FYbFYbFXb
and
FYbFYb1FXb
fYyFXbyb1FXbybfXyu1ybu1yb
y2
Qbybyb1pe22u1ybu1yb
22
154
3) In the case of the hard limiter
P YbP X <0FX01
2
P YaP X >01FX01
2
fYyFX0yb1FX0ya
P YynP anXan1FXan1FXan
Thus,FYyis a staircase function withFYy0 ify < x1andFYy1 ify > xN. The PDF is a
N
X
fYyFXaiFXaiyxi
1
i1
N
Xa
QiQai1yxi
i1
Problem 5.13
1arctanx
Furthermore
!0
sin1sin2
x011x2
coscos2cos2
Thus,
1
fXxf1
jx0j 1x2
1
222
XEXEX
12
1Zx
dx 1
11x2
155
Problem 5.14
1)
Z1Z1
EYyfYydyyfYydy
0
Z1
yfYydyP Y
ThusP YEY =.
2) ClearlyP jXEXj> P XEX2> 2. Thus using the results of the previous question
we obtain
EXEX22
P jXEXj> P XEX2> 2
22
Problem 5.15
@Apevk1pnkpejv1pn
k0k
Thus
1d1
EXm1pejv1pnnpejv1pn1pjejv
X
jdvv0jv0
np1pn1pnp
2
EX2m21dpejv1pn
X2
dvv0
hi
1dnpejv1pn1pjejv
dvv0
hi
nn1pejv1pn2p2e2jvnpejv1pn1pejv
v0
nn1p1pp2np1pp
nn1p2np
222222
EXEXnn1pnpnpnp1p
156
Problem 5.16
1d1jv1
EXm1 Xveejejv
X
jdvv0jv0
2hji
v1
EX2m21d Xv1deeejvj
X2
dvv0dvv0
hji
2ev1jvejv1jv2
eeee
v0
22222
EXEX
Problem 5.17
Fornodd,xnis odd and since the zero-mean Gaussian PDF is even their product is odd. Since the
integral of an odd function over the interval1;1is zero, we obtainEXn0 forneven. Let
R1
Inxnexpx2=22dxwithneven. Then,
1
#
1"x22
dZn1x
nx1e22xn1e22dx0
dxIn12
Z1"x#
d222n1x21x2
Innn1xn2e22xne22xn2e22dx
dx2124
2n11
nn1In2InIn20
24
Thus,
In222n1In4nn1In2
pp
with initial conditionsI02 2,I222 2. We prove now that
p
In135 n1n2 2
p
The proof is by induction onn. Forn2 it is certainly true sinceI222 2. We assume that
the relation holds fornand we will show that it is true forIn2. Using the previous recursion we
have
p
In2135 n1n22n12 2
p
135 n3n1nn242 2
p
135 n1n1n22 2
ClearlyEXn1pInand
22
EXn135 n1n
157
Problem 5.18
1)fX;Yx; yis a PDF so that its integral over the support region ofx,yshould be one.
Z1Z1Z1Z1
fX;Yx; ydxdyKxydxdy
0000
"Z1#
Z1Z1Z1
Kxdxdyydxdy
0000
"1#
111
K1x2y1y2x
200200
ThusK1.
2)
P XY >11P XY1
Z1Z1
x
1xydxdy
00
Z1Z1Z1Z1
xx
1xdydxdxydy
0000
Z1Z1
1x1xdx11x2dx
002
2
3) By exploiting the symmetry offX;Yand the fact that it has to integrate to 1, one immediately sees
that the answer to this question is 1/2. The mechanical solution is:
Z1Z1
P X > Yxydxdy
0y
Z1Z1Z1Z1
xdxdyydxdy
0y0y
Z1Z1
111
x2dyyxdy
02y0y
Z1Z1
1
1y2dyy1ydy
020
1
2
4)
158
The region over which we integrate in order to ndP X > Y ; X2Y >1is marked with anAin the
following gure.
y(1,1)
.A
.
.
.
x
1/3x+2y=1
Thus
Z1Zx
P X > Y ; X2Y >1xydxdy
11x
32
Z1
1x11x
22
1xxxdx
3222
Z1
1511
2
1xxdx
3848
49
108
Z1Z1
P X2Y >1xydxdy
01x
2
Z1
x11x111x2dx
0222
Z1
333
x2xdx
0848
31131131
32
83x042x08x0
7
P XY 0
6) Conditioned on the fact thatXY, the new p.d.f ofXis
x; x
fXjxfX;YR12x:
XY
0fX;Yx; xdx
159
7)
Z1Z1
fXxxydyxydyx1
002
Z1Z1
fYyxydxyxdxy1
002
8x8x8x
Hence,
3263
xx363
fXxjX2Y >1888x2x
P X2Y >1777
Z1
EXjX2Y >1xfXxjX2Y >1dx
0
Z1
363
x3x2x
0777
31161131117
432
74x073x072x028
Problem 5.19
1)
Since the previous events are not necessarily disjoint, it is easier to work with the function 1
1FXy1FXy 1FXy
12n
nnn
YYY
fYyfXy1FXyfXy1FXy fXy1FXy
1i2ini
i1i2in
2)
160
Dierentiating the previous with respect tozwe obtain
nnn
YYY
fZzfXzFXzfXzFXz fXzFXz
1i2ini
i1i2in
Problem 5.20
Z1Z1
x2x2
EXxxe22dx1x2e22dx
0220
However for the Gaussian random variable of zero mean and variance2
12
1Z2x
pxe22dx2
2 21
Thus,
p1r
EX12 22
2
22
00
12
x21 Zx
x2e222xe22dx
00
Z1
xx2
022e22dx22
02
Thus,
V ARXEX2EX222222
22
Problem 5.21
LetZXY. Then,
Z1Zz
y
FZzP XYzfX;Yx; ydxdy
11
161
where the last line follows from the independence ofXandY. ThusfZzis the convolution of
Zz
fZzevezvdv
0
Ifthen
Zz
fZz2ezdv2zezu1z
0
Ifthen
Zz
hi
fZzezevdvezezu1z
0
Problem 5.22
1)fX;Yx; yis a PDF, hence its integral over the supporting region ofx, andyis 1.
Z1Z1Z1Z1
fX;Yx; ydxdyKexydxdy
0y0y
Z1Z1
Keyexdxdy
0y
Z1
1
Ke2ydyK1e2yK1
0202
ThusKshould be equal to 2.
2)
Zx
x
fXx2exydy2exey2ex1ex
00
Z1
1
fYy2exydy2eyex2e2y
yy
3)
fXxfYy2ex1ex2e2y2exy2ey1ex
2exyfX;Yx; y
x; y2exy
fUufXjxjyfX;Yexyeu
Y
fYy2e2y
162
5)
Z1Z1
EXjYyxexydxeyxexdx
yy
"1#
Z1
eyxexexdx
yy
eyyeyeyy1
6) In this part of the problem we will use extensively the following denite integral
Z1
x1exdx11!
0
Z1Z1Z1Z1
EXYxy2exydxdy2yeyxexdxdy
0y0y
Z1Z1Z1
2yeyyeyeydy2y2e2ydy2ye2ydy
000
212!211!1
2322
Z1Z1Z1
EX2xex1exdx2xexdx2xe2xdx
000
2213
222
Z1
EY 2ye2ydy211
0222
Z1Z1Z1
EX22x2ex1exdx2x2exdx2x2e2xdx
000
22!212!7
232
Z1
EY22y2e2ydy212!1
0232
Hence,
and
COV X; Y1
X;Yp
EX2EX21=2EY2EY 21=25
Problem 5.23
163
Z
EX1cosd1sin0
00
Z
EY 1sind1cos2
00
Z
EXYcossin1d
0
2
1Z1Z
sin 2dsinxdx0
2040
COV X; Y EXY EXEY 0
Thus the random variablesXandYare uncorrelated. However they are not independent since
Problem 5.24
pp
1) ClearlyX > r,Y > rimplies thatX2> r2,Y2> r2so thatX2Y2>2r2orX2Y2>2r.
pp
Thus the eventE1r fX > r ; Y > rgis a subset of the eventE2r fX2Y2>2rX; Y >0g
2) SinceXandYare independent
p
3) Using the rectangular to polar transformationVX2Y2,arctanYit is proved (see text
X
Eq. 4.1.22) that
v2
fV ;v; ve22
22
1Z22
ppZv
v
PX2Y2>2rX; Y >0pe2dvd
2r02
1221
1
v v
1Z
ve2dve2
4p2r4p
2r
12
r
4e
2 1r2
Q2r 1erorQre2
42
164
Problem 5.25
REAL*8x,t,a,q,pi,p,b1,b2,b3,b4,b5
PARAMETER(p=.2316419d+00, b1=.31981530d+00,
+ b2=-.356563782d+00, b3=1.781477937d+00,
+ b4=-1.821255978d+00, b5=1.330274429d+00)
C-
pi=4.*atan(1.)
C-INPUT
PRINT*,Enter -x-
READ*,x
C-
t=1./(1.+p*x)
q=(exp(-x**2./2.)/sqrt(2.*pi))*a
C-OUTPUT
PRINT*,q
C-
STOP
END
The results of this approximation along with the actual values ofQx(taken from text Table 4.1)
are tabulated in the following table. As it is observed a very good approximation is achieved.
xQxApproximation
1.1:591011:587101
1.56:681026:685102
2.2:281022:276102
2.56:211036:214103
3.1:351031:351103
3.52:331042:328104
4.3:171053:171105
4.53:401063:404106
5.2:871072:874107
Problem 5.26
165
The joint distribution ofXandYis given by
801019
><2>=
0X
CBC
fX;Yx; y1exp1X YB@A@A>
2 2>:22;
0Y
Thus,
8019
><Z>=
BC
fZ;Wz; w1exp1Z WM1@A>
2detM1=2>:2;
W
where010101
2222
02Z
CtBCBZ;WZWC
MAB@AA@A@A
02252Z2
;WZWW
p
From the last equality we identify222,252and Z1=10
ZW;W
Problem 5.27
p
x; y2 Y
fXjYxjyfX;YqexpA
fYy2
2 XY1X
;Y
where
222
ymYxmXymYymY
AxmX2
21222122212XY22
X;YXX;YYX;YY
2!
1ymY22xmXymYX
;Y
xmX2XX2
21222Y
X;YXY
1X2
xmXymY
2122Y
X;YX
Thus
(2)
fXjYxjy1qexp1xmXymYX
p22
2 X1221X;YXY
X;Y
independent. If 1 then the variance offXjYxjyis zero which means thatXjYis deterministic.
166
Problem 5.28
1)ZandWare linear combinations of jointly Gaussian RVs, therefore they are jointly Gaussian too.
2) SinceZandWare jointly Gaussian with zero-mean, they are independent if they are uncorrelated.
This implies that they are independent ifEZW 0. ButEZW EXY cos2sin2where
we have used the fact that sinceXandYare zero-mean and have the same variance we have
cos2sin20=)k; k2 Z
42
Note also that ifXandYare independent, thenEXY 0 and any rotation will produce independent
Problem 5.29
1)fX;Yx; yis a PDF and its integral over the supporting region ofxandyshould be one.
Z1Z1
fX;Yx; ydxdy
11
Z0Z0Z1Z1
Kx2y2Kx2y2
e2dxdye2dxdy
1100
02Z02Z12Z12
xyKxy
KZ
e2dxe2dxe2dxe2dx
1100
K1p
22 2K
2
ThusK1
167
3)fX;Yx; yhas not the same form as a binormal distribution. Forxy <0,fX;Yx; y0 but a
4) The random variablesXandYare not independent for ifxy <0 thenfXxfYy0 whereas
fX;Yx; y0.
5)
Z0Z0Z1Z1
x2y2x2y2
EXY 1XY e2dxdy1e2dxdy
1100
02Z02Z12Z12
1
xy xy
1Z
Xe2dxY e2dyXe2dxY e2dy
1100
112
11
EXY EXEY 0.
x;y
6) In generalfXjx; yfX;Y. Ify >0, then
Y
fYy
8
><0
x <0
fXjx; yqx2
Y
>:2
e2x0
Ify0, then
8
><0
x >0
fXjx; yqx2
Y
>:2
e2x <0
Thuss
x2
fXjx; y2e2uxy
Y
()
22
fX;Yx; y1expxmy
2 222
2 222
()
vv2m22mvcos
exp
2 222
168
To obtain the marginal probability density function for the magnitude, we integrate overso that
Z2
v2m2mvcos
fVvve22e2d
02 2
2
mvcos
vv2m21Z2
2
2e2ed
20
vv2m2mv
2
2e2I02
where
2
mvcos
mv1Z2
I0ed
2
20
Withm0 we obtain
8v
><v2
e22v >0
fVv2
>:
0v0
Problem 5.31
22
P jZ500j 2000Y)P 5002000Z50020001Y
22
Pn
The variance2ofY1Xiis12, where2p1p3(see Problem 4.13). Thus, with
Yni1nXiXi16
0:001 we obtain
P 480Z52013=16:063
2101
Pn
2)Using the C.L.T. the CDF of the random variableY1Xiconverges to the CDF of the random
ni1
variableNmX;p. Hence
in
0101
480520
nmXinmXi
AQ@A
Pp480Y520Q@
nn
Withn2000,mX1,2p1pwe obtain
i4n
!!
PQ480500pQ520500p
2000p1p2000p1p
12Q20p:682
375
169
Problem 5.32
mXt0EXt0EX0
Problem 5.33
mXtEABtEAEBt0
where the last equality follows from the fact thatA,Bare uniformly distributed over1 1so that
EAEB0.
RXt1; t2EXt1Xt2EABt1ABt2
EA2EABt2EBAt1EB2t1t2
Z1
1111
EA2EB2x2dxx3
12613
Thus
11
RXt1; t2t1t2
33
Problem 5.34
for allt1; : : : ; tnandn. Hence, the statistical properties of the process are time independent and by
Problem 5.35
1)f cannot be the autocorrelation function of a random process forf 00< f 1=4f01.
Thus the maximum absolute value off is not achieved at the origin0.
170
3)f 01 whereasf > f 0forjj>1. Thusf cannot be the autocorrelation function of a
random process.
4)f is even and the maximum is achieved at the origin (0). We can writef as
f 1:211
As we observe the power spectrumSf can take negative values, i.e. forf0. Thusf can not
Problem 5.36
EXEX2tdt
1
Z1Z1
E!2e2tu2tdtE!2e2tdt
1i10i
Z1Z1
6
X
E!2e2tdt1i2e2tdt
0i06
i1
11
91Z2911
etdte2t
60620
91
12
Thus the process is an energy-type process. However, this process is not stationary for
mXtEXtE!ietu1t21etu1t
6
is not constant.
Problem 5.37
pNnevenpN0pN2pN4
2
11X
11
l0
11
12
12
1
1
12
171
The probabilitypNnoddis simply 1pNneven. The random processZttakes
12
the value of 1 (at time instantt) if an even number of transitions occurred given thatZ01, or if
mZtEZt1pZt10pZt0
pZt1jZ01pZ01pZt1jZ00pZ00
pNneven1pNnodd1
22
1
occurred in the intervalt; t, or ifZt0 and an odd number of transitions have taken place
RZt; tEZtZt
pZt1; Zt1pZt1jZt1pZt1
11
212
As it is observedRZt; tdepends only onand thus the process is stationary. The above is for
Since the process is WSS its PSD is the Fourier transform of its autocorrelation function, nding the
Fourier transform of the autocorrelation function is not an easy task. We can use integral tables to
show that
2sinSi2cosCi
where
Zx
Sixsintdt
0t
Zx
Cix lnxcost1dt
0t
Finding the power content of the process is much easier and is done by substituting0 in the
PZRZ01
2
172
Problem 5.38
1)
2)
2tcos2 f0
2cos2 f0
2
cos2 f02t
2cos2 f0
2
cos2 f0
where we have used the fact thatEXY 0. Thus the process is stationary forRXt; tdepends
only on.
3) The power spectral density is the Fourier transform of the autocorrelation function, hence
2
Sfff0ff0:
X
2
4) If22, then
XY
X
2tcos2 f0
2cos2 f0
2
Y
cos2 f02t
2cos2 f0
22
XY
2t
2cos2 f0
22
XY
2cos2 f0
The process is not stationary forRXt; tdoes not depend only onbut ontas well. However
the process is cyclostationary with periodT01. Note that ifXorYis not of zero mean then the
2f0
period of the cyclostationary process isT01.
f0
Problem 5.39
If we lett1t2, then using the previous result and the fact thatXt,Y tare jointly stationary,
Taking the Fourier transform of both sides of the previous relation we obtain
Sf FRXY FRY X
XY
Z1
RY Xej2 f d
1
Z1
0
RY X0ej2 fd0 Sf
1Y X
Problem 5.40
1)Sf N0,RXN0. The autocorrelation function and the power spectral density of the
X
22
output are given by
f
Sf N0
Y
22B
174
Taking the inverse Fourier transform of the previous we obtain the autocorrelation function of the
output
RY2BN0sinc2BBN0sinc2B
2
2)The output random processY tis a zero mean Gaussian process with variance
222
Y tEYtEYtRY0BN0
Y tY t
Y tY tBN0BN0
Since the processes are Gaussian and uncorrelated they are also independent.
Problem 5.41
The impulse response of a delay line that introduces a delay equal toishtt. The
RYRX ? h ? h
But,
Z1
h ? httdt
1
Z1
ttdt
1
Z1
t0t0dt0
1
Hence,
RYRX ? RX
This is to be expected since a delay line does not alter the spectral characteristics of the input
process.
175
Problem 5.42
The converse of the theorem is not true. Consider for example the random processXt
mXtcos2 f0tmX
is a function of time. However, passing this process through the LTI system with transfer function
f
Problem 5.43
mYtmX0tmXt00
RXX0RX ? 0 RX ? 0 R0
X
ThusRXX0is an odd function and its value at the origin should be equal to zero
RXX000
RZRXRX0RXX0RX0
X
Sf Sf S0f 2ReS0f
ZXXXX
Sf Sf S0f
ZXX
176
Problem 5.44
that the output process is a stationary. This is true sinceY tc LXtcfor allc, so ifXt
2
Sf Sf 42f21ej2 f T
YX
Sf 42f21cos2 f T 2sin22 f T
X
Sf 82f21cos2 f T
X
3)The frequencies for whichjHf j20 will not be present at the output. These frequencies are
Problem 5.45
Sf 21cos2 f T
X
Sf 142f2
X
Sf 142f24 fsin2 f T
X
Problem 5.46
Using Schwartzs inequality
E2XtY tEX2tEY2tRX0RY0
177
where equality holds for independentXtandY t. Thus
1
The second part of the inequality follows from the fact 2aba2b2. Thus, withaR1=20and
X
bR1=20we obtain
Y
R1=20R1=201RX0RY0
XY
2
Problem 5.47
1)
RXYRX ? RX ?
ejj? ejj
RYRXY ? ejj?
ejj
2)
Z1
jvj
RXYejj? 1edv
1tv
Z1Z1
jvj
RYRXY ?1e1dsdv
11svs
(5.17)
RY F1Sf 2ejj
Y
Sf Sf jHf j2 Sf 12
YXX
2222222
4f4f
Since2aejj, applying the dierentiation in the frequency domain result we have
222
4f
d22
ajj
df242f2je
resulting in
j2 f 2
jj
2222ae
4f2
178
Now we can apply integration in the time domain result to conclude that
21Zj
uj
2222auedu
4f21
Integration of the right hand side is simple and should be carried out considering <0 and >0
ForSf we have
XY
Sf Sf Hf 2 2j2 f
XYX
222 2222
4fj2 f2f
or"#"#
22j2 f 2
RXY F1 F1
22222222
4f4f
The inverse Fourier transform of the rst term we have already found, for the second term we apply
11d11
RXYejjjjejjejjjjejj
22d222
This simplies to
11
RXYejj jj
2
Sf Sf Hf 21j2 f
XYX
222
4f1j2 f
411111
Thus,
RXY F1Sf
XY
411
eu1eu1eu1
1211
22
For the output power spectral density we haveSf Sf jHf j2 Sf 14f Sf .
YXX22X
14f
Hence,
RY F1Sf ejj
X
RXYejj?1ejj?1
2T2T2T2T
T
1Zj
evjdv
2TT
179
IfT, then
1T1
RXY ev eT eT
2TT2T
If 0 < T, then
0ZT
1Zv1
RXYedvevdv
2TT2T0
1
TT
2T 2e e
RYejj?1 ?1
2T2T2T2T
ejj?1
2T2T
2T
1Zjxj
1ejxjdx
2T2T2T
If2T, then
eh2i
RYeTe2T2
2T 2
If 0 <2T, then
e2T1e
RYee2
4T22T 2T224T22
Problem 5.48
Consider the random processesXtXej2 f0tandY tY ej2 f0t, whereXandYare iid random
Problem 5.49
1.The power is the area under the power spectral density, which has a triangular shape with a
Z1
PxSf df1210541054 W
X
12
180
2. The range of frequencies are105;105, hence the bandwidth is 105Hz or 100 kHz.
4105f;jfj<0:5105
ff<105
Sf Sf jHf j24105
YX
105105:0;otherwise
and the total power is the area underSf . Plot ofSf is shown below
YY
Sf
Y
4105
f
0:51050:5105
Therefore,
Z1
1
PYSf df105210510521053 W
Y
12
mean equal to zero. The variance inX0isEX20which is equal toRX0, i.e, the power in
5.Since for Gaussian random variables independence means uncorrelated, we need to nd the
Problem 5.50
1. The power isPXRX04 Watts.
2. We have
f
Sf FRX4104
X
104
181
3.Sf occupies the frequency range104;104, therefore the bandwidth is 104Hz or 10 kHZ.
X
4. We have
8
4104fjfj<5103
ff<104
Sf Sf jHf j24104
YX
104104:0 otherwise
Sf
Y
4104
f
0:51040:5104
R1
andPYSf df1042104110421043 W
1Y2
5.SinceXtis Gaussian and zero-mean, all random variables are zero-mean Gaussian with
are uncorrelated, and since they are jointly Gaussian, they are also independent. ForX0
Problem 5.51
1.The impulse response of the system is obtained by puttingxtt. The output, which is
We can usemYmXH021012.
8
<10322
1f;jfj 200
2.Sf Sf jHf j2Sf 12f2
YXX
:0
;otherwise
182
3. We have
Z1Z200
2
PYSf df210312f2 df4001610652638:3 W
Y
103
4.Y tis the result of passing a WSS process through an LTI system, therefore it is WSS.
5.Y tis the result of passing a Gaussian process through an LTI system, therefore it is Gaussian.
R1
Problem 5.52
1.The transfer function fromXttoY tis the Fourier transform of the impulse responseht
2.
8
N0
<122
16f;jfj W
Sf Sf f2
ZY
2W:0;otherwise
R1
Z2116f df3372:8N0
02
5. The power inY tis the integral ofSf over all frequencies which is innite.
Y
Problem 5.53
1)
Z
4
EXt4Acos2 f0td
4A4
sin2 f0t
0
4A
sin2 f0tsin2 f0t
4
183
RXt; tEA2cos2 f0tcos2 f0t
A2
2tcos2 f0
2Ecos2 f0
A2A2
2t
2cos2 f02Ecos2 f0
4
A2A24Z
cos2 f02td
2cos2 f020
A2A2
2cos2 f0
which is periodic with periodT01. Thus the process is cyclostationary with periodT1. Using
2f0f0
the results of Problem 4.48 we obtain
ZT
Sf F1RXt; tdt
X
T0
" ZT#
22
A
FAcos2 f0cos2 f02tsin2 f02tdt
2T0
"#
2
FAcos2 f0
2
A2
ff0
4ff0
2)
RXt; tEXtXtEXY XY
EX2EY2EY XEXY
EX2EY22EXY
where the last equality follows from the independence ofXandY. But,EX0 sinceXis uniform
on1;1so that
112
RXt; tEX2EY2
333
The Fourier transform ofRXt; tis the power spectral density ofXt. Thus
Sf FRXt; t2f
X
3
Problem 5.54
2
Sf Sf jHf j2
YX
2222
4f
184
If, then
2
Sf Sf jHf j2
YX
222222
4f4f
Problem 5.55
1)LetY tXtNt. The processXtis the response of the systemhtto the input process
Y tso that
RRY ? h
YX
RXRNRXNRNX ? h
Also by denition
REXtNtXtRR
YXXXNX
RRN ? hRNX ? h
XX
Substituting this expression forRin the previous one, and cancelling common terms we obtain
YX
RRX ? hRXN ? h
XX
2)
hi
EXtXt2RX0R0R0R0
XXXXX
hi
We can writeEXtXt2in terms of the spectral densities as
Z1
hi
EXtXt2Sf Sf 2Sf df
X
1XXX
Z1
h
Sf Sf Sf 2ReSf jHf j2
XXNXN
1
2Sf Sf Hf df
XXN
hi
To nd theHf that minimizesEXtXt2we set the derivative of the previous expression,
f Sf
Hf SXXN
Sf Sf 2ReSf
XNXN
RXNEXtNtEXtENt
f
Hf SX
Sf N0
X
2
185
hi
The corresponding value ofEXtXt2is
Z1
hiS
f N0
EminXtXt2Xdf
12SXf N0
1
f21
Hf1
112f2
1f2
Problem 5.56
Then,
EXtXt2EXtXtXtXt2
EXtXt2EXtXt2
EXtXtXtXt
But,
EXtXtXtXt
EXtXtZt ? htgt
Z1
EXtXthgZtd
1
Z1
hi
EXtXtZthgd0
1
hi
where the last equality follows from the assumptionEXtXtZt0 for allt,. Thus,
EXtXt2EXtXt2EXtXt2
EXtXt2EXtXt2
2)
EXtXtZt0)EXtZtEXtZt
f
Sf Sf Hf orHf SXZ
XZZ
Sf
Z
186
4)
hi
E2tEXtXtXtXt
EXtXtEXtXt
Z1
RX0EZtvhvXtdv
1
Z1
RX0RZXvhvdv
1
Z1
RX0RXZvhvdv
1
Problem 5.57
Problem 5.58
1)The power spectral density of the in-phase and quadrature components is given by
8
><S
ff0 Sff0jfj<7
n
Sf Sfn
ncns
>:0
otherwise
If the passband of the ideal lter extends from 3 to 11 KHz, thenf07 KHz is the mid-band
frequency so that
8
><N
jfj<7
Sf Sf0
ncns
>:0
otherwise
187
2)Withf0=6 KHz
8
N0
>>>3
2<jfj<5
><
Sf SfNjfj<3
ncns0
>>>
>:
0 otherwise
Hence,
t4N0t4
Rnn F1jN0j
cs
2222
jN02sinc2ej24jN02sinc2ej24
22
2N0sinc2sin24
Problem 5.59
where we have used the factpctptcos2 f0tptsin2 f0t. Similarly for the quadrature
component
XstXtcos2 f0tXtsin2 f0t
1
X
AnptnT cos2 f0tnT
n1
1
X
AnptnT sin2 f0tnT
n1
1
X
AnptnT cos2 f0tnT ptnT sin2 f0tnT
n1
1
X
AnpstnT
n1
188
Problem 5.60
q
V tX2ctX2st
both the in-phase and quadrature components are lowpass processes and this makesV ta lowpass
Problem 5.61
Hence,
8
><N
jfj< W
Sf Sf0
ncns
>:0
otherwise
RW
The power content of the in-phase and quadrature components ofntisPnN0df2N0W
W
8v
2
><v2
e4N0Wv0
fVv2N0W
>:
0 otherwise
3)Xtis given by
follows the Rician distribution (see Problem 4.31). The density function of the envelope is given by
8v
2
><v2A
I0Ave4N0Wv0
fVv2N0W2N0W
>:
0 otherwise
where
Z
I0x1excosudu
2
189
Problem 5.62
1)The power spectral densitySf is depicted in the following gure. The output bandpass process
n
has non-zero power content for frequencies in the band 4910 6 jfj 51106. The power
content is
Z496Z516
1010
P1081fdf1081fdf
5110610849106108
49106491065110651106
11
108x1016x2108x1016x2
5110625110649106249106
2102
108
51075107108
NtNctcos250106tNstsin250106t
NctNtcos250106tNtsin250106t
NstNtcos250106tNtsin250106t
EjNctj2EjNtj2cos2250106tEjNtj2sin2250106t
EjNtj22102
2102.
8
><S
f50106 Sf50106jfj 50106
N
Sf SfN
NcNs
>:0
otherwise
Sf is depicted in the next gure. The power content ofSf can now be found easily as
NcNc
Z106
PNPN108df2102
cs
106
190
108
106106
Z496
10
PYf491061081016f df
51106
Z516
10
f491061081016f df
49106
4
2104102
3
The power spectral density of the in-phase and quadrature components of the output process is
given by
Sf Sf f5010649106 1081016f50106
YcYs
f5010649106 1081016f50106
21016f2102
forjfj 106and zero otherwise. The power content of the in-phase and quadrature component is
Z106
PYPY21016f2102df
cs
106
66
11010
21016f3102f
31066
10
4
2104102PY
3
Computer Problems
Computer Problem 5.1
We rst generate the uniformly distributed random variableuiby using matlab function rand, then
191
Figure 5.1 presents the plot of the histogram of the 10000 randomly generated samples. It should be
noted that this histogram of the random variables is similar to linear probability density function
f x.
1) The MATLAB function that implements the method given in the question is given as
function[gsrv1,gsrv2]=gngauss(m,sgma)
% [gsrv1,gsrv2]=gngauss(m,sgma)
% [gsrv1,gsrv2]=gngauss(sgma)
1200
1000
800
600
400
200
0
00.511.52
192
3500
3000
2500
2000
1500
1000
500
0
-6-4-20246
% [gsrv1,gsrv2]=gngauss
% GNGAUSS generates two independent Gaussian random variables with mean
% m and standard deviation sgma. If one of the input arguments is missing,
% it takes the mean as 0.
% If neither the mean nor the variance is given, it generates two standard
% Gaussian random variables.
if nargin ==0,10
m=0; sgma=1;
elseif nargin ==1,
sgma=m; m=0;
end;
u=rand;% a uniform random variable in (0,1)
z=sgma*(sqrt(2*log(1/(1u))));% a Rayleigh distributed random variable
u=rand;% another uniform random variable in (0,1)
gsrv1=m+z*cos(2*pi*u);
gsrv2=m+z*sin(2*pi*u);
2) Figure 5.2 presents the plot of the histogram of the 10000 randomly generated samples. It should
be noted that this histogram of the random variables is similar to the Gaussian probability density
functionfXx.
193
0.09
0.08
0.07
0.06
0.05
(m)
x
R
0.04
0.03
0.02
0.01
-0.01
01020304050
m
The MATLAB script that implements the generation of the sequencefXng, the computation of the
autocorrelation, and the computation of the power spectrumSf is given next. We should note
x
that the estimates of the autocorrelation function and the power spectrum exhibit a signicant
variability. Therefore, it is necessary to average the sample autocorrelation over several realizations.
RmandS
xxf presented in Figures 5.3 and 5.4 are obtained by running this program using the
average autocorrelation over ten realizations of the random process.
194
0.14
0.12
0.1
0.08
(m)
x
S
0.06
0.04
0.02
0
-0.500.5
f
function[Rx]=Rxest(X,M)
% [Rx]=Rxest(X,M)
% RXEST estimates the autocorrelation of the sequence of random
% variables given in X. Only Rx(0), Rx(1), . . . , Rx(M) are computed.
% Note that Rx(m) actually means Rx(m-1).
N=length(X);
Rx=zeros(1,M+1);
for m=1:M+1,
for n=1:Nm+1,
Rx(m)=Rx(m)+X(n)*X(n+m1);10
end;
Rx(m)=Rx(m)/(Nm+1);
end;
195
1
0.9
0.8
0.7
0.6
(f )
y
S
0.5
0.4
0.3
0.2
0.1
0
-2-1.5-1-0.500.511.52
f
Hf 1(5.19)
1j2 f
Hence,
Sf jHf j2
y
1
(5.20)
12 f 2
0.9
0.8
0.7
0.6
(m)
y
R
0.5
0.4
0.3
0.2
0.1
0
01020304050
m
Figure 5.6: Plot of the autocorrelation function of the lter outputytin Computer Problem 5.4
plot(f,Sy);10
N=256;% number of samples
deltaf=0.1;% frequency separation
f=[0:deltaf:(N/2)*deltaf,(N/21)*deltaf:deltaf:deltaf];
% Swap the rst half.
Sy=1./(1+(2*pi*f).^2);% sampled spectrum
Ry=it(Sy);% autocorrelation of Y
% Plotting command follows.
gure;
plot(tshift(real(Ry)));
The MATLAB scripts for all computations are given next. Figures 5.7, 5.8, 5.9 and 5.10 illustrate
the estimates of the autocorrelation functions and the power spectra. We note that the plots of the
autocorrelation function and the power spectra are averages over ten realizations of the random
process.
197
0.09
0.08
0.07
0.06
0.05
(m)
x
R
0.04
0.03
0.02
0.01
-0.01
01020304050
m
0.5
0.45
0.4
0.35
0.3
(m)
y
R
0.25
0.2
0.15
0.1
0.05
0
01020304050
m
198
0.105
0.1
0.095
(f )
x
S
0.09
0.085
0.08
0.075
-0.500.5
f
Ryav=zeros(1,M+1);
Sxav=zeros(1,M+1);
Syav=zeros(1,M+1);
for i=1:10,% Take the ensemble average over ten realizations.
X=rand(1,N)(1/2);% Generate a uniform number sequence on (-1/2,1/2).
Y(1)=0;10
for n=2:N, Y(n)=0.9*Y(n1)+X(n); end;% Note that Y(n) means Y(n-1).
Rx=Rxest(X,M);% autocorrelation of {Xn}
Ry=Rxest(Y,M);% autocorrelation of {Yn}
Sx=tshift(abs(t(Rx)));% power spectrum of {Xn}
Sy=tshift(abs(t(Ry)));% power spectrum of {Yn}
Rxav=Rxav+Rx;
Ryav=Ryav+Ry;
Sxav=Sxav+Sx;
Syav=Syav+Sy;
echo o ;20
end;
echo on ;
Rxav=Rxav/10;
Ryav=Ryav/10;
Sxav=Sxav/10;
Syav=Syav/10;
% Plotting commands follow.
199
5
4.5
3.5
3
(f )
y
S
2.5
1.5
0.5
0
-0.500.5
f
Figures 5.11, 5.12, and 5.13 presentRXm,RXm, andRXm, respectively.SXf ,SXf , and
cscs
SXf are presented on Figures 5.14, 5.15, and 5.16, respectively.
The MATLAB script for these computations is given next. For illustrative purposes we have
Hz1
10:9z1
% MATLAB script for Computer Problem 5.6.
N=1000;% number of samples
for i=1:2:N,
[X1(i)X1(i+1)]=gngauss;
[X2(i)X2(i+1)]=gngauss;
end;% standard Gaussian input noise processes
A=[10.9];% lowpass lter parameters
B=1;
Xc=lter(B,A,X1);
Xs=lter(B,A,X2);10
fc=1000/pi;% carrier frequency
for i=1:N,
200
5
(m)
Xc
R
2
-1
020406080100
m
bandpassprocess(i)=Xc(i)*cos(2*pi*fc*i)Xs(i)*sin(2*pi*fc*i);
end;% T=1 is assumed.
% Determine the autocorrelation and the spectrum of the bandpass process.
M=100;
bppautocorr=Rxest(bandpassprocess,M);
bppspectrum=tshift(abs(t(bppautocorr)));
bppautocorr=Rxest(bandpassprocess,M);20
bppspectrum=tshift(abs(t(bppautocorr)));
Xcautocorr=Rxest(Xc,M);
Xcspectrum=tshift(abs(t(Xc)));
Xsautocorr=Rxest(Xs,M);
Xsspectrum=tshift(abs(t(Xs)));
% Plotting commands follow.
201
6
(m)
3
Xs
R
-1
020406080100
m
2
(m)
X
R
1
-1
-2
-3
-4
020406080100
m
450
400
350
300
(f )
Xc
S
250
200
150
100
50
0
-0.500.5
f
203
800
700
600
500
(f )
Xs
S
400
300
200
100
0
-0.500.5
f
204
35
30
25
20
(f )
X
S
15
10
0
-0.500.5
f
205
Chapter 6
Problem 6.1
The spectrum of the signal at the output of the LPF isSf Sf jfj2. Hence, the signal
s;os
2W
power is
Z1ZW
Ps;oSf dfP0df
s;o
1W1f =B2
W
P0Barctanf2P0BarctanW
BWB
ZW
N0
Pn;odfN0W
W2
2P0BarctanW2ParctanW
SNRB0B
N0WN0W
B
0.9
0.8
0.7
0.6
SNR
0.5
0.4
0.3
0.2
0.1
0123456789 10
W/B
206
Problem 6.2
HsRRCs
1
CsR1RCs
1
!2
222
jHf j4RCf
142RC2f2
0.9
0.8
0.7
0.6
0.5
|H(f)|
0.4
0.3
0.2
0.1
0
-10
-8-6-4-202468 10
f
2)The overall system is the cascade of theRCand the LPF lter. If the bandwidth of the LPF isW,
V f j2 RCff
1j2 RCf2W
207
1
0.9
0.8
0.7
0.6
0.5
|V(f)|
0.4
0.3
0.2
0.1
0
-10
-8-6-4-202468 10
1W
N0WN0arctan2 RCf
22 RCW
N0WN0arctan2 RCW
2 RC
The output signal is a sinusoidal with frequencyfcand amplitudeAjV fcj. Sincefc< Wwe
A242RC2f2 A2 RCf2
cc
142RC2f2N0142RC2f2
c
SNR2c
N0WN0arctan2 RCW2 RCWarctan2 RCW
2 RC
GW 1
2 RCWarctan2 RCW
as a function ofx2 RCW, when the latter varies from 0:1 to 0:5.
208
3500
3000
2500
2000
G
1500
1000
500
0
0.1
0.150.20.250.30.350.40.45 0.5
Problem 6.3
If we writentas
then,
tnctcos22fctnstsin22fct
2nc2
The noise signal at the output of the LPF is1nctwith power content
2
11N0W
Pn;oPnPn
4c42
If the DSB modulated signal isutmtcos2 fct, then its autocorrelation function isRu
1
2RMcos2 fcand its power
Z1
PuRu01RM0Sf df2W P0
21u
From this relation we ndRM04W P0. The signal at the output of the LPF isyt1mtwith
2
power content
11
Ps;oEm2tRM0W P0
44
209
Hence, the SNR at the output of the demodulator is
W P02P0
SNRPs;o
Pn;oN0WN0
2
Problem 6.4
SPRPRPR108
NbN0W20:510141:51061:5
10 logPT90=)PR109PT
PR
Hence,
SPR108108109PTPT
Nb1:51:515
SS
103=)PT1510315 KWatts
No;USSBNb
SSPT
No;AMNb15
2
where,PMn. Since, maxjmtj 1, we have
12PM
n
Z1
11
PMPMx2dx
n
123
and, therefore
0:2511
3
10:25113
3
Hence,
S1PT
3
)PT195 KWatts
No;AM131510=
SSPT
3
)PT15 KWatts
No;DSBNb1510=
210
Problem 6.5
1)SincejHf j 1 forf jfcfmj, the signal at the output of the noise-limiting lter is
21256:2510
111N0
Pn;oPnPn22500251010
2c222
3
yt101cos2 fmt21nct2
22
double frequency terms
The LPF rejects the double frequency components and therefore, the output of the lter is
vt1031cos2 fmtnct
If the dc component is blocked, then the signal power at the output of the LPF is
106
Po0:520:125106
2
Pn;oPnPn2N02000401010
c
2
where we have used the fact that the lowpass lter has a bandwidth of 1000 Hz. Hence, the output
SNR is
6
SNR0:1251031:25 14:95 db
401010
Problem 6.6
1)In the case of DSB, the output of the receiver noise-limiting lter is
r tutnt
Acmtcos2 fctct
211
2
The power of the received signal isPsAcPm, whereas the power of the noise
2
11
Pn;oPnPnPn
2c2s
Hence, the SNR at the output of the noise-limiting lter is
SA2Pm
c
No;lim2Pn
yt1Acmtnc
2
11
Pn;oPnPn
4c4
Hence,
SA2Pm
c
No;demPn
dem. gainNo;dem2
S
N
o;lim
2)In the case of SSB, the output of the receiver noise-limiting lter is
The received signal power isPsA2Pm, whereas the received noise power isPn;oPn. At the output
c
of the demodulator
ytAcmt1nct
22
withPo1A2PmandPn;o1Pn1Pn. Therefore,
4c4c4
SA2P
cm
dem. gainNo;demPn1
SA2P
cm
NP
o;limn
3)In the case of conventional AM modulation, the output of the receiver noise-limiting lter is
A2
Psc12PM
2n
212
In this case, the demodulation gain is given by
S
22PM
dem. gainNo;demn
S2
1PM
Nn
o;lim
r tAccos2 fcttnt
Zt
Accos2 fct2 kfmdnt
1
2
The total signal input power isPsAc, whereas the pre-detection noise power is
;lim
2
N0
Pn;2BcN0BcN02f1W
lim
2
Hence,
SA2
c
No;lim2N02f1W
S3k2fA2cPM
No;dem2N0W3
S
32PM2f1
f
dem. gainNo;dem621PM
S2ffn
maxjmtj
N
o;lim
SA2
c
No;lim2N02p1W
and
Sk2pA2cPM
No;dem2N0W
S
2
pPM2p12
dem. gainNo;dem2p1PM
S2pn
maxjmtj
N
o;lim
213
Problem 6.7
10 logPT80=)PR108PT108401034104Watts
PR
If the noise limiting lter has bandwidthB, then the pre-detection noise power is
ZfB
c
2
Pn2N0dfN0B21010BWatts
fcB2
2
BW104. Thus, the pre-detection signal to noise ratio in DSB and conventional AM is
PR4104
SNRDSB;AM102
Pn210102104
SNRDSB;o2SNRDSB2102
;i
SNRSSB;oSNRSSB2102
;i
2
PM
SNRAM;onSNRAM0:11352102
12PM;i
n
Problem 6.8
2f1100=)bf11:5
4
Hence,
!2
SA2fPMA2PM
3c3c2n
No;FM2maxjmtjN0W2fN0W
For an AM system
SA22PM
cn
No;AM2N0W
214
Hence,
S
N32f
o;FM
S2549:13927:3967 dB
N
o;AM
Sk2pA2cPM3k2fA2cPMS
No;PM2N0W2W2N0WNo;FM
or
k22
p1p1
=)
3k2W232W2W2
ff
Hence,
p
BWPM2p1W3f1
BWFM2f1Wf1
Problem 6.9
10 logPT80=8PT104Watts
)PR10
PR
S2PMS2PMPR
nn
No12PMNb12PMN0W
nn
N0W20:5101251035109
we nd that
S
1204 30:806 db
No
Bc21W=)100103215103=)9
We check now if the threshold imposes any restrictions.
SPR104
=)999
Nb;thN0W20110125103
Since we are limited in bandwidth we choose9. The output signal to noise ratio is
SS105
320:13920:1486000 56:866 db
NoNb5
215
Problem 6.10
1)First we check whether the threshold or the bandwidth impose a restrictive bound on the modula-
Bc21W=)60103218103=)2:75
S
6021PM
Non
withS104andPM1we nd
Nn2
o
1043021=)6:6158
SSS2104
32PM=)881:542
NonNbNb32:752
Thus,
SPR
)PR881:5422101281031:41105
NbN0W881:542=
PT104PR0:141 Watts
2)If the minimum required SNR is increased to 60 db, then thefrom Carsons rule remains the
S
6021PM106
Non
S1S
8:8154104
Nb32PMNo
n
Thus,
PRN0W8:81541042101281038:81541040:0014
and
PT104PR14 Watts
Hdf 1
1jf
f0
216
withf012100 Hz. In this case,
275106
3
SWfS
06
10
No;PDWWNo
3arctan
f0f0
S
1:3541105=)PR9:55105
No
and therefore,
PT104PR0:955 Watts
Problem 6.11
1)In the next gure we plot a typical USSB spectrum forK3. Note that only the positive frequency
axis is shown.
USSB
f
3W2WW0
ZW
m33
W2N0W
Pn;oSf df2N0mK3
n;o
Wm3A2c3A2c
whereAcis the amplitude of the FM signal. As it is observed the power of the noise that enters the
Theithmessage USSB signal occupies the frequency bandi1W ; iW . Since the power spectral
density of the noise at the output of the FM demodulator isSf N0f2, we conclude that the
n;o2
Ac
noise power at the output of theithUSSB demodulator is
iWiW3
11ZN0N01N0W
Pn;oPn2f2dff33i23i1
ii222
44i1WA2A3i1W6A
ccc
Hence, the noise power at the output of theithUSSB demodulator depends oni.
Pn;o3i23i1
i
Pn;o3j23j1
j
217
A2
5)The output signal power of theithUSSB demodulator isPsiPM. Hence, the SNR at the output
i4i
of theithdemodulator is
A2
i
PM
SNRi4i
N0W3
3i23i1
6A2
c
Assuming thatPMis the same for alli, then in order to guarantee a constantSNRiwe have to select
i
A2proportional to 3i23i1.
i
Problem 6.12
iV31:62280:6325 Amp
R50
Hence,
Problem 6.13
1)The overall loss in 200 Km is 20020400 dB. Since the line is loaded with the characteristic
impedance, the delivered power to the line is twice the power delivered to the load in absence of line
be up to 20=210 Km to attain a constant signal level at the input of all repeaters. This means that
218
Problem 6.14
10 log1Te2
290
and thereforeT169:62K.
e
Pno GkBneqT T
e
Problem 6.15
10825106T025106T=) T3T0
ee
F1Te134
T
Problem 6.16
The proof is by induction onm, the number of the ampliers. We assume that the physical
temperatureTis the same for all the ampliers. Form2, the overall gain of the cascade of the
two ampliers isG GG, whereas the total noise at the output of the second amplier is due to
12
the source noise amplied by two stages, the rst stage noise excess noise amplied by the second
Pn GGPn GPn;1Pn;2
212s2ii
The noise of a single stage model with eective noise temperatureT, and gainGGis
e12
Pn GGkBneqT T
12e
219
or
T TTe2
ee1
G
1
T
em1
T0 TTe2
ee1
GG G
11m2
whereG0 G Gis the gain of them1 ampliers and we have used the results form2.
1m1
Thus,
TT
em1em
T TTe2
ee1
GG GG G
11m21m1
Proof of Fries formula follows easily with the substitutionFk1Tekinto the above equation.
T
0
Computer Problems
The plot of the message signalmtand the modulated signalutare shown in Figures 6.1 and
6.2. Also Figures 6.3, 6.4 and 6.5 illustrate the modulated signalfr ngwith various channel noise
We design a linear lowpass lter with 31 taps, cuto frequency (-3 dB) of 100 Hz and a stopband
attenuation of at least 30 dB. The frequency responce of the lter is given in Figure 6.6. The
demodulated signals for dierent values of noise are shown in Figures 6.7, 6.8 and 6.9.
The FIR lter introduces a short delay on demodulated signal. Therefore, and in order to
determine the signal to noise ratio at the output of the demodulator, one must consider this delay.
The signal to noise ratio for dierent values of the:0:1,1, and2 are SNR=3:8027
dB,7:6224 dB and11:842 dB, respectively.
220
c=cos(2*pi*fc.*t);% the carrier signal
u=m.*c;% the DSB-AM modulated signal
Wc=randn(1, 1000);
Ws=randn(1, 1000);
sgma= 0.1;
r01=u+sgma*(Wc.*cos(2*pi*fc*t)Ws.*sin(3*pi*fc*t));
sgma= 1;
r1=u+sgma*(Wc.*cos(2*pi*fc*t)Ws.*sin(3*pi*fc*t));20
sgma= 2;
r2=u+sgma*(Wc.*cos(2*pi*fc*t)Ws.*sin(3*pi*fc*t));
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.010.020.030.040.050.060.070.080.090.1
t
221
1
0.8
0.6
0.4
0.2
0
u(t)
-0.2
-0.4
-0.6
-0.8
-1
00.010.020.030.040.050.060.070.080.090.1
t
222
1
0.5
r (t)
-0.5
-1
-1.5
00.010.020.030.040.050.060.070.080.090.1
t
223
4
0
r (t)
-1
-2
-3
-4
00.010.020.030.040.050.060.070.080.090.1
t
224
8
0
r (t)
-2
-4
-6
-8
00.010.020.030.040.050.060.070.080.090.1
t
225
10
-10
-20
-30
|H(f )|
-40
-50
-60
-70
-80
00.050.10.150.20.250.30.350.40.450.5
f
226
0.6
0.5
0.4
0.3
(t)
0.2
r
m
0.1
-0.1
-0.2
00.010.020.030.040.050.060.070.080.090.1
t
227
1
0.5
(t)
r
m
-0.5
00.010.020.030.040.050.060.070.080.090.1
t
228
1.5
0.5
(t)
r
m
-0.5
-1
00.010.020.030.040.050.060.070.080.090.1
t
229
HindB=20*log10(abs(H));
rm01=lter(B, 1,r01.*c);
rm1=lter(B, 1,r1.*c);
rm2=lter(B, 1,r2.*c);
delayedu=lter(B, 1,u);40
p01=10*log10(spower(delayedu)/spower(rm01delayedu));
p1=10*log10(spower(delayedu)/spower(rm1delayedu));
p2=10*log10(spower(delayedu)/spower(rm2delayedu));
% Plotting command follows.
The message signalmtis similar to the message signal in previous problem, which is shown in
Figure 6.1. The modulated signalutis shown in Figure 6.10. Also Figures 6.11, 6.12 and 6.13
illustrate the modulated signalfr ngwith various channel noise values of:0:1,1, and
2, respectively.
We design a linear lowpass lter with 31 taps, cuto frequency (-3 dB) of 100 Hz and a stopband
attenuation of at least 30 dB. The frequency responce of the lter is given in Figure 6.6. The
demodulated signals for dierent values of noise are shown in Figure 6.14.
The FIR lter introduces a short delay on demodulated signal. Therefore, and in order to
determine the signal to noise ratio at the output of the demodulator, one must consider this delay.
The signal to noise ratio for dierent values of the:0:1,1, and2 are SNR=3:8027
230
0.4
0.3
0.2
0.1
u(t)
-0.1
-0.2
-0.3
-0.4
-0.5
00.010.020.030.040.050.060.070.080.090.1
t
231
0.6
0.4
0.2
r (t)
-0.2
-0.4
-0.6
-0.8
00.010.020.030.040.050.060.070.080.090.1
t
232
4
0
r (t)
-1
-2
-3
-4
00.010.020.030.040.050.060.070.080.090.1
t
233
8
0
r (t)
-2
-4
-6
-8
00.010.020.030.040.050.060.070.080.090.1
t
234
1.5
=0.1
=1
=2
0.5
(t)
0
r
m
-0.5
-1
-1.5
0200400600800100012001400160018002000
t
235
u1=real(it(ULSSB))*fs;% Generate LSSB signal from spectrum.
u=u1(1:length(t));
signalpower=spower(udsb(1:length(t)))/2;
Wc=randn(1, 1000);
Ws=randn(1, 1000);
sgma= 1;
r1=u+sgma*(Wc.*cos(2*pi*fc*t)Ws.*sin(3*pi*fc*t));
y1=r1.*cos(2*pi*fc*[0:ts:ts*(length(u)1)]);30
[Y1,y1,df1]=tseq(y1,ts,df);% spectrum of the output of the mixer
Y1=Y1/fs;% scaling
fcuto=150;% Choose the cuto freq. of the lter.
ncuto=oor(150/df);% Design the lter.
H=zeros(size(f));
H(1:ncuto)=4*ones(1,ncuto);
% spectrum of the lter output
H(length(f)ncuto+1:length(f))=4*ones(1,ncuto);
DEM1=H.*Y1;% spectrum of the lter output
dem1=real(it(DEM1))*fs;% lter output40
Figures 6.15 and 6.16 show the message signalmtand the modulated signalut. Also Fig-
ures 6.17, 6.18 and 6.19 illustrate the modulated signalsfr ngwith various channel noise values
The demodulated signals for dierent values of noise are shown in Figures 6.20, 6.21 and 6.22.
Wc=randn(1, 1000);
Ws=randn(1, 1000);20
sgma= 1;
r1=u+sgma*(Wc.*cos(2*pi*fc*t)Ws.*sin(3*pi*fc*t));
e1=sqrt((1+a.*m+sgma.*Wc).^2 + (sgma.*Ws).^2);
236
1
0.8
0.6
0.4
m(t)
0.2
-0.2
-0.4
00.010.020.030.040.050.060.070.080.090.1
237
2
1.5
0.5
0
u(t)
-0.5
-1
-1.5
-2
00.010.020.030.040.050.060.070.080.090.1
238
2
1.5
0.5
-0.5
-1
-1.5
-2
00.010.020.030.040.050.060.070.080.090.1
t
239
4
-1
-2
-3
-4
The AM modulated signal with=1
-5
-6
00.010.020.030.040.050.060.070.080.090.1
240
8
-2
-4
-6
-8
The AM modulated signal with=2
-10
-12
00.010.020.030.040.050.060.070.080.090.1
241
2
1.5
0.5
00.010.020.030.040.050.060.070.080.090.1
Time
t
242
4.5
3.5
2.5
1.5
1
The demodulated signal with=1
0.5
0
00.010.020.030.040.050.060.070.080.090.1
t
243
8
2
The demodulated signal with=2
0
00.010.020.030.040.050.060.070.080.090.1
t
244
[M,m,df1]=tseq(m,ts,df);% Fourier transform
M=M/fs;% scaling
f=[0:df1:df1*(length(m)1)]fs/2;% frequency vector
[U,u,df1]=tseq(u,ts,df);% Fourier transform
U=U/fs;% scaling
signalpower=spower(u(1:length(t)));% power in modulated signal
% power in normalized message30
pmn=spower(m(1:length(t)))/(max(abs(m)))^2;
eta=(a^2*pmn)/(1+a^2*pmn);% modulation eciency
noisepower=eta*signalpower/snrlin;% noise power
noisestd=sqrt(noisepower);% noise standard deviation
noise=noisestd*randn(1,length(u));% Generate noise.
r=u+noise;% Add noise to the modulated signal
[R,r,df1]=tseq(r,ts,df);% Fourier transform.
R=R/fs;% scaling
pause% Press a key to show the modulated signal power.
signalpower40
pause% Press a key to show the modulation eciency.
eta
pause% Press any key to see a plot of the message.
subplot(2,2,1)
plot(t,m(1:length(t)))
axis([0 0.152.1 2.1])
xlabel(Time)
title(The message signal)
pause
pause% Press any key to see a plot of the carrier.50
subplot(2,2,2)
plot(t,c(1:length(t)))
axis([0 0.152.1 2.1])
xlabel(Time)
title(The carrier)
pause% Press any key to see a plot of the modulated signal.
subplot(2,2,3)
plot(t,u(1:length(t)))
axis([0 0.152.1 2.1])
xlabel(Time)60
title(The modulated signal)
pause% Press any key to see plots of the magnitude of the message and the
% modulated signal in the frequency domain.
subplot(2,1,1)
plot(f,abs(tshift(M)))
xlabel(Frequency)
title(Spectrum of the message signal)
subplot(2,1,2)
plot(f,abs(tshift(U)))
title(Spectrum of the modulated signal)70
xlabel(Frequency)
pause% Press a key to see a noise sample.
subplot(2,1,1)
plot(t,noise(1:length(t)))
title(Noise sample)
xlabel(Time)
pause% Press a key to see the modulated signal and noise.
245
subplot(2,1,2)
plot(t,r(1:length(t)))
title(Signal and noise)80
xlabel(Time)
pause% Press a key to see the modulated signal and noise in freq. domain.
subplot(2,1,1)
plot(f,abs(tshift(U)))
title(Signal spectrum)
xlabel(Frequency)
subplot(2,1,2)
plot(f,abs(tshift(R)))
title(Signal and noise spectrum)
xlabel(Frequency)90
Figures 6.23 and 6.24 show the message signalmtand its integral signal and Figure 6.25 illustrates
the FM modulated signal. Using MATLABs Fourier transform routine, we plot the spectra ofmt
The impact of the channel noise on the modulated signalsfr ngfor two channel noise values of
0:1 and1 are shown in Figure 6.28. The demodulated signal are also shown in Figure 6.29.
intm(1)=0;
for i=1:length(t)1% integral of m
intm(i+1)=intm(i)+m(i)*ts;
echoo;
end
echoon;
20
gure;
plot(t,m);
xlabel(Time);ylabel(y);
gure;
plot(t,intm);
xlabel(Time);ylabel(y);
246
0.2
0.15
0.1
m(t)
0.05
-0.05
051015202530
n
t
247
-3
x 10
6
3
m()d
t
R
0
00.010.020.030.040.050.060.070.080.090.1
t
248
1
0.8
0.6
0.4
m()d
t
R
0.2
f
0
t+2 k
c
-0.2
-0.4
-0.6
u(t)=cos2 f
-0.8
-1
00.010.020.030.040.050.060.070.080.090.1
t
249
-3
Magnitude spectrum of the message signal
x 10
|M(f )|
4
0
-500-400-300-200-1000100200300400500
f
250
0.045
0.04
0.035
0.03
0.025
|U (f )|
0.02
0.015
0.01
0.005
0
-500-400-300-200-1000100200300400500
f
251
1.5
0.5
-0.5
-1
u(t)with noise=0.1u(t)with noise=1
-1.5
00.010.020.030.040.050.060.070.080.090.1
-2
-4
-6
00.010.020.030.040.050.060.070.080.090.1
t
252
0.5
0.5
-0.5
01002003004005006007008009001000
t
253
[M,m,df1]=tseq(m,ts,df);% Fourier transform
M=M/fs;% scaling
f=[0:df1:df1*(length(m)1)]fs/2;% frequency vector30
u=cos(2*pi*fc*t+2*pi*kf*intm);% modulated signal
gure;
plot(u);
xlabel(Time);ylabel(y);
Wc=randn(1, 1000);
Ws=randn(1, 1000);
sgma= 1;
r1=u+sgma*(Wc.*cos(2*pi*fc*t)Ws.*sin(2*pi*fc*t));
[U,upad,df1]=tseq(u,ts,df);% Fourier transform40
U=U/fs;% scaling
254
Chapter 7
Problem 7.1
1.Since the maximum frequency inXf is is 40 KHz, the minimum sampling rate isfs2W80
KHz.
2. Herefs2WWG2401090 KHz.
Problem 7.2
fs2W2000=)fs14000
The reconstruction lter should not pick-up frequencies of the images of the spectrumXf . The
nearest image spectrum is centered atfsand occupies the frequency bandfsW ; fsW . Thus
10000fsW=)fs16000
Kfs1=)K160001
Problem 7.3
xtAsinc1000 t=)Xf Af
10001000
Thus the bandwidthWofxtis 1000=2500. Since we sample atfs2000 there is a gap between
the image spectra equal to
2000500W1000
255
The reconstruction lter should have a bandwidthW0such that 500< W0<1500. A lter that satisfy
these conditions is
f1f
Hf Ts
2W020002W0
8
1
>>>j
2000fj<500
><
Hfarbitrary 500<jfj<1500
>>>
>:
0jfj>1500
Problem 7.4
1)
1
X
xptxnTsptnTs
n1
1
X
pt ?xnTstnTs
n1
1
X
pt ? xttnTs
n1
Thus
"1#
X
Xpf P f FxttnTs
n1
"1#
X
P f Xf ?FtnTs
n1
1
Xn
P f Xf ?1f
TsTs
n1
1 1Xn
P fXf
TsTs
n1
3)Xf can be recovered using the reconstruction lterfwithW < W<1W. In this case
2WTs
Xf Xpf TsP1f f
2W
256
Problem 7.5
1)
11
XX
x1t1nxnTstnTsxt1ntnTs
n1n1
23
11
XX
xt4t2lTstTs2lTs5
l1l1
Thus
23
11Xl11Xl
X1f Xf ?4ffej2 f Ts5
2Ts2Ts2Ts2Ts
l1l1
11Xl11Xljl
Ts
XfXfe22Ts
2Ts2Ts2Ts2Ts
l1l1
11Xl11Xl
XfXf1l
2Ts2Ts2Ts2Ts
l1l1
11X1l
Xf
Ts2TsTs
l1
2) The spectrum ofxtoccupies the frequency bandW ; W . Suppose that from the periodic
cannot cover the whole intervalW ; W . Thus at the output of the reconstruction lter there will
exist frequency components which are not present in the input spectrum. Hence, the reconstruction
lter has to be a time-varying lter. To see this in the time domain, note that the original spectrum
has been shifted byf01. In order to bring the spectrum back to the origin and reconstructxt
2Ts
1
tj2 W t
the sampled signalx1thas to be multiplied byej22Tse. However the system described
by
ytej2 W txt
is a time-varying system.
3) Using a time-varying system we can reconstructxtas follows. Use the bandpass lterTsfW
2W
to extract the componentXf1. InvertXf1and multiply the resultant signal byej2 W t.
2Ts2Ts
Thus
fW
xtej2 W tF1TsX1f
2W
Problem 7.6
1) The linear interpolation system can be viewed as a linear lter where the sampled signal
257
P1
xttnTsis passed through the lter with impulse response
n1
8
>>>1t
TsTsf0
><
ht1t0fT
Tss
>>>
>:
0 otherwise
tnTs
x1txnTsxn1TsxnTs
Ts
xnTs1tnTsxn1Ts1tn1Ts
TsTs
xnTshtnTsxn1Tshtn1Ts
we observe thathtdoes not extend beyondTs; Tsand in this interval its form should be the
f Tsk; k2 Z f0g
In order to recoverXf , the bandwidthWofxtshould be smaller than 1=Ts, so that the whole
Xf lies inside the main lobe ofsinc2f Ts. This condition is automatically satised if we choose
Tssuch that to avoid aliasing (2W <1=Ts). In this case we can recoverXf fromX1f using the
lowpass lterf.
2W
f
f sinc2f TsXf
2WX1
or
f
Xf sinc2f Ts1X1f
2W
258
Problem 7.7
1
Xt
xtxnTssincn
n1Ts
14
XtXt
sincnsincn
n4Tsn1Ts
WithTs102andt5103we obtain
44
X1X1
x:005sincnsincn
n12n12
sinc3sinc5sinc7sinc9
2222
sinc1sinc3sinc5sinc7
2222
sinc1sinc92sin2sin9
22292
16
Z1
sinc2W tmsinc2W tndt1mn
12W
Z1Z1
jxtj2dtxtxtdt
11
1Z1
X
xnTsxmTssinc2W tmsinc2W tndt
n11
1
X1
jxnTsj2
n12W
Hence
Z12143
XX4
jxtj2dt141158102
12WW
n4n1
Problem 7.8
259
1) Using Parsevals theorem we obtain
Z1
Asinc2W tmsinc2W tndt
1
Z1
Fsinc2W tmFsinc2W tndt
1
Z1
1fmn
22j2 f
e2Wdf
12W2W
W
1Zjmn1
e2 f2Wdfmn
4W2W2W
wheremnis the Kroneckers delta. The latter implies thatfsinc2W tmgform an orthogonal set
of signals. In order to generate an orthonormal set of signals we have to weight each function by
p
1=2W.
1
X
xtxnTssinc2W tn
n1
wherexnTsare the samples taken at the Nyquist rate. This is an orthogonal expansion relation
3)
Z1Z1
1
X
xtsinc2W tndtxmTssinc2W tmsinc2W tndt
11
m1
1Z1
X
xmTssinc2W tmsinc2W tndt
m11
1
X1
1
xmTsmnxnTs
m12W2W
Problem 7.9
1)From Table 7.1 we nd that for a unit variance Gaussian process, the optimal level spacing for a 16-
level uniform quantizer is .3352. This number has to be multiplied byto provide the optimal level
p
spacing when the variance of the process is2. In our case210 and100:33521:060.
260
The quantization levels are
a80
2
R1log3:2186
22D
5)The distortion of the 16-level optimal quantizer isD1620:01154 whereas that of the 8-level
261
Problem 7.10
:5860200:586011:72
x1 x8 311:72111:72 41:020
2
x2 x7 211:72111:72 29:300
2
x3 x6 111:72111:72 17:580
2
1
x4 x511:72 5:860
2
D20:0374414:976
As it is observed the distortion of the optimum quantizer is signicantly less than that of Example
7.2.1.
Problem 7.11
Using Table 7.2 we nd the quantization regions and the quantized values forN16. These values
p
should be multiplied byP1=210, since Table 6.3 provides the optimum values for a unit
X
variance Gaussian source.
p
a1 a15102:401 7:5926
p
a2 a14101:844 5:8312
p
a3 a13101:437 4:5442
p
a4 a12101:099 3:4753
p
a5 a11100:7996 2:5286
p
a6 a10100:5224 1:6520
p
a7 a9100:2582 0:8165
a80
262
The quantized values are
p
x1 x16102:733 8:6425
p
x2 x15102:069 6:5428
p
x3 x14101:618 5:1166
p
x4 x13101:256 3:9718
p
x5 x12100:9424 2:9801
p
x6 x11100:6568 2:0770
p
x7 x10100:3881 1:2273
p
x8 x9100:1284 0:4060
The resulting distortion isD100:0094940:09494. From Table 7.2 we nd that the minimum
Problem 7.12
1)The area between the two squares is 442212. Hence,fX;Yx; y1. The marginal
12
R2
probabilityfXxis given byfXxfX;Yx; ydy. If2X <1, then
2
Z2
2
fXxfX;Yx; ydy1y1
21223
Z2
2
fXxfX;Yx; ydy1y1
21223
1/6
-2 -1 1 2
Similarly we nd that
8
1
>>>2
3y <1
><
fYy11y <1
6
>>>
>:1
31y2
263
distortion is
Z1Z0
DX2x32fXxdx2x12fXxdx
2212
1Z0
2Z2921
x3xdxx2xdx
324614
2139121110
3232
33x2x4x263x2x4x1
1
12
RRXRYlog4log44
22
3)Suppose that we divide the region over whichpx; y0 intoLequal subregions. The case of
For each subregion the quantization output vectorx;yis the centroid of the corresponding
rectangle. Since, each subregion has the same shape (uniform quantization), a rectangle with width
equal to one and length 12=L, the distortion of the vector quantizer is
12
Z1Z
L
L
Dx; y1;122dxdy
0022L12
12
1ZL
LZ112
x2y2dxdy
120022L
"#
L1211231112
12L12L31212L2
If we setD1, we obtain
6
121p
)L14412
L212=
Thus, we have to divide the area over whichpx; y0, into 12 equal subregions in order to
achieve the same distortion. In this case the resulting number of bits per source output pairX; Y
isRlog123:585.
2
264
Problem 7.13
1)The joint probability density function isfXYx; y1p1. The marginal distributionfXx
2228R
isfXxfXYx; ydy. If2x0,then
y
Zx
2
x2
fXxfX;Yx; ydy1yx2
x28x24
If 0x2,then
Zx
2
x2
fXxfX;Yx; ydy1yx2
x28x24
1
2
2 2
8
><y2
2y <0
fYy4
>:y2
40y2
2)
Z1Z0
DX2x32fXxdx2x12fXxdx
2212
1Z0
1Z311
x2x2dxx2x2dx
222212
115339111910
432432
24x3x8x2x224xx8x2x1
1
12
RRXRYlog4log44
22
3)We divide the square over whichpx; y0 into 2416 equal square regions. The area of each
265
square is1and the resulting distortion
2
1 Z1
Zp
p
211
D162xp2yp2dxdy
8002222
1Z1
Zp
p
21
42xp2dxdy
0022
1
p
4Z21x
p2xpdx
2082
1
4111p2
px3xpx2
238220
1
12
Hence, using vector quantization and the same rate we obtain half the distortion.
Problem 7.14
XXX=2. Hence,
xmax
222
1ZX11
EX2dxx3
42416323
1
SQNR3484848:165db
3
Problem 7.15
1)
22A2
EXtRXj
0
2
Hence,
22
SQNR34X234X34A
x2max2A2
q
10 log3460=)q9:6733
10
2
The smallest integer larger thatqis 10. Hence, the required number of quantization levels is10.
2)The minimum bandwidth requirement for transmission of a binary PCM signal isBWW. Since
266
Problem 7.16
1)
Z0Z2
x2x2
EX2tx2dxx2dx
2404
11201122
4343
44x3x244x3x0
2
Hence,
3423452
SQNR3351227:093db
x2max22
2)If the available bandwidth of the channel is 40 KHz, then the maximum rate of transmission is
3482
SQNR33276845:154db
22
3)In the case of a guard band of 2 KHz the sampling rate isfs2W200012 KHz. The highest
Problem 7.17
LetXX QX. Clearly ifjXj>0:5, thenpX0. IfjXj 0:5, then there are four solutions to
x12x1:52x32x0:52
fXx1fXx3
4444
x22x0:52x42x1:52
fXx2fXx4
4444
The absolute value ofX QX0is one forXx1; : : : ; x4. Thus, forjXj 0:5
4
Xf
xi
fxX
X0
i1jxi Qxij
x1:52x0:52x0:52x1:52
4444
1
267
Problem 7.18
1)
RXt; tEXtXt
and since
Z2
we conclude that
3
RXt; t1EY2cos2 f0cos2 f0
22
2)
!
0
10 logSQNR10 log34RX40
10102
xmax
Thus,
log44 or8
10
2
The bandwidth of the process isWf0, so that the minimum bandwidth requirement of the PCM
system is BW8f0.
Thus,04 more bits are needed to increase SQNR by 24 db. The new minimum bandwidth
requirement is BW012f0.
Problem 7.19
1.The power spectral density ofthe process isSf FRX2104f, from wich
X4
10
the bandwidth of the process isW104Hz. Therefore,fs2WWG2104250022500
andBTR=278750 Hz.
2.Here we need to improve the SQNR by 5629:826:2 dB. Since each doubling ofNimproves
SQNR by 6 dB, we have to doubleNat least 26:2=6 or 5 times, i.e., the newNis 2532 times
the oldN, i.e.,N128324096. The resulting SQNR is 5630 dB more than the original
268
3.UsingBTR=2fs=2WWG=2we want to nd the largest integerthat satises
samples/sec.
Problem 7.20
1.PXRX04 Watts.
2.Sf FRX4104f.
X4
10
;jfj 5000
4
Sf
Y
4104
f
0:51040:5104
and the power is the area under the power spectral density
Z1
1
PYSf df104210410421043 W
Y
12
5.SinceXtis Gaussian and zero-mean, all random variables are zero-mean Gaussian with
variancesEX20,EX2104, andEX21:5104. But all these variances are equal to
R1
RX0Sf df4, hence all random variables are distributed according aN0;4
1X
PDF.
are uncorrelated, and since they are jointly Gaussian, they are also independent. ForX0
269
Problem 7.21
Z0Z2
hi1
PXEX2tx2dx1x2dx4
23063
3.BTR=284000=242000 Hz.
424284 dB.
Problem 7.22
1.The power is the integral of the power spectral density or the area below it, i.e.,PX12
2
4000600010000 W.
Problem 7.23
R200i200
1.PX11df1tan1f1 where we have used the approximationstan1200
2001f2
200
1
2andtan1200 2. To nd the SQNR, we haveSQNRdB684:810log100
484:82032:8 dB.
270
2.To increase the SQNR by 20 dB, we need at least 4 more bits per sample (each bit improved
the SQNR by 6 dB). The new number of bits per sample is 8+4=12 bits and the new number of
levels is 2124096.
Problem 7.24
R1
1.Any probability density function satisesf x dx1 here the area under the density
1
function has to be one. This is the area of the left triangle plus the area of the right rectangle
Here the density function is given therefore the power can be obtained fromEX2t
R1
1x2f x dx. We have
Z0Z2
x11
PXx2 dxx2dx
26303
11012
433
24x9x29x0
2810
999
SQNRj4:8610 logPX
dB102
xmax
4:83010 log10=9
10
4
34:810 log5
10
18
34:85:5629:24 dB
4.BTW51200060000 Hz.
5.Each extra bit improves SQNR by 6 dB, since we need an extra 20 dB, we need at least 4 more
bits (3 more bits can improve the performance by only 18 dB), therefore the newwill be
5+4=9 and the new bandwidth will beBT912000108000 Hz . Compared to the previous
271
Problem 7.25
1.Sf is a triangle of height one extending from5000 to 5000. Therefore the area under it
X
which is the power in the process isPX5000 Watts.
4.Rfs81200096000 bits/sec.
5. BWTR48000 Hz.
2
6.Since each extra bit increases the SNR by 6 dBs, for at least 25 dBs we need at least 5 extra bits.
Problem 7.26
Suppose that the transmitted sequence isx. If an error occurs at theithbit of the sequence, then the
received sequencex0is
x0x0: : :010: : :0
where addition is modulo 2. Thus the error sequence isei0: : :010: : :0, which in natural binary
coding has the value 2i1. If the spacing between levels is, then the error introduced by the channel
is 2i1.
2)
X
Dchannelperror inibit2i12
i1
X1
4
pb24i1pb2
i114
41
pb2
3
272
or sinceN2
x2x2
Dtotalmax14pb41max14pbN21
343N2
4)
222
SNREXEX3N
Dtotalx214pN21
maxb
2
If we letXX, thenEXEX2X2. Hence,
xmax2
xmax
222
SNR3NX34X
14pbN2114pb41
Problem 7.27
The sampling rate isfs44100 meaning that we take 44100 samples per second. Each sample is
quantized using 16 bits so the total number of bits per second is 4410016. For a music piece of
duration 50 min3000 sec the resulting number of bits per channel (left and right) is
441001630002:1168109
2:116810924:2336109
Computer Problems
0:4599;1:5101;3:2827;5:1865.
echo on ;
a=[10,5,4,2,0,1,3,5,10];
for i=1:length(a)1
y(i)=centroid(normal,a(i),a(i+1),0.001,0,1);
echo o ;
end
In this MATLAB script the MATLAB function centroid.m given next nds the centroid of a region.
273
function y=centroid(funfcn,a,b,tol,p1,p2,p3)
% CENTROID Finds the centroid of a function over a region.
% Y=CENTROID(F,A,B,TOL,P1,P2,P3) nds the centroid of the
% function F dened in an m-le on the [A,B] region. The
% function can contain up to three parameters, P1, P2, P3.
% tol=the relative error.
args=[ ];
for n=1:nargin4
args=[args,,p,int2str(n)];10
end
args=[args,)];
funfcn1=x_fnct;
y1=eval([quad(funfcn1,a,b,tol,[ ],funfcn,args]);
y2=eval([quad(funfcn,a,b,tol,[ ],args]);
y=y1/y2;
MATLAB functions xfunct.m and normal.m that arse used in centroid.m are given next
function y=xfnct(x,funfcn,p1,p2,p3)
% y=xfnct(x,funfcn,p1,p2,p3)
% Returns the function funfcn(x) times x
args=[ ];
for nn=1:nargin2
args=[args,,p,int2str(nn)];
end
args=[args,)] ;
y=eval([funfcn,(x,args,.x]);10
*
function y=normal(x,m,s)
% FUNCTION y=NORMAL(x,m,s)
% Gaussian distribution
% m=mean
% s=standard deviation
y=(1/sqrt(2*pi*s^2))*exp(((xm).^2)/(2*s^2));
1) By the symmetry assumption the boundaries of the quantization regions are 0;1;2;3;4, and
5.
1;2,2;3,3;4,4;5, and5;1.
3) The MATLAB function uq_dist.m is used to nd the distortion of a uniform quantizer (it is assumed
that the quantization levels are set to the centroids of the quantization regions). uq_dist.m and the
274
function[y,dist]=uqdist(funfcn,b,c,n,delta,s,tol,p1,p2,p3)
%UQDIST returns the distortion of a uniform quantizer
% with quantization points set to the centroids
% [Y,DIST]=UQDIST(FUNFCN,B,C,N,DELTA,S,TOL,P1,P2,P3)
% funfcn=source density function given in an m-le
% with at most three parameters, p1,p2,p3.
% [b,c]=The support of the source density function.
% n=number of levels.
% delta=level size.
% s=the leftmost quantization region boundary.10
% p1,p2,p3=parameters of the input function.
% y=quantization levels.
% dist=distortion.
% tol=the relative error.
if(cb<delta*(n2))
error(Too many levels for this range.);return
end
if(s<b)
error(The leftmost boundary too small.);return20
end
if(s+(n2)*delta>c)
error(The leftmost boundary too large.);return
end
args=[ ];
for j=1:nargin7
args=[args,,p,int2str(j)];
end
args=[args,)];
a(1)=b;30
for i=2:n
a(i)=s+(i2)*delta;
end
a(n+1)=c;
[y,dist]=eval([mse_dist(funfcn,a,tol,args]);
function[y,dist]=msedist(funfcn,a,tol,p1,p2,p3)
%MSEDIST returns the mean-squared quantization error.
% [Y,DIST]=MSEDIST(FUNFCN,A,TOL,P1,P2,P3)
% funfcn=The distribution function given
% in an m-le. It can depend on up to three
% parameters, p1,p2,p3.
% a=the vector dening the boundaries of the
% quantization regions. (Note: [a(1),a(length(a))]
% is the support of funfcn.)
% p1,p2,p3=parameters of funfcn.10
% tol=the relative error.
args=[ ];
for n=1:nargin3
args=[args,,p,int2str(n)];
end
275
args=[args,)];
for i=1:length(a)1
y(i)=eval([centroid(funfcn,a(i),a(i+1),tol,args]);
end20
dist=0;
for i=1:length(a)1
newfun=x_a2_fnct;
dist=dist+eval([quad(newfun,a(i),a(i+1),tol,[ ],funfcn,,num2str(y(i)),args]);
end
andp22. Substituting these values into uq_dist.m, we obtain a squared error distortion of 0.0851
In order to design a a Lloyd-Max quantizer, the m-le lloydmax.m given next is used
function[a,y,dist]=lloydmax(funfcn,b,n,tol,p1,p2,p3)
%LLOYDMAX returns the the Lloyd-Max quantizer and the mean-squared
% quantization error for a symmetric distribution
% [A,Y,DIST]=LLOYDMAX(FUNFCN,B,N,TOL,P1,P2,P3).
% funfcn=the density function given
% in an m-le. It can depend on up to three
% parameters, p1,p2,p3.
% a=the vector giving the boundaries of the
% quantization regions.
% [-b,b] approximates support of the density function.10
% n=the number of quantization regions.
% y=the quantization levels.
% p1,p2,p3=parameters of funfcn.
% tol=the relative error.
args=[ ];
for j=1:nargin4
args=[args,,p,int2str(j)];
end
args=[args,)];20
v=eval([variance(funfcn,-b,b,tol,args]);
a(1)=b;
d=2*b/n;
for i=2:n
a(i)=a(i1)+d;
end
a(n+1)=b;
dist=v;
[y,newdist]=eval([mse_dist(funfcn,a,tol,args]);
while(newdist<0.99*dist),30
for i=2:n
a(i)=(y(i1)+y(i))/2;
end
276
dist=newdist;
[y,newdist]=eval([mse_dist(funfcn,a,tol,args]);
end
a 10;2:16;1:51;0:98;0:48;0
y 2:52;1:78;1:22;0:72;0:24
The m-le u_pcm.m given next takes as its input a sequence of sampled values and the number
of desired quantization levels and nds the quantized sequence, the encoded sequence, and the
function[sqnr,aquan,code]=upcm(a,n)
%UPCM uniform PCM encoding of a sequence
% [SQNR,AQUAN,CODE]=UPCM(A,N)
% a=input sequence.
% n=number of quantization levels (even).
% sqnr=output SQNR (in dB).
% aquan=quantized output before encoding.
% code=the encoded output.
amax=max(abs(a));10
aquan=a/amax;
bquan=aquan;
d=2/n;
q=d.*[0:n1];
q=q((n1)/2)*d;
for i=1:n
aquan(nd((q(i)d/2<=aquan) & (aquan<=q(i)+d/2)))=. . .
q(i).*ones(1,length(nd((q(i)d/2<=aquan) & (aquan<=q(i)+d/2))));
bquan(nd(aquan==q(i) ))=(i1).*ones(1,length(nd(aquan==q(i) )));
end20
aquan=aquan*amax;
nu=ceil(log2(n));
code=zeros(length(a),nu);
for i=1:length(a)
for j=nu:1:0
if(x(bquan(i)/(2^j)) == 1)
code(i,(nuj)) = 1;
bquan(i) =bquan(i)2^j;
end
end30
end
sqnr=20*log10(norm(a)/norm(aaquan));
277
1
8-level
16-level
0.8
0.6
0.4
0.2
amplitude
0
-0.2
-0.4
-0.6
-0.8
-1
0246810
t
Figure 7.1: Uniform PCM for a sinusoidal signal using 8 and 16 levels
1) We arbitrarily choose the duration of the signal to be 10 s. Then using the u_pcm.m m-le, we
generate the quantized signals for the two cases of 8 and 16 quantization levels. The plots are shown
in Figure 7.1.
2) The resulting SQNRs are 18.8532 dB for the 8-level PCM and 25.1153 dB for the 16-level uniform
PCM.
278
3
input sequence
0
-1
-2
-3
0100200300400500
m
pause% Press a key to see the plot of the signal and its quantized versions.
plot(t,a,-,t,aquan8,-.,t,aquan16,-,t,zeros(1,length(t)))
2) Using the MATLAB function u_pcm.m given in Computer Problem 7.4, we nd the SQNR for the
3) Again by using the MATLAB function u_pcm.m, the rst ve values of the sequence, the corre-
sponding quantized values, and the corresponding PCM codewords are given as
279
0.05
0.04
0.03
0.02
0.01
quantization error
0
-0.01
-0.02
-0.03
-0.04
-0.05
0100200300400500
m
Input0:4326;1:6656;0:1253;0:2877;1:1465(7.21)
Quantized values0:4331;1:6931;0:1181;0:2756;1:1419(7.22)
8
>>>0
11010
>>>
>>>
001010
>><
Codewords1 0 0 0 0 1(7.23)
>>>
>>>
100011
>>>
>>:
010001
1) This question is solved by using the m-le mula_pcm.m, which is the equivalent of the m-le
u_pcm.m when using alaw PCM scheme. This le is given next
function[sqnr,aquan,code]=mulapcm(a,n,mu)
280
%MULAPCM mu-law PCM encoding of a sequence
% [SQNR,AQUAN,CODE]=MULAPCM(A,N,MU).
% a=input sequence.
% n=number of quantization levels (even).
% sqnr=output SQNR (in dB).
% aquan=quantized output before encoding.
% code=the encoded output.
[y,maximum]=mulaw(a,mu);10
[sqnr,yq,code]=upcm(y,n);
aquan=invmulaw(yq,mu);
aquan=maximum*aquan;
sqnr=20*log10(norm(a)/norm(aaquan));
The two m-les mulaw.m and invmulaw.m given below implement-law nonlinearity and its
inverse. signum.m function that nds the signum of a vector is also given next.
function[y,a]=mulaw(x,mu)
%MULAW mu-law nonlinearity for nonuniform PCM
% Y=MULAW(X,MU).
% X=input vector.
a=max(abs(x));
y=(log(1+mu*abs(x/a))./log(1+mu)).*signum(x);
function x=invmulaw(y,mu)
%INVMULAW the inverse of mu-law nonlinearity
%X=INVMULAW(Y,MU) Y=normalized output of the mu-law nonlinearity.
x=(((1+mu).^(abs(y))1)./mu).*signum(y);
function y=signum(x)
%SIGNUM nds the signum of a vector.
% Y=SIGNUM(X)
% X=input vector
y=x;
y(nd(x>0))=ones(size(nd(x>0)));
y(nd(x<0))=ones(size(nd(x<0)));
y(nd(x==0))=zeros(size(nd(x==0)));
10
Let the vectorabe the vector of length 500 generated according toN0;1; that is, let
arandn1;500
Then by using
dist,a_quan,codemula_pcma;16;255
281
we can obtain the quantized sequence and the SQNR for a 16-level quantization. Plots of the
inputoutput relation for the quantizer and the quantization error are given in Figures 7.4, 7.5, and
7.6.
Using mula_perm.m, the SQNR is found to be 13.96 dB. For the case of 64 levels we obtain SQNR =
282
0.8
0.6
0.4
0.2
-0.2
quantization error
-0.4
-0.6
-0.8
-1
0100200300400500
m
2.5
1.5
0.5
-0.5
quantizer output
-1
-1.5
-2
-2.5
-3-2-10123
quantizer input
Figure 7.4: Quantization error and quantizer inputoutput relation for a 16-level-law PCM
283
0.3
0.2
0.1
-0.1
quantization error
-0.2
-0.3
-0.4
0100200300400500
m
quantizer output
-1
-2
-3
-3-2-10123
quantizer input
Figure 7.5: Quantization error and quantizer inputoutput relation for a 64-level-law PCM
284
0.15
0.1
0.05
-0.05
quantization error
-0.1
-0.15
-0.2
0100200300400500
m
quantizer output
-1
-2
-3
-3-2-10123
quantizer input
Figure 7.6: Quantization error and quantizer inputoutput relation for a 128-level-law PCM
285
Chapter 8
Problem 8.1
1)To show that the waveforms nt,n1;2;3 are orthogonal we have to prove that
Z1
mt ntdt0; mn
1
Clearly,
Z1Z4
c12 1t 2tdt 1t 2tdt
10
Z2Z4
1t 2tdt 1t 2tdt
02
2Z4
1Z111
dtdt242
404244
0
Similarly,
Z1Z4
c13 1t 3tdt 1t 3tdt
10
1Z2Z3Z4
1Z111
dtdtdtdt
40414243
0
and
Z1Z4
c23 2t 3tdt 2t 3tdt
10
1Z2Z3Z4
1Z111
dtdtdtdt
40414243
0
Z4Z1Z2Z3Z4
x1xt 1tdt 1dt1dt1dt1dt0
020212223
Z4Z4
x2xt 2tdt1xtdt0
020
Z4Z1Z2Z3Z4
x3xt 3tdt 1dt1dt1dt1dt0
020212223
286
As it is observed,xtis orthogonal to the signal waveforms nt,n1;2;3 and thus it can not
Problem 8.2
1)The expansion coecientsfcng, that minimize the mean square error, satisfy
Z1Z4
cnxt ntdtsin t ntdt
104
Hence,
Z4Z2Z4
c1sin t 1tdt1sin tdt1sin tdt
04204224
2 t22 t4
coscos
4042
22
01100
Similarly,
Z4Z4
c2sin t 2tdt1sin tdt
04204
2 t4 24
cos11
40
and
Z4
c3sin t 3tdt
04
1Z2Z3Z4
1Z t1 t1 t1 t
sindtsindtsindtsindt
204214224234
0
Note thatc1,c2can be found by inspection sincesin tis even with respect to thex2 axis and
4
1t, 3tare odd with respect to the same axis.
Z1
3
X
Eminjxtj2dtjcij2
1
i1
Thus,
Z4Z4
22
Eminsin tdt411cos tdt16
042022
21sin t16216
2022
287
Problem 8.3
88
><1><1
0t <1 1t <2
1t 2t
>:0>:0
o.w o.w
88
><1><1
2t <3 3t <4
3t 4t
>:0>:0
o.w o.w
010101
s1t2111 1t
BCBCBC
BCBCBC
BsCB2CB C
1 1 0 2t
2tCBCBC
B
BCBCBC
BsCB1CB C
1 11CB3tC
B3tCB
@A@A@A
s4t122 2 4t
Note that the rank of the transformation matrix is 4 and therefore, the dimensionality of the
waveforms is 4
s12111
s22 1 1 0
s311 11
s4122 2
s
q2
p
d1;2js1s2j2422125
288
Similarly we nd that
s
q2
p
d1;3js1s3j21 02 05
s
q2
p
d1;4js1s4j21 1 1312
s
q2
p
d2;3js2s3j23 2 0 114
s
q2
p
d2;4js2s4j23 3 3231
s
q2
p
d3;4js3s4j20 1 3319
p
Thus, the minimum distance between any pair of vectors isdmin5.
Problem 8.4
s12 2 2
s22 0 0
s3022
s42 2 0
Problem 8.5
Case 1:fck, wherekis a positive integer:
2Tb
ZTZT
bb
b2
E1E2s2t dt2Ecos2 fct dt
01Tb0
ZT
Ek
bb
1cos4tdt
Tb02Tb
"T#
E
bTbkb
Tbsin4t
Tb2 k2Tb
0
E
b
289
Case 2:fc6k, butfcTb1:
2Tb
ZTZT
bb
b2
cos2 fct dt
E1E2s2t dt2E
01Tb0
ZT
E
bb
1cos4 fctdt
Tb0
2"#T3
E
b1b
4T5
sin4 fct
Tbb4 fc
0
E
b
Esin4 fcTb
b
2 fcTb
Noting thatsin4 fcTb1 andfcTb1, we conclude that teh seconfd term is negligible
Problem 8.6
Proof of the energy part in this problem is the same as the solution of problem 8.5. For the
orthogonality, we have
ZTZT
bb
b
s1ts2t dt2Ecos2 f1tcos2 f2tdt
0Tb0
ZT
2E
bb
cos 2f1f2tcos 2f1f2tdt
2Tb0
"#T
2Ek1k21k1k2b
b1
sin 2tsin 2t
2Tb2 f1f22Tb2 f1f22Tb
0
0
The proof for the case wheref1Tb1 andf2Tb1 is similar to the proof of case 2 in the solution
of Problem 8.5.
Problem 8.7
htsTts3tst
where we have used the fact thatstis even with respect to thetT3axis.
22
290
2)The output of the matched lter is
Zt
ytst ? stsstd
0
8
>>>0
t <0
>>>
>>>2
At0t <1
>>>
>>>2
>>>A2t1t <2
>>>
<22
At22t <3
>>>22
A4t3t <4
>>>
>>>2
At44t <5
>>>
>>>
>>>A26t5t <6
>>>
:0
6t
. . . . . . . . . . . . . . . .2
2A
. . . . . .2
A
1 3 5 642
3)At the output of the matched lter and fortT3 the noise is
ZT
nTnhTd
0
ZTZT
nsTTdnsd
00
nTEnnvssvddv
00
ZTZT
ssvEnnvddv
00
ZTZT
N0
ssvvddv
200
ZT
N0
s2dN0A2
20
P eQS
No
291
whereSis the output SNR from the matched lter. Since
N
o
Sy2T4A4
No En2N0A2
T
we obtain
2s3
4A2
5
P eQ4
N0
Problem 8.8
s40;0;2
s11;1;0s31;1;0
21
s22;1;0
292
3. The matrix representation of the four vectors is
23
11 0
67
67
627
10
67
67
617
1 07
6
45
002
The three columns are clearly linearly independent, hence the rank of the matrix is 3. Therefore
Problem 8.9
"#"#
1ej2 f T
ht F1Hf F1 F1
j2 fj2 f
01
tT
2
A
sgntsgntT 2@
T
0101
TtTTt
22
A2@Aht
sthTt2@
TT
IfgTtsinct, then its matched waveform ishtsinctsinct. Since, (see Problem 2.17)
sinct ?sinctsinct
gTtsinc2tT
T2
293
then the matched waveform is
htgTTtsinc2TtgTt
T2
where the last equality follows from the fact thatgTtis even with respect to thetTaxis. The
2
output of the matched lter is
yt F1gTt ? gTt
"#
T2T
F1fej2 f T
42
T2TT
t
2sincTtT2gT2
Thus the output of the matched lter is the same sinc function, scaled byTand centered attT.
2
Problem 8.11
ZtZt
ytr dsind
00
ZtZt
sidnd
00
At timetTwe have
ZTZT sZT
yTsidndEbTnd
00T0
0s12
E
b
E@TA ET
sb
T
"ZT#
ZT
PnEnnvddv
00
ZTZT
Ennvddv
00
ZTZT
N0N0
vddvT
2002
294
2)The transfer function of the RC lter is
Hf 1
1j2 RCf
RCe0RC1
At timetTwe obtain
ZTZT
T T 1
yT 1eRCsieRCdeRCneRCd
RC0RC1
eRCeRCd
RC2T0
2T ET2
b
eRCeRC1
T
ET2
b
RC
T1e
2RCe2e2RC2
Hence,
4ERCT2
SNREsb1eRC
PnT N0
3)The value ofRCthat maximizes SNR, can be found by setting the partial derivative of SNR with
#SNRTTTTT
aaa
#a01eae e1a1
295
Solving this transcendental equation numerically fora, we obtain
TT
)RCa
a1:26=1:26
Problem 8.12
8
><1
t1;0t < T
h1ts1TtT
>:0
otherwise
Z1
y1ts1h1td
1
Z1
y1t1t1d
0TT
ZtZt
1t1
d2d
0TT2T20
t3t2
6T22T
IfTt2T, then
ZT
y1t1t1d
tTT
ZTZT
1t1
d2d
tTT2T2t
tT 3tTT
6T223
8
>>>0
t0
>>>
><t3t2
20< tT
y1t6T2T
>>>tT 3tTT
>>>6T223T < t2T
>:
0 2T < t
A sketch ofy1tis given in the next gure. As it is observed the maximum ofy1t, which isT, is
3
achieved fortT.
296
T/3
2T
T
8
><1T
;0t
h2t2
>:2T
;< tT
2
Z1
y2ts2h2td
1
Rt
Ift0 ort2T, theny2t0. If 0< tT, theny2t2d 2t. IfT< tT, then
202
T Zt
ZtTZ
22
y2t4d2dd7t9T
0tTT2
22
T ZtTZT
Z
22
y2t4d2dd19T7t
tTTtT2
22
In summary
8
>>>0
t0
>>>
>>>T
2t0< t
>>>2
>><9
7tTT< tT
y2t22
>>>19T3T
>>>27t T < t2
>>>3
2t4TT< t2T
>>>2
>>:
0 2T < t
297
5T
2
T2T
........
T
..........
2T
3TT
2T2
Problem 8.13
Since the rate of transmission isR105bits/sec, the bit intervalTbis 105sec. The probability of
P eQ2Eb
N0
298
Problem 8.14
1)For a binary PAM system for which the two signals have unequal probability, the optimum detector
is
s1
r>N0pln1p
<4Ep
b
s2
p7
HereE=N010 andp0:3. Substituting in the above gives0:025ln0:02118.
b
3
pP ejs11pP ejs2
ZZ1
pf rjs1dr1pf rjs1dr
1
Zrp2Z1p2
ErE
bb
p1peN0dr1p1peN0dr
1 N0 N0
Z1Z1
x21x2
p1pe2dx1ppe2dx
212
2
where
ssss
2E22E2
bb
12
N0N0N0N0
Thus,
ss#"ss#
"
22E2
P epQ2Eb1pQb
N0N0N0N0
P e0:3Q4:37740:7Q4:5668
3:5348106
s
p
P eQ2EbQ203:8721106
N0
Problem 8.15
299
Assuming thatEn2t2, we obtain
n
En1n2Es1tntdts2vnvdv
00
ZTZT
s1ts2vEntnvdtdv
00
ZT
2
ns1ts2tdt
0
0
where the last equality follows from the orthogonality of the signal waveformss1tands2t.
Problem 8.16
N01pN0
plnpln 2
4Ep4E
bb
Z1
p
2
P epam 11perEb=N0dr
N0
Zp
2
pam11perEb=N0dr
1 N0
"p#"p#
2E1E
bb
pQp
3QN0=23N0=2
s#"sp#
"p
22N0=Eln 22E12E2N0=Eln 2
bbbb
3Q4N03QN04
rp
pr
N0=Eln 22E12E2N0=Eln 2
3)Here we havePe2Q2bbQbb, substitutingE1 and
34N03N04b
N00:1 we obtain
"p#"p#
20:2ln 2p1p0:2ln 221
PeQ2020Q4:5496Q4:3946
343433
300
Problem 8.17
and decides in favor of the signal with the largestCr;sm. Sinces1t s2t, the energy of the
two message signals is the same, and therefore the detection rule is written as
s1
Z1
N0p2
r ts1tdt>N0lnP s2ln
1<4P s14p1
s2
Z1ZTZT
r ts1tdts1t2dtnts1tdt
100
En
s
whereEis the energy of the signal andnis a zero-mean Gaussian random variable with variance
s
"ZT#
ZT
2
nEnnvs1s1vddv
00
ZTZT
s1s1vEnnvddv
00
ZTZT
N0
s1s1vvddv
200
ZT
N0N0
js1j2dE
202s
Similarly we nd that
ss#
"
12N0p2
P ejs2Q2Esln
N04Ep1
s
301
3)In the next gure we plot the probability of error as a function ofp1, for two values of the
SNR2Es. As it is observed the probability of error attains its maximum for equiprobable signals.
N0
-24
x10
0.168
0.147
0.126
0.15
0.084
P(e)P(e)
0.063
SNR=1 (0 db)
0.042
SNR=100 (20 db)
0.021
00
0.10.20.30.40.50.60.70.80.9 10.10.20.30.40.50.60.70.80.9 1
0
0
Probability pProbability p
Problem 8.18
1)The two equiprobable signals have the same energy and therefore the optimal receiver bases its
s1
Z1Z1
r ts1tdt>r ts2tdt
1<1
s2
2)If the message signals1tis transmitted, thenr ts1tntand the decision rule becomes
Z1
s1tnts1ts2tdt
1
Z1Z1
s1ts1ts2tdtnts1ts2tdt
11
s1
Z1
s1ts1ts2tdtn>0
1<
s2
302
wherenis a zero mean Gaussian random variable with variance
Z1Z1
2
ns1s2s1vs2vEnnvddv
11
ZTZT
s1s2s1vs2vN0vddv
002
ZT
N0
s1s22d
20
ZTZT
N02A2
200TAd
N0A2T
23
Since
Z1ZT
s1ts1ts2tdtAt2AtAdt
10TT
A2 T
6
1Z@x
q2expAdx
2
T N0
2AT N012A
66
2s3
A2T
5
Q4
6N0
Similarly we nd that
2s3
A2 T
5
P ejs2Q4
6N0
and since the two signals are equiprobable, the average probability of error is given by
1
P e1P ejs1P ejs2
22
2s3"s#
A2TE
5Qs
Q4
6N02N0
Problem 8.19
303
WithP2106we nd from tables that
s
A2T
4:74=)A2T44:93521010
N0
If the data rate is 10 Kbps, then the bit interval isT104and therefore, the signal amplitude is
p
A44:935210101046:7034103
Similarly we nd that when the rate is 105bps and 106bps, the required amplitude of the signal is
A2:12102andA6:703102respectively.
Problem 8.20
EA2T
b
The dimensionality of the signal space is one, and by choosing the basis function as
8
><1T
p
0t <
tT2
>:1T
p
T2tT
p
s1;2 ATn
withna zero-mean Gaussian random variable of varianceN0. The probability of error for antipodal
2
signals is given by, whereEA2T. Hence,
b
2s3
s!
2A2T
5
P eQ2EbQ4
N0N0
Problem 8.21
304
and
ZT
ytetTe2d
For this case we havetT
ZtT
tT12
ytetTe2dee
02tT
11
1tetTet3T
etTe222
20
1Therefore8>1
Ttt
>><2eTetet0< tT
2eee>
305
T
0
Fort <0, there is no overlap and the integral is zero. For 0< tTwe have the following gure,
where the the product of the two signals in the overlapping region isshteeTt
0
T
Problem 8.22
We havePavRE2106E, hence
bb
s! s!
PbQ2EbQ2Pav106
N0RN0
ss
2Pav2PavPav
Q4:77)4:772
RN02106N0106N0
Problem 8.23
8
><nt
ifs0twas transmitted
rt
>:A
ntifs1twas transmitted
Assuming thatsthas unit energy, then the sampled outputs of the crosscorrelators are
rsmn; m0;1
p
wheres00,s1ATand the noise termnis a zero-mean Gaussian random variable with variance
"ZT#
ZT
211
nEpntdtpnd
T0T0
TZT
1Z
Entndtd
T00
ZTZT
N0N0
tdtd
2T002
Since the signals are equally probable, the optimal detector decides in favor ofs0if
306
otherwise it decides in favor ofs1. The decision rule may be expressed as
s0
ppp
22
PMr;s0rATr2rAT AT
>
eN0eN01
PMr;s1<
s1
or equivalently
s1
p
r>1AT
<2
s0
p
The optimum threshold is1AT.
2
b)The average probability of error is
1
P e1P ejs0P ejs1
22
1p
1Z2AT
1Z1
f rjs0drf rjs1dr
21ApT21
2
1pp
12Z2ATr 2
1Z1r11AT
peN0drpeN0dr
21ApT N021 N0
2
rp
12
12Z2AT2
1Zr1x1N01x
pe2dxpe2dx
212ApT2212
2N
0
s#
"hi
pp
Q12ATQSNR
2N0
where
12
AT
SNR2
N0
Thus, the on-o signaling requires a factor of two more energy to achieve the same probability of
Problem 8.24
8
><A
Ttcos2 fcTt0tT
stuTtT
>:0
otherwise
307
2)The output of the matched lter attTis
ZT
gT ut ? stuTsd
tT
0
ZT
A2
T2cos22 fcTd
T20
ZT
vTA2
v2cos22 fcvdv
T20
" !#T
A2v3v21vcos4 fcv
sin4 fcv
ZT
qTu2d
0
ZT
A2
22
cos2 fcd
T20
However, this is the same expression with the case of the output of the matched lter sampled at
tT. Thus, the correlator can substitute the matched lter in a demodulation system and vise
versa.
Problem 8.25
qq
r t2Pscos2 fct2Pcsin2 fct
s!!
qP
2PcPssin2 fctantan1s
Pc
s!!
p1
2PTsin2 fctancosPc
PT
wherean 1 are the information symbols andPTis the total transmitted power. As it is observed
s!
Pc
nancos1
PT
Any method used to extract the carrier phase from the received signal can be employed at the
receiver. The following gure shows the structure of a receiver that employs a decision-feedback PLL.
308
t=Tb
RTbv(t)
Threshold()dt
0
DFPLL
cos(2 fct+)
2)At the receiver the signal is demodulated by crosscorrelating the received signal
s!!
p1
r t2PTsin2 fctancosPcnt
PT
with cos2 fctand sin2 fct. The sampled values at the output of the correlators are
i1
p
1h
r12PTnstsinnnctcosn
22
i1
p
1h
r22PTnstcosnnctsinn
22
wherenct,nstare the in-phase and quadrature components of the noisent. If the detector
has made the correct decision on the transmitted point, then by multiplyingr1bycosnandr2by
hi
1p
r1cosn2PTsincos2ncossinncosn
2
hi
1p
r2sinn2PTcoscosnsinnsinsin2n
2
1p
etr1cosnr2sinn2PTsin
2
The erroretis passed to the loop lter of the DFPLL that drives the VCO. As it is seen only the
3)Having a correct carrier phase estimate, the output of the lowpass lter sampled attTbis
s!
p1
r 12PTsin cosPcn
2PT
s
1pPc
1n
22PTPT
s
1Pc
1n
22PTPT
309
Note thatTbhas been normalized to 1 since the problem has been stated in terms of the power of
P errorQ2PT1Pc
N0PT
SNRloss10 log1Pc
10
PT
WhenPc=PT0:1, then
The negative sign indicates that the SNR is decreased by 0.4576 dB.
Problem 8.26
r t gTtcos2 fctnt
t2gttcos2 fct
E
g
we obtain
ZT sZT
r t tdt2g2tcos2 fctcos2 fctdt
0Eg0T
ZTs
nt2gttcos2 fctdt
0Eg
sZT
2g2t
T
tcosdtn
E02cos22fc
g
s
E
g
2cosn
wherenis a zero-mean Gaussian random variable with varianceN0. If we assume that the signal
2
s1tgTtcos2 fctwas transmitted, then the probability of error is
0s1
E
g
P errorjs1tP@cosn <0A
2
2v32v3
uuu
Ecos276t2Ecos27
gus
tQ
Q64545
N0N0
whereE E=2 is the energy of the transmitted signal. As it is observed the phase error
sg
reduces the SNR by a factor
SNRloss 10 logcos2
10
310
2)When45o, then the loss due to the phase error is
Problem 8.27
W30006002400 Hz
Since each symbol of the QPSK constellation conveys 2 bits of information, the symbol rate of
transmission is
R24001200 symbols/sec
2
Thus, for spectral shaping we can use a signal pulse with a raised cosine spectrum and roll-o factor
1, that is
jfj
Xr cf T1cos Tjfj1cos2
224002400
If the desired spectral characteristic is split evenly between the transmitting lterGTf and the
GTf GRf1cosjfj;jfj<11200
12002400T
to ChannelGT(f )an
QPSK
cos(2 fct)
2)If the bit rate is 4800 bps, then the symbol rate is
R48002400 symbols/sec
2
In order to satisfy the Nyquist criterion, the the signal pulse used for spectral shaping, should have
the spectrum
Xf Tf
W
p
Thus, the frequency response of the transmitting lter isGTfTf.
W
311
Problem 8.28
The constellation of Fig. P-10.9(a) has four points at a distance 2Afrom the origin and four points at
p
a distance 22A. Thus, the average transmitted power of the constellation is
1h2pi2
Pa42A422A26A
8
p
The second constellation has four points at a distance7Afrom the origin, two points at a distance
p
3Aand two points at a distanceA. Thus, the average transmitted power of the second constellation
is
pp2i9
1h2
Pb47A23A2A2A2
82
SincePb< Pathe second constellation is more power ecient.
Problem 8.29
The optimum decision boundary of a point is determined by the perpendicular bisectors of each line
segment connecting the point with its neighbors. The decision regions for the V.29 constellation are
The following gure depicts a 4-cube and the way that one can traverse it in Gray-code order (see
John F. Wakerly, Digital Design Principles and Practices, Prentice Hall, 1990). Adjacent points are
1110
1111
0110
1010
1011
0111
0010
1100
1101
0011
1000
1001
0101
0100
0000 0001
One way to label the points of the V.29 constellation using the Gray-code is depicted in the next
gure. Note that the maximum Hamming distance between points with distance between them as
large as 3 is only 2. Having labeled the innermost points, all the adjacent nodes can be found using
1000
0011
1001
1011
21
1
2
1
0001
1
1
1
0101
2
1
1
1
2
0111
1111
0000
0010
0110
1
1
0100
2
1
1
2
1
1100
1110
1010
1101
313
Problem 8.31
1)Consider the QAM constellation of Fig. P-10.12. Using the Pythagorean theorem we can nd the
a2a2A2=)a1pA
2
The radius of the outer circle can be found using the cosine rule. Sincebis the third side of a triangle
withaandAthe two other sides and angle between then equal to75o, we obtain
p
b2a2A22aAcos 75o=)b13A
2
2)If we denote byrthe radius of the circle, then using the cosine theorem we obtain
A2r2r22rcos 45o=)rApp
22
!2
2
P81App=)PAp
PSKPSK
82222
The relative power advantage of the PSK constellation over the QAM constellation is
gainPPSK8pp1:5927 dB
P213222
QAM
Problem 8.32
1)Although it is possible to assign three bits to each point of the 8-PSK signal constellation so that
adjacent points dier in only one bit, this is not the case for the 8-QAM constellation of Figure
P-10.12. This is because there are fully connected graphs consisted of three points. To see this
consider an equilateral triangle with vertices A, B and C. If, without loss of generality, we assign the
all zero sequencef0;0; : : : ;0gto point A, then point B andCshould have the form
B f0; : : : ;0;1;0; : : : ;0gC f0; : : : ;0;1;0; : : : ;0g
where the position of the 1 in the sequences is not the same, otherwise B=C. Thus, the sequences of
2)Since each symbol conveys 3 bits of information, the resulted symbol rate is
90106
Rs30106symbols/sec
3
314
3)The probability of error for an M-ary PSK signal is
s#
"
PM2Q2Essin
N0M
whereas the probability of error for an M-ary QAM signal is upper bounded by
s#
"
PM4Q3Eav
M1N0
Since, the probability of error is dominated by the argument of theQfunction, the two signals will
s
q3SNR
2SNRPSKsinQAM
MM1
WithM8 we obtain
s
q3SNR
3
2SNRPSKsinQAM=)SNRPSK1:4627
87SNRQAM720:38272
4)Assuming that the magnitude of the signal points is detected correctly, then the detector for the
8-PSK signal will make an error if the phase error (magnitude) is greater than 22:5o. In the case of
the 8-QAM constellation an error will be made if the magnitude phase error exceeds 45 o. Hence, the
Problem 8.33
1
2T12000
frequencies isf1, where1is the bit rate, the two frequencies arefc1andfc1. Since
TT2T2T
W4000 Hz, we may select11000, or, equivalently,12000. Hence, the bit rate is 2000 bps,
2TT
and the two FSK signals are orthogonal.
(5) Four FSK with noncoherent detection. In this case we need four frequencies with separation of1
T
between adjacent frequencies. We selectf1fc1:5,f2fc1,f3fc1, andf4fc1:5,
T2T2TT
where1500 Hz. Hence, the symbol rate is11000 symbols per second and since each symbol
2TT
315
carries two bits of information, the bit rate is 2000 bps.
(6)M8 FSK with noncoherent detection. In this case we require eight frequencies with frequency
separation of1500 Hz for orthogonality. Since each symbol carries 3 bits of information, the bit
T
rate is 1500 bps.
Problem 8.34
The three symbolsA, 0 andAare used with equal probability. Hence, the optimal detector uses
two thresholds, which areAandA, and it bases its decisions on the criterion
22
A:r >A
2
0 :A< r <A
22
A:r <A
2
If the variance of the AWG noise is2, then the average probability of error is
n
A2 0ZA21
Zr
2A2r
2112
P e11qe2ndr@1qe2ndrA
31 23A 2
2n22n
1rA2
1Z12
qe2ndr
3A 2
22n
1A1A1A
3Q2n32Q2n3Q2n
4A
3Q2n
Problem 8.35
f nejnj
2
The optimal receiver uses the criterion
AA
f rjA>>
jrAjjrAj
)r0
f rj Ae<1=<
AA
316
The average probability of error is
P e1P ejA1P ej A
22
0Z1
1Z1
f rjAdrf rj Adr
2120
0Z1
1Zj1
erAjdr2ejrAjdr
21220
ZAZ1
ejxjdxejxjdx
414A
1A11
xx
4e14eA
1
A
2e
nexdx
21
Z1
exx2dx2!2
032
pp
21
P e1e2Ae2SNR
22
p
ln21052SNR=)SNR58:53417:6741 dB
where SNR is the signal to noise ratio at the output of the matched lter. WithP e105we nd
p
SNR4:26 and thereforeSNR18:147612:594 dB. Thus the required signal to noise ratio is 5
Problem 8.36
The points in the constellation are at distanced;3d;5d; : : : ;M1dfrom the origin. Since
the square of the distance of a point in the constellation from the origin is equal to the energy of the
317
signal corresponding to that point, we have two signals with energyd2, two signals with energy 9d2,
two signals with energy 25d2,...., and two signals with energyM12d2. The average energy is
1X2d2
EavEi1925 M12
MM
i
MM12M1
122232 M2
6
MM12M1MM1M2MM21
1232 M12
666
Therefore,
2d2MM21d2M21
Eav
M63
Problem 8.37
PMr;smf rjsmP sm
PMr;smf nP sm
wheref nis theN-dimensional PDF for the noise channel vector. If the noise is AWG, then
jrsmj2
fn1eN0
N
N02
jrsmj2
Maximizingf rjsmP smis the same as minimizing the reciprocaleN0=P sm, or by taking the
Dr;sm jrsmj2N0P sm
318
If the vectorsr,smcorrespond to the waveformsr tandsmt, where
N
X
r tri it
i1
N
X
smtsm it
;i
i1
then,
Z1Z1
NN
XX
r tsmtdtri itsm jtdt
;j
11
i1j1
NNZ1
XX
rism it jtdt
;j
i1j11
NNN
XXX
rismrism
;ji;j;i
i1j1i1
rsm
Similarly we obtain
Z1
jsmtj2dt jsmj2 E
sm
1
c1R(
...................................... rs1
..............)dt
(t)
Selectc2R(s1
...................................... rs2
..............)dt
the
r (t)
.
(t)
....largests2
.
cMR(
......................................rsM
..............)dt
sM(t)
Parallel to the development of the optimal receiver usingNlters matched to the orthonormal
319
the signal waveformssmt. The output of themthmatched lterhmt, at the time instantTis
ZTZT
r hmTdr smTTd
00
ZT
r smd
0
rsm
The structure of this optimal receiver is shown in the next gure. The optimal receivers, derived
in this problem, are more costly than those derived in the text, sinceNis usually less thanM, the
number of signal waveforms. For example, in anM-ary PAM system,N1 always less thanM.
t=T
c1
rs
h1(t)=s1(Tt)1
t=T
Selectc2
rs
h2(t)=s2(Tt)2
the
r (t)
.
largest...
.
t=TcM
rs
M
hM(t)=sm(Tt)
Problem 8.38
WRbHz
2 logM
2
Since,
samplesbitsbits
Rb8103864103
secsamplesec
we obtain
8
>>>16
KHzM4
><
W10:667 KHzM8
>>>
>:
8 KHzM16
Problem 8.39
320
The vectorrr1; r2at the output of the integrators is
Z1Z2
:5
rr1; r2r tdt;r tdt
01
n1Ennvddvd1:5
0020
n2Ennvddvd1
1121
Thus, the vector representation of the received signal (at the output of the integrators) is
r1n1; n2
r0:5n1;1n2
Suppose now that the detector bases its decisions on the rule
s1
r1r2>T
<
s2
P 1n1n2< T P n1n2< T1
Pn<T
n1n22d
12
1:5120:51:5
321
Hence,
T1x2
1Z2
P ejs1qe2ndx
2 2n1
Similarly we nd that
P ejs2P 0:5n11n2> T
P n1n2> T0:5
1x2
1Z2
qe2ndx
2 2nT0:5
1
P e1P ejs1P ejs2
22
T1x2Z1x2
1Z212
qe2ndxqe2ndx
22 2n122 2nT0:5
To nd the value ofTthat minimizes the probability of error, we set the derivative ofP ewith
respect toTequal to zero. Using the Leibnitz rule for the dierentiation of denite integrals, we
obtain
"T#
22
T0:5
#P e11
qe22ne22n0
#T 2
22n
or
T12T0:52=)T0:25
s1
r1r2>0:25
<
s2
Problem 8.40
n
Ci
PiB@Ap1pni
i
However, there is a bit error at the output of the terminal receiver only when an odd number of
322
LetPevenbe the probability that an even number of repeaters produces an error. Then
01
XBn
Ci
Peven@Ap1pni
ieveni
and therefore,
01
n
XBn
Ci
PevenPodd@Ap1pnip1pn1
i0i
Clearly,
0101
XBnXBn
CiCi
PevenPodd@Ap1pni@Ap1pni
ieveniioddi
0101
nXBn
aXBCiCi
@Ap1pni@Ap1pni
ieveniioddi
1ppn12pn
where the equality (a) follows from the fact that1iis 1 forieven and1 wheniis odd. Solving
the system
PevenPodd1
PevenPodd12pn
we obtain
1
PnPodd112pn
2
12pn1n2pnn12p2
2
Since,p1 we can ignore all the powers ofpwhich are greater than one. Hence,
1
Pn11n2pnp100106104
2
Problem 8.41
s#
"
P eKQEb
N0
323
hqi
Thus, withP e106andK100, we obtain the probability of each repeaterPrQEb108.
N0
The argument of the functionQthat provides a value of 108is found from tables to be
s
E
b
5:61
N0
Problem 8.42
R1
jHf j2df
Beq0
jHf j2max
It is usually convenient to substitutejHf j2forjHf j2in the denominator, since the peaking
f0max
of the magnitude transfer function may be high (especially for small) creating in this way anomalies.
On the other hand ifis less, but close, to one,jHf j2can be very well approximated by
max
jHf j2. Hence,
f0
R1
jHf j2df
Beq0
jHf j2
f0
and since
2
!2j2 f2!n!n
nK
jHf j2
!2n42f2j2 f2!n
we nd thatjH0j 1. Therefore,
Z1
BeqjHf j2df
0
TheBeqcan be written as
j1
1Z
BeqHsHsds
4 jj1
324
is a rational function ofs, the integral is equal to half the sum of the residues of the left half plane
q
s!n!n21HsHsp
s!n!n21
!n1142
848=!n
2
1!22!n22!n2
n2KK
8=!n
1!22
n2
8=!n
Problem 8.43
HsGs=sGs1p
1Gs=ssGss22s1
The poles of the system are the roots of the denominator, that is
pp
224 11
1;2pjp
222
Since the real part of the roots is negative, the poles lie in the left half plane and therefore, the
system is stable.
Ds22!ns!2
n
we identify the natural frequency of the loop as!n1 and the damping factor as1p.
2
Problem 8.44
K
HsGs=sGsK1
1Gs=ssGs1s2sKs21K
s
11
jH0j jHsj1
s0
325
2)The poles of the system are the roots of the denominator, that is
p
114K1
1;2
21
In order for the system to be stable the real part of the poles must be negative. SinceKis greater
than zero, the latter implies that1is positive. If in addition we require that the damping factor
1
p
K >1
41
Problem 8.45
R211RCs1s
GsCs22
R1R211R1R2Cs11s
Cs
2R2C; 1R1R2C
Problem 8.46
Assuming that the input resistance of the operational amplier is high so that no current ows
V2 AV1
1
V1V2R1i
Cs
V1V0iR
where,V1,V2is the input and output voltage of the amplier respectively, andV0is the signal at the
V11R11
1Cs
AAR
If we letA! 1(ideal amplier), then
V21R1Cs12s
V1RCs1s
1RC; 2R1C
326
Problem 8.47
2y2m
m
d2Xdym
d2ymd0
m
Suppose now that we approximate the derivative of the log-likelihood2by the nite dierence
d222
d2
d2
d
P2P2
mymmym
2
"Z2#
Z2
1X
2r tutmTdtr tutmTdt
m
whereutgRtis the impulse response of the matched lter in the receiver. However, this
is the expression of the early-late gate synchronizer, where the lowpass lter has been substituted
by the summation operator. Thus, the early-late gate synchronizer is a close approximation to the
Problem 8.48
p
1)ris a Gaussian random variable. IfEis the transmitted signal point, then
b
q
Er Er1Er21kEmr
b
r1k2
The probability density function ofris
rmr2
2
f r 1pe2r
2r
327
and the probability of error is
Z0
P2f r dr
1
mr
2
1Z
prex2dx
21
0v1
uu2
mrC
tA
QB@2
r
where
m21k2E
rb
2222
r1k2
The value ofkthat maximizes this ratio is obtained by dierentiating this expression and solving for
2
k1
2
Note that if1> 2, thenk >1 andr2is given greater weight thanr1. On the other hand, if2> 1,
thenk <1 andr1is given greater weight thanr2. When12,k1. In this case
m22E
rb
22
r1
2)When232,k1, and
213
!
m2112Eb4E
r3b
22122
r331
191
m24EE
rbb
2222
r1311
Computer Problems
328
Computer Problem 8.1
Figure 8.1 illustrates the results of this simulation for the transmission ofN10000 bits at several
dierent values of SNR. Note the agreement between the simulation results and the theoretical value
ofP2. We should also note that a simulation ofN= 10000 data bits allows us to estimate the error
probability reliably down to aboutP2103. In other words, withN= 10000 data bits, we should
have at least ten errors for a reliable estimate ofPe. MATLAB scripts for this problem are given next.
0
10
Simulation
Theoretical
-1
10
-2
10
2
P
-3
10
-4
10
-5
10
024681012
10 logE/N0
10b
Figure 8.1: Error probability from Monte Carlo simulation compared with theoretical error probability
function[p]=smldPe81(snrindB)
% [p]=smldPe54(snrindB)
% SMLDPE81 nds the probability of error for the given
% snrindB, signal-to-noise ratio in dB.
E=1;
SNR=exp(snrindB*log(10)/10);% signal-to-noise ratio
sgma=E/sqrt(2*SNR);% sigma, standard deviation of noise
N=10000;
% generation of the binary data source
for i=1:N,10
temp=rand;% a uniform random variable over (0,1)
if(temp<0.5),
dsource(i)=0;% With probability 1/2, source output is 0.
else
dsource(i)=1;% With probability 1/2, source output is 1.
end
end;
% detection, and probability of error calculation
numoferr=0;
for i=1:N,20
% matched lter outputs
if(dsource(i)==0),
r0=E+gngauss(sgma);
r1=gngauss(sgma);% if the source output is 0
else
r0=gngauss(sgma);
r1=E+gngauss(sgma);% if the source output is 1
end;
% Detector follows.
if(r0>r1),30
decis=0;% Decision is 0.
else
decis=1;% Decision is 1.
end;
if(decis=dsource(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;
p=numoferr/N;% probability of error estimate
330
-1
10
Simulation
Theoretical
-2
10
-3
10
2
P
-4
10
-5
10
-6
10
0246810
10 logE/N0
10b
Figure 8.2: Error probability from Monte Carlo simulation compared with theoretical error probability
Figure 8.2 illustrates the results of this simulation for the transmission of 10000 bits at several
dierent values of SNR. The theoretical value forP2is also plotted in Figure 8.2 for comparison.
function[p]=smldPe82(snrindB)
% [p]=smldPe82(snrindB)
% SMLDPE82 simulates the probability of error for the particular
% value of snrindB, signal-to-noise ratio in dB.
E=1;
SNR=exp(snrindB*log(10)/10);% signal-to-noise ratio
sgma=E/sqrt(2*SNR);% sigma, standard deviation of noise
N=10000;
% Generation of the binary data source follows.
for i=1:N,10
temp=rand;% a uniform random variable over (0,1)
if(temp<0.5),
dsource(i)=0;% With probability 1/2, source output is 0.
else
dsource(i)=1;% With probability 1/2, source output is 1.
end
end;
% The detection, and probability of error calculation follows.
numoferr=0;
for i=1:N,20
% the matched lter outputs
if(dsource(i)==0),
r=E+gngauss(sgma);% if the source output is 0
else
r=E+gngauss(sgma);% if the source output is 1
end;
% Detector follows.
if(r<0),
decis=0;% Decision is 0.
else30
decis=1;% Decision is 1.
end;
if(decis=dsource(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;
p=numoferr/N;% probability of error estimate
Figure 8.3 illustrates the estimated error probability based on 10000 binary digits. The theoretical
332
0
10
Simulation
Theoretical
-1
10
-2
10
2
P
-3
10
-4
10
-5
10
051015
10 logE/N0
10b
Figure 8.3: Error probability from Monte Carlo simulation compared with theoretical error probability
333
echo on
SNRindB1=0:1:15;
SNRindB2=0:0.1:15;
for i=1:length(SNRindB1),
smlderrprb(i)=smldPe83(SNRindB1(i));% simulated error rate
echo o;
end;
echo on;
for i=1:length(SNRindB2),10
SNR=exp(SNRindB2(i)*log(10)/10);% signal-to-noise ratio
theoerrprb(i)=Qfunct(sqrt(SNR/2));% theoretical error rate
echo o;
end;
echo on;
% Plotting commands follow.
semilogy(SNRindB1,smlderrprb,);
*
hold
semilogy(SNRindB2,theoerrprb);
function[p]=smldPe83(snrindB)
% [p]=smldPe83(snrindB)
% SMLDPE83 simulates the probability of error for a given
% snrindB, signal-to-noise ratio in dB.
E=1;
alphaopt=1/2;
SNR=exp(snrindB*log(10)/10);% signal-to-noise ratio
sgma=E/sqrt(2*SNR);% sigma, standard deviation of noise
N=10000;10
% Generation of the binary data source follows.
for i=1:N,
temp=rand;% a uniform random variable over (0,1)
if(temp<0.5),
dsource(i)=0;% With probability 1/2, source output is 0.
else
dsource(i)=1;% With probability 1/2, source output is 1.
end
end;
% detection, and probability of error calculation20
numoferr=0;
for i=1:N,
% the matched lter outputs
if(dsource(i)==0),
r=gngauss(sgma);% if the source output is 0
else
r=E+gngauss(sgma);% if the source output is 1
end;
% Detector follows.
if(r<alphaopt),30
decis=0;% Decision is 0.
else
decis=1;% Decision is 1.
334
end;
if(decis=dsource(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;
p=numoferr/N;% probability of error estimate
The results of the Monte Carlo simulation are shown in Figure 8.4. Note that at a low noise power
level (small) the eect of the noise on performance (error rate) of the communication system is
small. As the noise power level increases, the noise components increase in size and cause more
errors.
Figure 8.5 illustrates the results of the simulation for the transmissions ofN= 10000 symbols at
dierent values of the average bit SNR. Note the agreement between the simulation results and the
s!
32E
P4Qav(8.24)
25N0
echo on
SNRindB1=0:1:12;
SNRindB2=0:0.1:12;
for i=1:length(SNRindB1),
% simulated error rate
smlderrprb(i)=smldPe85(SNRindB1(i));
335
=0.1
=0.3
=0.5
Figure 8.4: Received signal points at input to the detector for orthogonal signals (Monte Carlo
simulation)
336
0
10
-1
10
-2
4
10
P
-3
10
-4
10
024681012
10 logE/N0
10avb
337
echo o;
end;10
echo on;
for i=1:length(SNRindB2),
% signal-to-noise ratio
SNRperbit=exp(SNRindB2(i)*log(10)/10);
% theoretical error rate
theoerrprb(i)=(3/2)*Qfunct(sqrt((4/5)*SNRperbit));
echo o;
end;
echo on;
% Plotting commands follow.20
semilogy(SNRindB1,smlderrprb,);
*
hold
semilogy(SNRindB2,theoerrprb);
function[p]=smldPe85(snrindB)
% [p]=smldPe85(snrindB)
% SMLDPE85 simulates the probability of error for the given
% snrindB, signal to noise ratio in dB.
d=1;
SNR=exp(snrindB*log(10)/10);% signal to noise ratio per bit
sgma=sqrt((5*d^2)/(4*SNR));% sigma, standard deviation of noise
N=10000;% number of symbols being simulated
% Generation of the quaternary data source follows.
for i=1:N,10
temp=rand;% a uniform random variable over (0,1)
if(temp<0.25),
dsource(i)=0;% With probability 1/4, source output is 00.
elseif(temp<0.5),
dsource(i)=1;% With probability 1/4, source output is 01.
elseif(temp<0.75),
dsource(i)=2;% With probability 1/4, source output is 10.
else
dsource(i)=3;% With probability 1/4, source output is 11.
end20
end;
% detection, and probability of error calculation
numoferr=0;
for i=1:N,
% the matched lter outputs
if(dsource(i)==0),
r=3*d+gngauss(sgma);% if the source output is 00
elseif(dsource(i)==1),
r=d+gngauss(sgma);% if the source output is 01
elseif(dsource(i)==2)30
r=d+gngauss(sgma);% if the source output is 10
else
r=3*d+gngauss(sgma);% if the source output is 11
end;
% Detector follows.
if(r<2*d),
338
decis=0;% Decision is 00.
elseif(r<0),
decis=1;% Decision is 01.
elseif(r<2*d),40
decis=2;% Decision is 10.
else
decis=3;% Decision is 11.
end;
if(decis=dsource(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;
p=numoferr/N;% probability of error estimate
Figure 8.6 illustrates the measured symbol error rate for 10000 transmitted symbols and the
s!
2M16logME
PMQ2avb(8.25)
MM21N0
whereM16:
function[p]=smldPe86(snrindB)
339
0
10
Simulation
Theoretical
-1
10
-2
10
-3
10
-4
10
-5
10
-6
10
-7
10
-8
10
510152025
/N0
Figure 8.6: Error rate from Monte Carlo simulation compared with the theoretical error probability
forM16 PAM
340
% [p]=smldPe86(snrindB)
% SMLDPE86 simulates the error probability for the given
% snrindB, signal-to-noise ratio in dB.
M=16;% 16-ary PAM
d=1;
SNR=exp(snrindB*log(10)/10);% signal-to-noise ratio per bit
sgma=sqrt((85*d^2)/(8*SNR));% sigma, standard deviation of noise
N=10000;% number of symbols being simulated
% generation of the data source10
for i=1:N,
temp=rand;% a uniform random variable over (0,1)
index=oor(M*temp);% The index is an integer from 0 to M-1, where
% all the possible values are equally likely.
dsource(i)=index;
end;
% detection, and probability of error calculation
numoferr=0;
for i=1:N,
% matched lter outputs20
% (2*dsource(i)-M+1)*d is the mapping to the 16-ary constellation.
r=(2*dsource(i)M+1)*d+gngauss(sgma);
% the detector
if(r>(M2)*d),
decis=15;
elseif(r>(M4)*d),
decis=14;
elseif(r>(M6)*d),
decis=13;
elseif(r>(M8)*d),30
decis=12;
elseif(r>(M10)*d),
decis=11;
elseif(r>(M12)*d),
decis=10;
elseif(r>(M14)*d),
decis=9;
elseif(r>(M16)*d),
decis=8;
elseif(r>(M18)*d),40
decis=7;
elseif(r>(M20)*d),
decis=6;
elseif(r>(M22)*d),
decis=5;
elseif(r>(M24)*d),
decis=4;
elseif(r>(M26)*d),
decis=3;
elseif(r>(M28)*d),50
decis=2;
elseif(r>(M30)*d),
decis=1;
else
decis=0;
341
end;
if(decis=dsource(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;60
p=numoferr/N;% probability of error estimate
Figure 8.7 illustrates the eight waveforms for the case in whichfc6=T. The MATLAB script for this
342
1
0
-1
00.20.40.60.81
1
0
-1
00.20.40.60.81
1
0
-1
00.20.40.60.81
1
0
-1
00.20.40.60.81
1
0
-1
00.20.40.60.81
1
0
-1
00.20.40.60.81
1
0
-1
00.20.40.60.81
1
0
-1
00.20.40.60.81
t
343
Computer Problem 8.8
For convenience we setT1. The following gure illustrates the correlator outputs over the entire
signal interval for the four possible transmitted phases. Note that the double frequency terms
average out to zero, as best observed in the case where20. Secondly, we observe the eect of
M= 4;
Es= 1;% Energy per symbol
T= 1;
Ts= 100/T;
fc= 30/T;
t= 0:T/100:T;
lt=length(t);
gT=sqrt(2/T)*ones(1,lt);10
si1=gT.*cos(2*pi*fc*t);
si2=gT.*sin(2*pi*fc*t);
for m= 0 : 3
% Generation of the transmitted signal:
smc=sqrt(Es) *cos(2*pi*m/M);
sms=sqrt(Es) *sin(2*pi*m/M);
um=smc.*si1+sms.*si2;
var= [ 0 0.05 0.5];% Noise variance vector
if(m== 2)
gure20
end
for k= 1 :length(var)
% Generation of the noise components:
nc=sqrt(var(k))*randn(1,lt);
ns=sqrt(var(k))*randn(1,lt);
% The received signal:
r=um+nc.*cos(2*pi*fc*t)ns.*sin(2*pi*fc*t);
% The correlator outputs:
yc=zeros(1,lt);
ys=zeros(1,lt);30
for i= 1:lt
yc(i) =sum(r(1:i).*si1(1:i));
ys(i) =sum(r(1:i).*si2(1:i));
end
% Plotting the results:
subplot(3,2,2*k1+mod(m,2))
plot([0 1:length(yc)1],yc,.-)
hold
plot([0 1:length(ys)1],ys)
title([\sigma^2 = ,num2str(var(k))])40
xlabel([n (m=,num2str(m),)])
axis auto
end
end
344
22
= 0, = 0 = 0, = 90
150100
80
100
60
5040
yc(n)ys(n)
20
0
0
-50-20
01020304050607080901000102030405060708090100
nn
22
= 0, = 180 = 0, = 270
5050
00
-50-50
yc(n)ys(n)
-100-100
-150-150
01020304050607080901000102030405060708090100
nn
22
= 0.05, = 0 = 0.05, = 90
150150
100100
5050
yc(n)ys(n)
00
22
= 0.05, = 180 = 0.05, = 270
-50-50
5020
01020304050607080901000102030405060708090100
nn
0
0
-20
-50-40
yc(n)ys(n)
-60
-100
-80
-150-100
01020304050607080901000102030405060708090100
nn
22
= 0.5, = 0 = 0.5, = 90
150150
100100
5050
yc(n)ys(n)
00
-50-50
01020304050607080901000102030405060708090100
nn
22
= 0.5, = 180 = 0.5, = 270
2020
00
-20-20
-40-40
yc(n)ys(n)
-60-60
-80-80
-100-100
01020304050607080901000102030405060708090100
nn
Figure 8.8: Correlator outputs in Computer Problem 8.8
345
0
10
-2
10
-3
10
-4
10
-5
10
-6
10
012345678910
E/N0in dB
b
Figure 8.9: Performance of a four-phase PSK system from the Monte Carlo simulation
Figure 8.9 illustrates the results of the Monte Carlo simulation for the transmission ofN=10000
symbols at dierent values of the SNR parameterE=N0, whereE E=2 is the bit energy. Also
bbs
shown in Figure 8.9 is the bit-error rate, which is dened asPbPM=2, and the corresponding
s!
PM2Q2Essin
N0M
s!
2Q2kEbsin(8.26)
N0M
The MATLAB scripts for this Monte Carlo simulation are given next.
346
smldbiterrprb(i)=pb;
smldsymbolerrprb(i)=ps;
echo o;
end;10
echo on;
for i=1:length(SNRindB2),
SNR=exp(SNRindB2(i)*log(10)/10);% signal-to-noise ratio
theoerrprb(i)=Qfunct(sqrt(2*SNR));% theoretical bit-error rate
echo o;
end;
echo on;
% Plotting commands follow.
semilogy(SNRindB1,smldbiterrprb,);
*
hold20
semilogy(SNRindB1,smldsymbolerrprb,o);
semilogy(SNRindB2,theoerrprb);
function[pb,ps]=cmsm32(snrindB)
% [pb,ps]=cmsm32(snrindB)
% CMSM32 nds the probability of bit error and symbol error for the
% given value of snrindB, signal-to-noise ratio in dB.
N=10000;
E=1;% energy per symbol
snr=10^(snrindB/10);% signal-to-noise ratio
sgma=sqrt(E/snr)/2;% noise variance
% the signal mapping
s00=[1 0];10
s01=[0 1];
s11=[1 0];
s10=[01];
% generation of the data source
for i=1:N,
temp=rand;% a uniform random variable between 0 and 1
if (temp<0.25),% With probability 1/4, source output is 00.
dsource1(i)=0;
dsource2(i)=0;
elseif (temp<0.5),% With probability 1/4, source output is 01.20
dsource1(i)=0;
dsource2(i)=1;
elseif (temp<0.75),% With probability 1/4, source output is 10.
dsource1(i)=1;
dsource2(i)=0;
else% With probability 1/4, source output is 11.
dsource1(i)=1;
dsource2(i)=1;
end;
end;30
% detection and the probability of error calculation
numofsymbolerror=0;
numofbiterror=0;
for i=1:N,
% The received signal at the detector, for the ith symbol, is:
347
n(1)=gngauss(sgma);
n(2)=gngauss(sgma);
if ((dsource1(i)==0) & (dsource2(i)==0)),
r=s00+n;
elseif ((dsource1(i)==0) & (dsource2(i)==1)),40
r=s01+n;
elseif ((dsource1(i)==1) & (dsource2(i)==0)),
r=s10+n;
else
r=s11+n;
end;
% The correlation metrics are computed below.
c00=dot(r,s00);
c01=dot(r,s01);
c10=dot(r,s10);50
c11=dot(r,s11);
% The decision on the ith symbol is made next.
cmax=max([c00 c01 c10 c11]);
if (c00==cmax),
decis1=0; decis2=0;
elseif (c01==cmax),
decis1=0; decis2=1;
elseif (c10==cmax),
decis1=1; decis2=0;
else60
decis1=1; decis2=1;
end;
% Increment the error counter, if the decision is not correct.
symbolerror=0;
if (decis1=dsource1(i)),
numofbiterror=numofbiterror+1;
symbolerror=1;
end;
if (decis2=dsource2(i)),
numofbiterror=numofbiterror+1;70
symbolerror=1;
end;
if (symbolerror==1),
numofsymbolerror = numofsymbolerror+1;
end;
end;
ps=numofsymbolerror/N;% since there are totally N symbols
pb=numofbiterror/(2*N);% since 2N bits are transmitted
Figure 8.10 illustrates the results of the Monte Carlo simulation for the transmission ofN=10000
symbols at dierent values of the SNR parameterE=N0, whereE E=2 is the bit energy. Also
bbs
shown in Figure 8.10 is the theoretical value of the symbol error rate based on the approximation
that the termnnis negligible. We observe from Figure 8.10 that the approximation results in an
kk1
upper bound to the error probability.
348
0
10
-1
10
-2
10
-3
10
-4
10
-5
10
024681012
E/N0in dB
b
Figure 8.10: Performance of four-phase DPSK system from Monte Carlo simulation (the solid curve is
349
The MATLAB scripts for this Monte Carlo simulation are given next.
function[p]=cmsm34(snrindB)
% [p]=cmsm34(snrindB)
% CMSM34 nds the probability of error for the given
% value of snrindB, signal-to-noise ratio in dB.
N=10000;
E=1;% energy per symbol
snr=10^(snrindB/10);% signal-to-noise ratio
sgma=sqrt(E/(4*snr));% noise variance
% Generation of the data source follows.
for i=1:2*N,10
temp=rand;% a uniform random variable between 0 and 1
if(temp<0.5),
dsource(i)=0;% With probability 1/2, source output is 0.
else.
dsource(i)=1;% With probability 1/2, source output is 1.
end;
end;
% Dierential encoding of the data source follows.
mapping=[0 1 3 2];
M=4;20
[diencoutput] =cmdpske(E,M,mapping,dsource);
% Received signal is then
for i=1:N,
[n(1)n(2)]=gngauss(sgma);
r(i,:)=diencoutput(i,:)+n;
end;
% detection and the probability of error calculation
numoferr=0;
prevtheta=0;
for i=1:N,30
350
theta=angle(r(i,1)+j*r(i,2));
deltatheta=mod(thetaprevtheta,2*pi);
if((deltatheta<pi/4)j(deltatheta>7*pi/4)),
decis=[0 0];
elseif(deltatheta<3*pi/4),
decis=[0 1];
elseif(deltatheta<5*pi/4)
decis=[1 1];
else
decis=[1 0];40
end;
prevtheta=theta;
% Increase the error counter, if the decision is not correct.
if((decis(1)=dsource(2*i1))j(decis(2)=dsource(2*i))),
numoferr=numoferr+1;
end;
end;
p=numoferr/N;
function[enccomp] =cmdpske(E,M,mapping,sequence);
% [enccomp] = cmdpske(E,M,mapping,sequence)
% CMDPSKE dierentially encodes a sequence.
% E is the average energy, M is the number of constellation points,
% and mapping is the vector dening how the constellation points are
% allocated. Finally, sequence is the uncoded binary data sequence.
k=log2(M);
N=length(sequence);
% If N is not divisible by k, append zeros, so that it is. . .
remainder=rem(N,k);10
if(remainder=0),
for i=N+1:N+kremainder,
sequence(i)=0;
end;
N=N+kremainder;
end;
theta=0;% Initially, assume that theta=0.
for i=1:k:N,
index=0;
for j=i:i+k1,20
index=2*index+sequence(j);
end;
index=index+1;
theta=mod(2*pi*mapping(index)/M+theta,2*pi);
enccomp((i+k1)/k,1)=sqrt(E)*cos(theta);
enccomp((i+k1)/k,2)=sqrt(E)*sin(theta);
end;
351
Computer Problem 8.11
pp
The position of the eight signal points are1;1,1;1,1;1,1;1,13;0,1;3;0,
pp
0;13, and0;13. For convenience, we setT1. Figure 8.11 illustrates the correlator
outputs over the signal interval when the transmitted symbol is1;1. Note that the double
frequency terms average out to zero, as best observed in the case where20. Furthermore, we
observe the eect of the additive noise on the correlator output as2increases.
M= 8;
Es= 1;% Energy oer symbol
T= 1;
Ts= 100/T;
fc= 30/T;
t= 0:T/100:T;
lt=length(t);
Amc= 1/sqrt(Es);% Signal Amplitude10
Ams=1/sqrt(Es);% Signal Amplitude
gT=sqrt(2/T)*ones(1,lt);
phi= 2*pi*rand;
si1=gT.*cos(2*pi*fc*t+phi);
si2=gT.*sin(2*pi*fc*t+phi);
var= [ 0 0.05 0.5];% Noise variance vector
for k= 1 :length(var)
% Generation of the noise components:
nc=sqrt(var(k))*randn(1,lt);
ns=sqrt(var(k))*randn(1,lt);20
noise=nc.*cos(2*pi*fc+t)ns.*sin(2*pi*fc+t);
% The received signal
r=Amc*gT.*cos(2*pi*fc*t+phi) +Ams*gT.*sin(2*pi*fc*t+phi) +noise;
% The correlator outputs:
yc=zeros(1,lt);
ys=zeros(1,lt);
for i= 1:lt
yc(i) =sum(r(1:i).*si1(1:i));
ys(i) =sum(r(1:i).*si2(1:i));
end30
% Plotting the results:
subplot(3,1,k)
plot([0 1:length(yc)1],yc,.-)
hold
plot([0 1:length(ys)1],ys)
title([\sigma^2 = ,num2str(var(k))])
xlabel(n)
axis auto
end
352
2
= 0
100
-100
020406080100
n
2
= 0.05
100
-100
020406080100
n
2
= 0.5
100
0
-100
020406080100
n
Figure 8.11: Correlator outputs in Computer Problem 8.11.
353
0
10
-1
10
-2
10
-3
10
-4
10
-5
10
-6
10
-7
10
051015
E/N0in dB
b
Figure 8.12: Performance ofM16-QAM system from the Monte Carlo simulation.
Figure 8.12 illustrates the results of the Monte Carlo simulation for the transmission ofN=10000
symbols at dierent values of the SNR parameterE=N0, whereE E=4 is the bit energy. Also
bbs
shown in Figure 8.12 is the theoretical value of the symbol-error probability given by (8.27) and
(8.28).
s!
Pp211pQ3Eav(8.27)
M
MM1N0
whereE=N0is the average SNR per symbol. Therefore, the probability of a symbol error for the
av
M-ary QAM is
2
PM11Pp(8.28)
M
354
end;10
echo on;
for i=1:length(SNRindB2),
SNR=exp(SNRindB2(i)*log(10)/10);% signal-to-noise ratio
% theoretical symbol error rate
theoerrprb(i)=4*Qfunct(sqrt(3*k*SNR/(M1)));
echo o;
end;
echo on;
% Plotting commands follow.
semilogy(SNRindB1,smlderrprb,);20
*
hold
semilogy(SNRindB2,theoerrprb);
function[p]=cmsm41(snrindB)
% [p]=cmsm41(snrindB)
% CMSM41 nds the probability of error for the given
% value of snrindB, SNR in dB.
N=10000;
d=1;% min. distance between symbols
Eav=10*d^2;% energy per symbol
snr=10^(snrindB/10);% SNR per bit (given)
sgma=sqrt(Eav/(8*snr));% noise variance
M=16;10
% Generation of the data source follows.
for i=1:N,
temp=rand;% a uniform R.V. between 0 and 1
dsource(i)=1+oor(M*temp);% a number between 1 and 16, uniform
end;
% Mapping to the signal constellation follows.
mapping=[3*d3*d;
d3*d;
d3*d;
3*d3*d;20
3*d d;
d d;
d d;
3*d d;
3*dd;
dd;
dd;
3*dd;
3*d3*d;
d3*d;30
d3*d;
3*d3*d];
for i=1:N,
qamsig(i,:)=mapping(dsource(i),:);
end;
% received signal
for i=1:N,
[n(1)n(2)]=gngauss(sgma);
355
r(i,:)=qamsig(i,:)+n;
end;40
% detection and error probability calculation
numoferr=0;
for i=1:N,
% Metric computation follows.
for j=1:M,
metrics(j)=(r(i,1)mapping(j,1))^2+(r(i,2)mapping(j,2))^2;
end;
[minmetric decis] =min(metrics);
if(decis=dsource(i)),
numoferr=numoferr+1;50
end;
end;
p=numoferr/(N);
Figure 8.13 illustrates the correlator outputs for dierent noise variances. The MATLAB script for
% Initialization:
K=20;% Number of samples
A=1;% Signal amplitude
l=0:K;
s0=A*ones(1,K);% Signal waveform
r0=zeros(1,K);% Output signal
% Case 1: noiseN(0,0)10
noise=random(Normal,0,0,1,K);
% Sub-case s = s0:
s=s0;
r=s+noise;% received signal
for n=1:K
r0(n)=sum(r(1:n).*s0(1:n));
end
% Plotting the results:
subplot(3,2,1)
plot(l,[0r0])20
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})
axis([0 20 0 25])
xlabel((a) \sigma^2= 0 & S_{0} is transmitted ,fontsize,10)
% text(15,3,nfontsize{10} r{0}: - & r{1}: ,hor,left)
% Sub-case s = s1:
s=s0;
r=s+noise;% received signal
for n=1:K
r0(n)=sum(r(1:n).*s0(1:n));
356
250
20!5
15!10
10!15
5!20
0!25
05Tb10Tb15Tb20Tb05Tb10Tb15Tb20Tb
(a) 2= 0 & S is transmitted (b) 2= 0 & S is transmitted
01
250
20!5
15!10
10!15
5!20
0!25
05Tb10Tb15Tb20Tb05Tb10Tb15Tb20Tb
(c) 2= 0.1 & S is transmitted (d) 2= 0.1 & S is transmitted
01
200
10!10
0!20
05Tb10Tb15Tb20Tb05Tb10Tb15Tb20Tb
22
(e) = 1 & S is transmitted (f) = 1 & S is transmitted
01
357
end30
% Plotting the results:
subplot(3,2,2)
plot(l,[0r0])
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})
axis([0 2025 0])
xlabel((b) \sigma^2= 0 & S_{1} is transmitted ,fontsize,10)
% Case 2: noiseN(0,0.1)
noise=random(Normal,0,0.1,1,K);
% Sub-case s = s0:
s=s0;40
r=s+noise;% received signal
for n=1:K
r0(n)=sum(r(1:n).*s0(1:n));
end
% Plotting the results:
subplot(3,2,3)
plot(l,[0r0])
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})
axis([0 20 0 25])
xlabel((c) \sigma^2= 0.1 & S_{0} is transmitted ,fontsize,10)50
% Sub-case s = s1:
s=s0;
r=s+noise;% received signal
for n=1:K
r0(n)=sum(r(1:n).*s0(1:n));
end
% Plotting the results:
subplot(3,2,4)
plot(l,[0r0])
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})60
axis([0 2025 0])
xlabel((d) \sigma^2= 0.1 & S_{1} is transmitted ,fontsize,10)
% Case 3: noiseN(0,1)
noise=random(Normal,0,1,1,K);
% Sub-case s = s0:
s=s0;
r=s+noise;% received signal
for n=1:K
r0(n)=sum(r(1:n).*s0(1:n));
end70
% Plotting the results:
subplot(3,2,5)
plot(l,[0r0])
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})
axis([0 205 25])
xlabel((e) \sigma^2= 1 & S_{0} is transmitted ,fontsize,10)
% Sub-case s = s1:
s=s0;
r=s+noise;% received signal
for n=1:K80
r0(n)=sum(r(1:n).*s0(1:n));
end
% Plotting the results:
358
subplot(3,2,6)
plot(l,[0r0])
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})
axis([0 2025 5])
xlabel((f) \sigma^2= 1 & S_{1} is transmitted ,fontsize,10)
Figure 8.14 illustrates the correlator outputs for dierent noise variances whens1tis sent. The
T=20;
s1=zeros(1,T);
s1(1:T/2)=1;
n1=sqrt(0.1)randn(1,20);
*
n2=sqrt(0.5)randn(1,20);
*
n3=randn(1,20);
r1=s1+n1;
r2=s1+n2;
r3=s1+n3;
for k=1:20
y11(k)=0;y12(k)=0;y13(k)=0;
y21(k)=0;y22(k)=0;y23(k)=0;
for n=1:k
y11(k)=y11(n)+0.05r1(n)s1(n);
**
y12(k)=y12(n)+0.05r2(n)s1(n);
**
y13(k)=y13(n)+0.05r3(n)s1(n);
**
y21(k)=y21(n)+0.05r1(n)s2(n);
**
y22(k)=y22(n)+0.05r2(n)s2(n);
**
y23(k)=y23(n)+0.05r3(n)s2(n);
**
end
end
subplot(3,2,1), stem(y11)
subplot(3,2,2), stem(y21)
subplot(3,2,3), stem(y12)
subplot(3,2,4), stem(y22)
subplot(3,2,5), stem(y13)
subplot(3,2,6), stem(y23)
A similar script gives the outputs whens2tis transmitted. The resulting plots are shown in
Figure 8.15.
359
1.50.15
0.1
1
0.05
0.5
0
0-0.05
0510152005101520
1.50
-0.1
1
-0.2
0.5
-0.3
0-0.4
0510152005101520
1.50
-0.1
1
-0.2
0.5
-0.3
0-0.4
0510152005101520
Figure 8.14: Correlator outputs in Computer Problem8.14 whens1tis transmitted. Left column
is the result of correlation withs1tand right column is the output of correlator withs2t. Rows
one to three correspond to20:1;0:5;1, respectively. Note that vertical scales in left and right
0.15
0.10.5
0.05
00
0510152005101520
0.151
0.1
0.5
0.05
0
0
-0.05-0.5
0510152005101520
0.80.8
0.60.6
0.40.4
0.20.2
00
0510152005101520
Figure 8.15: Correlator outputs in Computer Problem8.14 whens2tis transmitted. Left column
is the result of correlation withs1tand right column is the output of correlator withs2t. Rows
one to three correspond to20:1;0:5;1, respectively. Note that vertical scales in left and right
361
1
0.6
0.4
0.2
-3
x 10
-1 -0.8 -0.6 -0.4 -0.2 0.2 0.4 0.6 0.8 1
-0.2
From Figure 8.16 it is clear that, for all practical purposes, it is sucient to consider only the
intervaljtj 0:6103, which is roughly3T ;3T. Truncating the raised-cosine pulse to this
interval and computing the autocorrelation function result in the waveform shown in Figure 8.17.
In the MATLAB script given next, the raised-cosine signal and the autocorrelation function are
rst computed and plotted. In this particular example the length of the autocorrelation function is
1201 and the maximum (i.e., the optimum sampling time) occurs at the 600thcomponent. Two cases
are examined: one when the incorrect sampling time is 700 and one when it is 500. In both cases the
362
-3
x 10
-1 -0.5 0.5 1
363
Chapter 9
Problem 9.1
1)The rst set represents a 4-PAM signal constellation. The points of the constellation arefA;3Ag.
The second set consists of four orthogonal signals. The geometric representation of the signals is
s20A0 0s40 0 0A
This set can be classied as a 4-FSK signal. The third set can be classied as a 4-QAM signal
s1ApAps3ApAp
2222
s2ApAps4ApAp
2222
4
X1
E1ksik2A29A29A2A25A2
av;I
44
i1
4
X1
E1ksik24A2A2
av;II
44
i1
4
X122
E1ksik24AAA2
av;III
4422
i1
4)When coherent detection is employed, then an upper bound on the probability of error is given by
2s3
s#
"
A2
PM1QEs3Q4
4;II;coherent5
N0N0
3s2s13s
234
2ee4e
222
3A2A13A
2N3N4N
000
2ee4e
364
5)It is not possible to use noncoherent detection for the signal set III. This is because all signals have
6)The following table shows the bit rate to bandwidth ratio for the dierent types of signaling and
TypeR=WM4
PAM2 logM4
2
QAMlogM2
2
M
FSK (coherent)2 log21
M
M
FSK (noncoherent)log20.5
M
To achieve a ratioRof at least 2, we have to select either the rst signal set (PAM) or the second
W
signal set (QAM).
Problem 9.2
smsn
mn
jsmjjsnj
q
wheresmsm1; sm2; : : : ; smNandsmEs. Two adjacent signal points dier in only one
j
N
coordinate, for whichsmandsnkhave opposite signs. Hence,
k
N
XX
smsnsmsnjsmsnjsmsnk
jjk
j1jk
EN2
N1EssE
NNNs
1
Furthermore,jsmj jsnj E2so that
s
N2
mn
N
The Euclidean distance between the two adjacent signal points is
r
qp2sEsE
djsmsnj22E=N4s2s
s
NN
Problem 9.3
365
The energy of the signal waveforms0tis
m
Z1Z12
M
X
E0s0t2dtsmt1sktdt
1m1M
k1
Z1Z1
MM
XX
s2tdt1sktsltdt
1mM21
k1l1
Z1Z1
1MX1MX
smtsktdtsmtsltdt
M1M1
k1l1
MM
XX2
E 1EE
M2klM
k1l1
E 1E 2E M1E
MMM
R1
s0ts0tdt
mn1mn
hRi1
1
hR1i2
12
1js0mtj2dt1js0ntj2dt
0101
1MX1MX
1Z@1
@sAdt
smtsktAntslt
E01MM
k1l1
0ZZ1
M
1
111MXA
@sXs
tsntdtktsltdt
E01mM21
k1l1
0ZZ1
1MX1
11MX1
@sA
tsktdtsmtsltdt
E0M1nM1
k1l1
111
M2MEMEME 1
M1
MEM1
Problem 9.4
pp
s1E;0;0;0s5E;0;0;0
ss
pp
s20;E;0;0s60;E;0;0
ss
pp
s30;0;E;0s70;0;E;0
ss
pp
s40;0;0;Es80;0;0;E
ss
q
di;k jsiskj2E
s
366
p
and one vector (si) at a distancedi;m2E. Hence, the union bound on the probability of error
s
P ejsiis given by
s#"s#
"
M"d#
Xi;k
PUBejsiQp6QEsQ2Es
k1;ki2N0N0N0
PUBe6QEsQ2Es
N0N0
WithM823,E3Eand therefore,
sb
s#"s#
"
PUBe6Q3EbQ6Eb
N0N0
Problem 9.5
It is convenient to nd rst the probability of a correct decision. Since all signals are equiprobable
M
X1
P CP Cjsi
i1M
All theP Cjsi,i1; : : : ; Mare identical because of the symmetry of the constellation. By translating
the vectorsito the origin we can nd the probability of a correct decision, given thatsiwas
transmitted, as
Z1Z1Z1
P Cjsif n1dn1f n2dn2: : :f nNdnN
ddd
222
where the number of the integrals on the right side of the equation isN,dis the minimum distance
Hence,
Z1!N0Zd1N
2
P Cjsif ndn@1f ndnA
d
21
"#!N
1Qdp
2N0
N
M
X1"d#!
P e1P C11Qp
i1M2N0
"#!N
11Qdp
2N0
367
Note that since
NN
XXd2
Es22Nd
s
m;i
i1i124
s#!N
"
P e11Q2Es
NN0
Problem 9.6
n
X
gtyTtynTctcknTckTct
k1
nn
XX
cni1Tctcnti1Tc
i1i1
i1i1
that is, a sequence of impulses starting att0 and weighted by the mirror image sequence offcig.
Since,
nn
XX
stckptkTcpt ?cktkTc
k1k1
n
X
Sf P fckej2 f kTc
k1
Thus, the matched lterHf can be considered as the cascade of a lter,with impulse response
pt, matched to the pulseptand a lter, with impulse responsegt, matched to the signal
368
Pn
ytcktkTc. The output of the matched lter attnTcis
k1
Z1Z1
n
X
jstj2c2p2tkTcdt
1k1
k1
n
X
Tcc2
k
k1
where we have used the fact thatptis a rectangular pulse of unit amplitude and durationTc.
Problem 9.7
Z1Z1
nn
XX
sitsjtdtcikptkTccjptlTcdt
l
11
k1l1
nnZ1
XX
cikcjptkTcptlTcdt
l
k1l11
nn
XX
cikcjE
lpkl
k1l1
n
X
Ecikcj
pk
k1
Pn
The quantitycikcjis the inner product of the row vectorsCandC. Since the rows of the
k1kij
matrixHnare orthogonal by construction, we obtain
Z1
n
X
sitsjtdt Ec2nE
pijpij
1ik
k1
n
X
sitcikptkTc
k1
can be realized as the cascade of a lter matched toptfollowed by a discrete-time lter matched
to the vectorCci; : : : ; cin. Since the pulseptis common to all the signal waveformssit,
i1
we conclude that thenmatched lters can be realized by a lter matched toptfollowed byn
369
Problem 9.8
nq
X
Dr; CrkECik2
ib
k1
wqnq
XX
Dr; CrkE2rkE2
1bb
k1kw1
and
wqnq
XX
Dr; CrkE2rkE2
2bb
k1kw1
Since the rst term of the right side is common for the two equations, we conclude that the optimal
ML detector can base its decisions only on the lastnwreceived elements ofr. That is
C
2
nqnq
XX>
rkE2rkE20
bb
<
kw1kw1
C
1
or equivalently
C
1
n
X>
rk0
<
kw1
C
2
p
2)SincerkECiknk, the probability of errorP ejCis
b1
01
n
qX
P ejCP@Enwnk<0A
1b
kw1
01
nq
X
P@nk<nwEA
b
kw1
Pn
The random variableunkis zero-mean Gaussian with variance2nw2. Hence
kw1u
p2s
ZE3
bnw2
Enw
b
P ejC1p2expxdxQ425
1
2 nw12 nw2
370
Similarly we nd thatP ejCP ejCand since the two sequences are equiprobable
21
2s3
Enw
b
P eQ425
nw
3)The probability of errorP eis minimized whenEbis maximized, that is forw0. This
2
implies thatC Cand thus the distance between the two sequences is the maximum possible.
12
Problem 9.9
u1t2Ebcos2 fct
T
s
u2t2Ebcos2 fct2f t
T
T
1Z
12u1tu2tdt
E0
b
T
1Z2E
b
tcos2 fct2f tdt
E0Tcos2 fc
b
TZT
1Z1
cos2f tdtcos22fct2f tdt
T0T0
Iffc1, then
T
T
1Zsin2f T
12cos2f tdt
T0 2f T
To nd the minimum value of the correlation, we set the derivative of 12with respect tofequal
to zero. Thus,
# 12cos2f T 2 Tsin2f T
2T
#f02f T 2f T 2
and therefore,
2f Ttan2f T
2f T4:4934=)f0:7151
T
and the value of 12is0:2172. Note that when a gradient method like the Gauss-Newton is used to
solve the equationf xxtanx0, then in order to nd the smallest nonzero root, the initial
371
The probability of error can be expressed in terms of the distanced12between the signal points,
as2v3
uu2
d7
t12
pbQ645
2N0
ku1k2 ku2k2 E
b
cos12 12
Hence,
d2 ku1k2 ku2k22ku1kku2kcos122E1 12
12s
and therefore,
s#"s#
"
1 12E10:2172
pbQ2EsQs
2N0N0
Problem 9.10
u0t2Escos2 fct;0tT
T
r t2Escos2 fctnt
T
In the phase-coherent demodulation ofM-ary FSK signals, the received signal is correlated with each
ZT
rmr tcos2 fct2 mf tmdt
0
ZTs
2E
s
t2 mf tmcos2 mf tmn
T02cos22fc
sZ
2E1T
s
cos2 mf tmdtn
T20
372
2)In order to obtain orthogonal signals at the demodulator, the expected value ofrm,Erm, should
ZT
cos2 mf tmdt0;8m60
0
The equality is true whenmfis a multiple of1. Since the smallest value ofmis 1, the necessary
T
condition for orthogonality is
f1
T
Problem 9.11
The noise components in the sampled output of the two correlators for themthFSK signal, are given
by
ZTs
nmcnt2cos2 fct2 mf tdt
0T
ZTs
nmsnt2sin2 fct2 mf tdt
0T
2Zs3
T
EnmcE4nt2cos2 fct2 mf tdt5
0T
ZTs
Ent2cos2 fct2 mf tdt0
0T
2Zs3
T
EnmsE4nt2sin2 fct2 mf tdt5
0T
ZTs
Ent2sin2 fct2 mf tdt0
0T
Furthermore,
"ZT#
ZT
EnmcnkcE2ntncos2 fct2 mf tcos2 fct2 kf dtd
00T
TZT
2Z
T20
ZT
2N01
t2 mkf tcos2 mkf tdt
T202cos22fc
ZT
2N01N0
dtm
T202mk2k
373
where we have used the fact that forfc1
T
ZT
cos22fct2 mkf tdt0
0
and forf1
T
ZT
cos2 mkf tdt0; m6k
0
Thus,nmc,nkcare uncorrelated formkand since they are zero-mean Gaussian they are
T00
ZT
2N0
cos2 fct2 mf tsin2 fct2 kf tdt
T20
ZT
2N01
t2 mkf tsin2 mkf tdt
T202sin22fc
0
N0
Enmsnks
2mk
Problem 9.12
1)The noncoherent envelope detector for the on-o keying signal is depicted in the next gure.
t=T
2Rt
()()d
0
rc
q2r (t)
cos(2 fct)
rT
+
V
T
2
t=TThresholdRt
2Device
()()d
0
rs
2)Ifs0tis sent, then the received signal isr tntand therefore the sampled outputsrc,rs
are zero-mean independent Gaussian random variables with varianceN0. Hence, the random variable
2
q
rr2cr2sis Rayleigh distributed and the PDF is given by
r2r2
2r
prjs0tre22eN0
2
N0
r t2Ebcos2 fctnt
Tb
374
q
Crosscorrelatingr tby2cos2 fctand sampling the output attT, results in
T
ZTs
rcr t2cos2 fctdt
0T
ZTpZTs
2E2
b
cos2 fctcos2 fctdtntcos2 fctdt
0Tb0T
pZT
2E1
b
tcosdtnc
Tb02cos22fc
q
Ecosnc
wherencis zero-mean Gaussian random variable with varianceN0. Similarly, for the quadrature
2
component we have
q
rsEsinns
b
qq
The PDF of the random variablerr2cr2sEn2cn2sis (see Problem 4.31)
b
p!r p!
r2E2E
bb
rE2r2rE
prjs1tre22I0beN0I0b
22
N0N0
Sincer >0 the expression for the probability of error takes the form
ZVZ1
T
P error1prjs1tdr1prjs0tdr
202V
T
p!Z1
VTr2E2
1ZrbrE1rr
e22I0bdre22dr
20222V2
T
The optimum threshold level is the value ofVTthat minimizes the probability of error. However,
p
whenEb1 the optimum value is close toEband we will use this threshold to simplify the
N02
analysis. The integral involving the Bessel function cannot be evaluated in closed form. Instead of
which is valid for largex, that is for high SNR. In this case
p
p!ZEs
VTr2Ebp
1ZrbrE12r22
e22I0bdrperEb=2dr
2022202 2E
b
This integral is further simplied if we observe that for high SNR, the integrand is dominant in the
p
vicinity ofEand therefore, the lower limit can be substituted by1. Also
b
s
s
r1
p2
2 2E2
b
375
and therefore,
pp
spEsp
E
Zb
b
22
1Zr221122
perEb=2drerEb=2dr
202 2E212 2
b
s#
"
1E
b
2Q2N0
Finally
s#Z2
"1
12rr
P error1QEbpeN0dr
22N02EbN0
2
s#
"E
1E1b
b
4N
0
2Q2N02e
Problem 9.13
If we use a pulse shape having a raised cosine spectrum with a rollo, the symbol rate is determined
22105
T1bps
In this case we select the two frequencies to have a frequency separation of1, where1is the symbol
TT
rate. Hence
1
f1fc
2T
f2fc1
2T
wherefcis the carrier in the center of the channel band. Thus, we have
1
2T50000
or equivalently
1
5
T10
In this case we require four frequencies with adjacent frequencies separation of1. Hence, we select
T
111:5
f1fc j1:5; f2fc; f3fc; f4fc
T2T2TT
376
wherefcis the carrier frequency and125000, or, equivalently,
2T
1
T50000
Since the symbol rate is 50000 symbols per second and each symbol conveys 2 bits, the bit rate is
105bps.
Problem 9.14
We assume that the input bits 0, 1 are mapped to the symbols -1 and 1 respectively. The terminal
k
X
n;aak0
2
k0
where0is the initial phase andakis1 depending on the input bit at the time instantk. The
following table showsn;afor two dierent values of0(0; ), and the four input pairs of data:
f00;01;10;11g.
0b0b1a0a1n;a
00 0-1 -1
00 1-1 10
01 01 -10
01 11 1
0 0-1 -10
0 1-1 1
1 01 -1
1 11 12
Problem 9.15
q
jstjjsctj2 jsstj2
s
2E t2E t
bb2
cos2sin
Tb2TbTb2Tb
s
2E
b
Tb
377
2)The signalsthas the form of the four-phase PSK signal with
gTtcos t;0t2Tb
2Tb
Hence, it is an MSK signal. A block diagram of the modulator for synthesizing the signal is given in
a2n
s(t)eeDSerial /Serial
t
+cos(2 fct)cos(2T)Parallel
bemuxdataan
22
a2n+
1
t=2Tb
R2Tb
()dtThreshold
0
ec ter (t)Parallel to
)cos(2 fct))
os(2TbSerial
t=2Tb22
R2Tb
()dtThreshold
0
Problem 9.16
Ns2pM8
phase states, which we denote asSnn; an1. The 2p4 phase states corresponding tonare
s0;; ;
22
Having at our disposal the staten; an1and the transmitted symbolan, we can nd the new
phase state as
an
n; an1-!nan1; ann1; an
2
378
The following gure shows one frame of the phase-trellis of the partial response CPM signal.
.(0,1)(0,1)
.
.
.
.
.
.........(0,1)(0,1)
..........
..........(,1)(,1)
22
.............
...........
,1)(,1)
............(22
.........
..
..........( ,1)( ,1)
.
..........
...
............( ,1)( ,1)
........
..........33
........(2,1)(2,1)
........
.......(3,1)(3,1)
22
The following is a sketch of the state diagram of the partial response CPM signal.
( ,1)
13
,1)(,1)
1(22
1
1
1 -11
-1
1(0,1)(0,1)
-1
-1
11-1
-
1
-(3,1)
(,1)2
2
( ,1)
Problem 9.17
1)For a full response CPFSK signal,Lis equal to 1. Ifh2, then sincemis even, there arep
3
terminal phase states. Ifh3, the number of states isNs2p.
4
2)WithL3 andh2, the number of states isNsp2212. WhenL3 andh3, the number
34
of states isNs2p2232.
379
0
10
Simulation
Theoretical
-1
10
-2
10
-3
b
10
P
-4
10
-5
10
-6
10
0246810
10 logE/N0
10b
Figure 9.1: Bit-error probability forM4 orthogonal signals from a Monte Carlo simulation compared
Computer Problems
Figure 9.1 illustrates the results of the simulation for the transmission of 20000 bits at several
dierent values of the SNRE=N0. Note the agreement between the simulation results and the
b
theoretical value ofPbgiven by
2k1
PbPM(9.29)
2k1
380
% simulated error rate
smlderrprb(i)=smldP87(SNRindB(i));10
echoo;
end;
for i=1:length(SNRindB),
snr=10^(SNRindB(i)/10);
% theoretical error rate
theoerrprb(i)=(2/3)*quad8(bdt_int,minusinf,plusinf,tolerance,[ ],snr,4);
echoo;
end;
echoon;20
% Plotting commands follow
semilogy(SNRindB,smlderrprb,);
*
hold
semilogy(SNRindB,theoerrprb);
legend(Simulation,Theoretical);
function[p]=smldP87(snrindB)
% [p]=smldP87(snrindB)
% SMLDP87 simulates the probability of error for the given
% snrindB, signal-to-noise ratio in dB.
M=4;% quaternary orthogonal signaling
E=1;
SNR=exp(snrindB*log(10)/10);% signal-to-noise ratio per bit
sgma=sqrt(E^2/(4*SNR));% sigma, standard deviation of noise
N=10000;% number of symbols being simulated
% generation of the quaternary data source10
for i=1:N,
temp=rand;% a uniform random variable over (0,1)
if(temp<0.25),
dsource1(i)=0;
dsource2(i)=0;
elseif(temp<0.5),
dsource1(i)=0;
dsource2(i)=1;
elseif(temp<0.75),
dsource1(i)=1;20
dsource2(i)=0;
else
dsource1(i)=1;
dsource2(i)=1;
end
end;
% detection, and probability of error calculation
numoferr=0;
for i=1:N,
% matched lter outputs30
if((dsource1(i)==0) & (dsource2(i)==0)),
r0=sqrt(E)+gngauss(sgma);
r1=gngauss(sgma);
r2=gngauss(sgma);
381
r3=gngauss(sgma);
elseif((dsource1(i)==0) & (dsource2(i)==1)),
r0=gngauss(sgma);
r1=sqrt(E)+gngauss(sgma);
r2=gngauss(sgma);
r3=gngauss(sgma);40
elseif((dsource1(i)==1) & (dsource2(i)==0)),
r0=gngauss(sgma);
r1=gngauss(sgma);
r2=sqrt(E)+gngauss(sgma);
r3=gngauss(sgma);
else
r0=gngauss(sgma);
r1=gngauss(sgma);
r2=gngauss(sgma);
r3=sqrt(E)+gngauss(sgma);50
end;
% the detector
maxr=max([r0 r1 r2 r3]);
if(r0==maxr),
decis1=0;
decis2=0;
elseif(r1==maxr),
decis1=0;
decis2=1;
elseif(r2==maxr),60
decis1=1;
decis2=0;
else
decis1=1;
decis2=1;
end;
% Count the number of bit errors made in this decision.
if(decis1=dsource1(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;70
if(decis2=dsource2(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;
p=numoferr/(2*N);% bit error probability estimate
Figure 9.2 illustrates the results of the simulation for the transmission of 20000 bits at several
dierent values of the SNRE=N0. Note the agreement between the simulation results and the
b
theoretical value ofPbgiven by
382
0
10
Simulation
Theoretical
-1
10
-2
10
-3
10
-4
b
10
P
-5
10
-6
10
-7
10
-8
10
0246810
10 logE/N0
10b
Figure 9.2: Bit-error probability forM8 orthogonal signals from a Monte Carlo simulation compared
383
clear all;
tolerance=1e15;% Tolerance used for the integration
minusinf=60;% This is practically -innity
plusinf=60;% This is practically innity
SNRindB=0:1:10;
for i=1:length(SNRindB),
% simulated error rate
smlderrprb(i)=smldP88(SNRindB(i));
end;10
for i=1:length(SNRindB),
snr=10^(SNRindB(i)/10);
% theoretical error rate
theoerrprb(i)=(4/7)*quad8(bdt_int,minusinf,plusinf,tolerance,[ ],snr,8);
end;
%Plotting commands follow
semilogy(SNRindB,smlderrprb,);
*
holdon;
semilogy(SNRindB,theoerrprb);
legend(Simulation,Theoretical);20
holdon;
function[p]=smldP87(snrindB)
% [p]=smldP87(snrindB)
% SMLDP87 simulates the probability of error for the given
% snrindB, signal-to-noise ratio in dB.
M=8;% quaternary orthogonal signaling
E=1;
numoferr= 0;
SNR=exp(snrindB*log(10)/10);% signal-to-noise ratio per bit
sgma=sqrt(E^2/(6*SNR));% sigma, standard deviation of noise
N=10000;% number of symbols being simulated10
% generation of the quaternary data source
for i=1:N,
temp=rand;% a uniform random variable over (0,1)
if(temp<1/8),
dsource1(i)=0;
dsource2(i)=0;
dsource3(i)=0;
elseif(temp<2/8),
dsource1(i)=0;
dsource2(i)=0;20
dsource3(i)=1;
elseif(temp<3/8),
dsource1(i)=0;
dsource2(i)=1;
dsource3(i)=0;
elseif(temp<4/8),
dsource1(i)=0;
dsource2(i)=1;
dsource3(i)=1;
elseif(temp<5/8),30
dsource1(i)=1;
384
dsource2(i)=0;
dsource3(i)=0;
elseif(temp<6/8),
dsource1(i)=1;
dsource2(i)=0;
dsource3(i)=1;
elseif(temp<7/8),
dsource1(i)=1;
dsource2(i)=1;40
dsource3(i)=0;
else
dsource1(i)=1;
dsource2(i)=1;
dsource3(i)=1;
end
end;
% detection, and probability of error calculation
numoferr=0;
for i=1:N,50
% matched lter outputs
if((dsource1(i)==0) & (dsource2(i)==0) & (dsource3(i)==0)),
r0=sqrt(E)+gngauss(sgma);
r1=gngauss(sgma);
r2=gngauss(sgma);
r3=gngauss(sgma);
r4=gngauss(sgma);
r5=gngauss(sgma);
r6=gngauss(sgma);
r7=gngauss(sgma);60
elseif((dsource1(i)==0) & (dsource2(i)==0) & (dsource3(i)==1)),
r0=gngauss(sgma);
r1=sqrt(E)+gngauss(sgma);
r2=gngauss(sgma);
r3=gngauss(sgma);
r4=gngauss(sgma);
r5=gngauss(sgma);
r6=gngauss(sgma);
r7=gngauss(sgma);
elseif((dsource1(i)==0) & (dsource2(i)==1) & (dsource3(i)==0)),70
r0=gngauss(sgma);
r1=gngauss(sgma);
r2=sqrt(E)+gngauss(sgma);
r3=gngauss(sgma);
r4=gngauss(sgma);
r5=gngauss(sgma);
r6=gngauss(sgma);
r7=gngauss(sgma);
elseif((dsource1(i)==0) & (dsource2(i)==1) & (dsource3(i)==1)),
r0=gngauss(sgma);80
r1=gngauss(sgma);
r2=gngauss(sgma);
r3=sqrt(E)+gngauss(sgma);
r4=gngauss(sgma);
r5=gngauss(sgma);
385
r6=gngauss(sgma);
r7=gngauss(sgma);
elseif((dsource1(i)==1) & (dsource2(i)==0) & (dsource3(i)==0)),
r0=gngauss(sgma);
r1=gngauss(sgma);90
r2=gngauss(sgma);
r3=gngauss(sgma);
r4=sqrt(E)+gngauss(sgma);
r5=gngauss(sgma);
r6=gngauss(sgma);
r7=gngauss(sgma);
elseif((dsource1(i)==1) & (dsource2(i)==0) & (dsource3(i)==1)),
r0=gngauss(sgma);
r1=gngauss(sgma);
r2=gngauss(sgma);100
r3=gngauss(sgma);
r4=gngauss(sgma);
r5=sqrt(E)+gngauss(sgma);
r6=gngauss(sgma);
r7=gngauss(sgma);
elseif((dsource1(i)==1) & (dsource2(i)==1) & (dsource3(i)==0)),
r0=gngauss(sgma);
r1=gngauss(sgma);
r2=gngauss(sgma);
r3=gngauss(sgma);110
r4=gngauss(sgma);
r5=gngauss(sgma);
r6=sqrt(E)+gngauss(sgma);
r7=gngauss(sgma);
elseif((dsource1(i)==1) & (dsource2(i)==1) & (dsource3(i)==1)),
r0=gngauss(sgma);
r1=gngauss(sgma);
r2=gngauss(sgma);
r3=gngauss(sgma);
r4=gngauss(sgma);120
r5=gngauss(sgma);
r6=gngauss(sgma);
r7=sqrt(E)+gngauss(sgma);
else
r0=gngauss(sgma);
r1=gngauss(sgma);
r2=gngauss(sgma);
r3=gngauss(sgma);
r4=gngauss(sgma);
r5=gngauss(sgma);130
r6=gngauss(sgma);
r7=sqrt(E)+gngauss(sgma);
end;
% the detector
maxr=max([r0 r1 r2 r3 r4 r5 r6 r7]);
if(r0==maxr),
decis1=0;
decis2=0;
decis3=0;
386
elseif(r1==maxr),140
decis1=0;
decis2=0;
decis3=1;
elseif(r2==maxr),
decis1=0;
decis2=1;
decis3=0;
elseif(r3==maxr)
decis1=0;
decis2=1;150
decis3=1;
elseif(r4==maxr)
decis1=1;
decis2=0;
decis3=0;
elseif(r5==maxr)
decis1=1;
decis2=0;
decis3=1;
elseif(r6==maxr)160
decis1=1;
decis2=1;
decis3=0;
else
decis1=1;
decis2=1;
decis3=1;
end;
% Count the number of bit errors made in this decision.
if(decis1=dsource1(i)),% If it is an error, increase the error counter.170
numoferr=numoferr+1;
end;
if(decis2=dsource2(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
if(decis3=dsource3(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;
p=numoferr/(3*N);% bit error probability estimate180
Figure 9.3 illustrates the outputs of the two correlators for dierent noise variances and transmitted
% Initialization:
387
2020
1010
00
10 10
20 20
05Tb10Tb15Tb20Tb20Tb25Tb30Tb35Tb40Tb
(a) 2= 0 & y(kT)(b) 2= 0 & y(kT)
0b1b
2020
1010
00
10 10
20 20
05Tb10Tb15Tb20Tb20Tb25Tb30Tb35Tb40Tb
(c) 2= 0.1 & y(kT)(d) 2= 0.1 & y(kT)
0b1b
2020
00
20 20
05Tb10Tb15Tb20Tb20Tb25Tb30Tb35Tb40Tb
22
(e) = 1 & y(kT)(f) = 1 & y(kT)
0b1b
Figure 9.3: Correlator outputs in Computer Problem 9.3. Solid, dashed, dotted, and dash-dotted plots
% Case 1: noiseN(0,0)
noise=random(Normal,0,0,1,K);
r0=s0+noise;r1=s1+noise;% received signals
r2=s2+noise;r3=s3+noise;% received signals
for k=1:K/2
y00(k)=sum(r0(1:k).*s0(1:k));
y01(k)=sum(r1(1:k).*s0(1:k));
y02(k)=sum(r2(1:k).*s0(1:k));30
y03(k)=sum(r3(1:k).*s0(1:k));
l=K/2+k;
y10(l)=sum(r0(21:l).*s1(21:l));
y11(l)=sum(r1(21:l).*s1(21:l));
y12(l)=sum(r2(21:l).*s1(21:l));
y13(l)=sum(r3(21:l).*s1(21:l));
end
% Plotting the results:
subplot(3,2,1)
plot(m,[0y00(1:K/2)],-bo,m,[0y01(1:K/2)],--b,. . .40
*
m,[0y02(1:K/2)],:b.,m,[0y03(1:K/2)],-.)
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})
axis([0 2025 25])
xlabel((a) \sigma^2= 0 & y_{0}(kT_{b}),fontsize,10)
subplot(3,2,2)
plot(n,[0y10(K/2+1:K)],-bo,n,[0y11(K/2+1:K)],--b,. . .
*
n,[0y12(K/2+1:K)],:b.,n,[0y13(K/2+1:K)],-.)
set(gca,XTickLabel,{20Tb,25Tb,30Tb,35Tb,40Tb})
axis([20 4025 25])
xlabel((b) \sigma^2= 0 & y_{1}(kT_{b}),fontsize,10)50
% Case 2: noiseN(0,0.1)
noise=random(Normal,0,0.1,4,K);
r0=s0+noise(1,:);r1=s1+noise(2,:);% received signals
r2=s2+noise(3,:);r3=s3+noise(4,:);% received signals
for k=1:K/2
y00(k)=sum(r0(1:k).*s0(1:k));
y01(k)=sum(r1(1:k).*s0(1:k));
389
y02(k)=sum(r2(1:k).*s0(1:k));
y03(k)=sum(r3(1:k).*s0(1:k));
l=K/2+k;60
y10(l)=sum(r0(21:l).*s1(21:l));
y11(l)=sum(r1(21:l).*s1(21:l));
y12(l)=sum(r2(21:l).*s1(21:l));
y13(l)=sum(r3(21:l).*s1(21:l));
end
% Plotting the results:
subplot(3,2,3)
plot(m,[0y00(1:K/2)],-bo,m,[0y01(1:K/2)],--b. . .
*
,m,[0y02(1:K/2)],:b.,m,[0y03(1:K/2)],-.)
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})70
axis([0 2025 25])
xlabel((c) \sigma^2= 0.1 & y_{0}(kT_{b}),fontsize,10)
subplot(3,2,4)
plot(n,[0y10(K/2+1:K)],-bo,n,[0y11(K/2+1:K)],--b,. . .
*
n,[0y12(K/2+1:K)],:b.,n,[0y13(K/2+1:K)],-.)
set(gca,XTickLabel,{20Tb,25Tb,30Tb,35Tb,40Tb})
axis([20 4025 25])
xlabel((d) \sigma^2= 0.1 & y_{1}(kT_{b}),fontsize,10)
% Case 3: noiseN(0,1)80
noise=random(Normal,0,1,4,K);
r0=s0+noise(1,:);r1=s1+noise(2,:);% received signals
r2=s2+noise(3,:);r3=s3+noise(4,:);% received signals
for k=1:K/2
y00(k)=sum(r0(1:k).*s0(1:k));
y01(k)=sum(r1(1:k).*s0(1:k));
y02(k)=sum(r2(1:k).*s0(1:k));
y03(k)=sum(r3(1:k).*s0(1:k));
l=K/2+k;
y10(l)=sum(r0(21:l).*s1(21:l));90
y11(l)=sum(r1(21:l).*s1(21:l));
y12(l)=sum(r2(21:l).*s1(21:l));
y13(l)=sum(r3(21:l).*s1(21:l));
end
% Plotting the results:
subplot(3,2,5)
plot(m,[0y00(1:K/2)],-bo,m,[0y01(1:K/2)],--b,. . .
*
m,[0y02(1:K/2)],:b.,m,[0y03(1:K/2)],-.)
set(gca,XTickLabel,{0,5Tb,10Tb,15Tb,20Tb})
axis([0 2030 30])100
xlabel((e) \sigma^2= 1 & y_{0}(kT_{b}),fontsize,10)
subplot(3,2,6)
plot(n,[0y10(K/2+1:K)],-bo,n,[0y11(K/2+1:K)],--b,. . .
*
n,[0y12(K/2+1:K)],:b.,n,[0y13(K/2+1:K)],-.)
set(gca,XTickLabel,{20Tb,25Tb,30Tb,35Tb,40Tb})
axis([20 4030 30])
xlabel((f) \sigma^2= 1 & y_{1}(kT_{b}),fontsize,10)
390
0
10
Simulation
Theoretical
-1
10
-2
10
-3
4
10
P
-4
10
-5
10
-6
10
0246810
10 logE/N0
10b
Figure 9.4: Symbol-error probability forM4 biorthogonal signals from Monte Carlo simulation
Figure 9.4 illustrates the results of the simulation for the transmission of 20000 bits at several
dierent values of the SNRE=N0. Note the agreement between the simulation results and the
b
theoretical value ofP4given by (9.30) and (9.31).
PM1Pc(9.30)
wherePcis given by
M1
Z12Zrp3
10=EN0=22
pex=2dx5pr dr(9.31)
Pc4p
00
02r0=EN0=2
391
echo on ;
% Plotting commands follow.10
function[p]=smldP89(snrindB)
% [p]=smldP89(snrindB)
% SMLDP89 simulates the probability of error for the given
% snrindB, signal-to-noise ratio in dB, for the system
% described in Computer Problem 9.4.
M=4;% quaternary biorthogonal signaling
E=1;
SNR=exp(snrindB*log(10)/10);% signal-to-noise ratio per bit
sgma=sqrt(E^2/(4*SNR));% sigma, standard deviation of noise
N=10000;% number of symbols being simulated10
% generation of the quaternary data source
for i=1:N,
temp=rand;% uniform random variable over (0,1)
if(temp<0.25),
dsource(i)=0;
elseif(temp<0.5),
dsource(i)=1;
elseif(temp<0.75),
dsource(i)=2;
else20
dsource(i)=3;
end
end;
% detection, and error probability computation
numoferr=0;
for i=1:N,
% the matched lter outputs
if(dsource(i)==0)
r0=sqrt(E)+gngauss(sgma);
r1=gngauss(sgma);30
elseif(dsource(i)==1)
r0=gngauss(sgma);
r1=sqrt(E)+gngauss(sgma);
elseif(dsource(i)==2)
r0=sqrt(E)+gngauss(sgma);
r1=gngauss(sgma);
else
r0=gngauss(sgma);
r1=sqrt(E)+gngauss(sgma);
end;40
% detector follows
if(r0>abs(r1)),
decis=0;
elseif(r1>abs(r0)),
decis=1;
elseif(r0<abs(r1)),
decis=2;
else
decis=3;
392
3000
y
1c
y
2500
1s
y
2c
y
2000
2s
1500
1000
500
-500
010002000300040005000
k
end;50
if(decis=dsource(i)),% If it is an error, increase the error counter.
numoferr=numoferr+1;
end;
end;
p=numoferr/N;% bit error probability estimate
Figures 9.5 and 9.6 present the correlator outputs forcos2 f1tandcos2 f2t, respectively.
393
3000
y
1c
2500
y
1s
y
2c
2000
y
2s
1500
1000
500
-500
-1000
010002000300040005000
k
end;
% The correlator outputs are computed next.
v1=sin(2*pi*f1*t);
v2=sin(2*pi*f2*t);
y1c(1)=r(1)*u1(1);
y1s(1)=r(1)*v1(1);
y2c(1)=r(1)*u2(1);20
y2s(1)=r(1)*v2(1);
fork=2:N,
y1c(k)=y1c(k1)+r(k)*u1(k);
y1s(k)=y1s(k1)+r(k)*v1(k);
y2c(k)=y2c(k1)+r(k)*u2(k);
y2s(k)=y2s(k1)+r(k)*v2(k);
end;
% decision variables
y1=y1c(5000)^2+y1s(5000)^2
y2=y2c(5000)^2+y2s(5000)^230
% Plotting commands follow.
plot(y1c,-);
holdon;
plot(y1s,-.);
holdon;
plot(y2c,--);
holdon;
plot(y2s,-.);
legend(y_{1c},y_{1s},y_{2c},y_{2s});
xlabel(k);40
394
0
10
-1
10
-2
10
-3
10
-4
10
024681012
E/N0in dB
b
Figure 9.7: Theoretical error probability and Monte Carlo simulation results for a binary FSK system
Figure 9.7 presents the measured error rate and compares it with the theoretical error probability.
395
function[p]=cmsm52(snrindB)
% [p]=cmsm52(snrindB)
% CMSM52 Returns the probability of error for the given
% value of snrindB, signal-to-noise ratio in dB.
N=10000;
Eb=1;
d=1;
snr=10^(snrindB/10);% signal-to-noise ratio per bit
sgma=sqrt(Eb/(2*snr));% noise variance
phi=0;10
% Generation of the data source follows.
for i=1:N,
temp=rand;% a uniform random variable between 0 and 1
if(temp<0.5),
dsource(i)=0;
else
dsource(i)=1;
end;
end;
% detection and the probability of error calculation20
numoferr=0;
for i=1:N,
% demodulator output
if(dsource(i)==0),
y0c=sqrt(Eb)*cos(phi)+gngauss(sgma);
y0s=sqrt(Eb)*sin(phi)+gngauss(sgma);
y1c=gngauss(sgma);
y1s=gngauss(sgma);
else
y0c=gngauss(sgma);30
y0s=gngauss(sgma);
y1c=sqrt(Eb)*cos(phi)+gngauss(sgma);
y1s=sqrt(Eb)*sin(phi)+gngauss(sgma);
end;
% square-law detector outputs
y0=y0c^2+y0s^2;
y1=y1c^2+y1s^2;
% Decision is made next.
if(y0>y1),
decis=0;40
else
decis=1;
end;
% If the decision is not correct the error counter is increased.
if(decis=dsource(i)),
numoferr=numoferr+1;
end;
end;
p=numoferr/(N);
396
Chapter 10
Problem 10.1
1)The following table shows the values ofEW =Tobtained using an adaptive recursive Newton-
h
Cotes numerical integration rule.
W T0.51.01.52.02.53.0
EW =T0.22530.34420.37300.37480.34790.3750
h
A plot ofEW =Tas a function ofW Tis given in the next gure
h
0.4
0.35
0.3
0.25
0.2
Energy / T
0.15
0.1
0.05
0
0.511.522.53 3.5
WT
40T2
T
T1Z2T
costdt
420T2
T
1Z2T
1cos2tdt
80T2
TT3T
4880:3750T
397
Problem 10.2
We have
8
>>>a11
nwith Prob.
24
><
yan1with Prob.1
24
>>>
>:1
anwith Prob.
2
2Qn4Q2n4Q2n
Problem 10.3
1
X
ytanxtnT t
n1
wherextht ? htandtnt ? ht. If the sampling time is o by 10%, then the samples
1
X1
ymanxmTnT m1T
n11010
P1
If the signal pulse is rectangular with amplitudeAand durationT, thenanxm1TnT
n1
10
is nonzero only fornmandnm1 and therefore, the sampled sequence is given by
The power spectral density of the noise at the output of the correlator is
N0
Sf Sf jHf j2A2T2sinc2f T
n
2
398
Thus, the variance of the noise is
Z1
N0N01N0
nu2A2T2sinc2f T dfA2T2A2T
122T2
22 22
SNR92AT812AT
10N0A2T100N0
91
ymamA2Tam1A2Tm
1010
2
The termam1ATexpresses the ISI introduced to the system. Ifam1 is transmitted, then the
10
probability of error is
2QN0210N0
Since the symbols of the binary PAM system are equiprobable the previous derived expression is
the probability of error when a symbol by symbol detector is employed. Comparing this with the
probability of error of a system with no ISI, we observe that there is an increase of the probability of
error by
2v32s3
ut2
82A2T12A2T
Pe1Q4Q4
di525
210N0N0
Problem 10.4
1)Taking the inverse Fourier transform ofHf , we obtain
ht F1Hf ttt0tt0
22
Hence,
ytst ? htststt0stt0
22
2)If the signalstis used to modulate the sequencefang, then the transmitted signal is
1
X
utanstnT
n1
399
The received signal is the convolution ofutwithht. Hence,
1 !
X
ytut ? htanstnT?ttt0tt0
n122
111
XXX
anstnTanstt0nTanstt0nT
n1 2n1 2n1
1Z1
X
wt1ansnT st1d
n11
1Z1
X
st0nT st1d
2an1
n1
1Z1
X
st0nT st1d
2an1
n1
If we denote the signalst ? stbyxt, then the output of the matched lter att1kTis
1
X
wkTanxkTnT
n1
11
XX
xkTt0nTanxkTt0nT
2an 2
n1n1
x1anxkakx1anxk
2ak2n122n1
nknk
akx0x1x1anxkxkxk
22n2n12n1
nk
The terms under the summation is the ISI introduced by the channel.
Problem 10.5
400
The functiongtneeds to be checked only for those values oftsuch that 42t2=T21 ortT.
2
However,
cosx
limcos t=Tlim2
t!T 142t2=T2x!11x
2
cosx
lim2limsinx<1
x!11xx!1222
Hence,
8
><1
n0
xnT
>:0
n0
Problem 10.6
1Z1
Z1Z
2T2T
Xr cf dfT1cos Tf1dfT df
1122T1
2T2T
1
Z
2T
T T1
1cosfdf
1
22T
2T
1Z1
Z
2T2T
T1T
1 dfT1df
2T 2T2T2
1 Z1
Z
2T2T
T1 T1
1 cosfdf1cosfdf
2T 2T2T2T
Z0Z
T
1cos Txdxcos Txdx
T0
Z
T
1cos Txdx101
Problem 10.7
88
><T1><V1
f T Uf jfj< f jfj<
ReXfTImXfT
>:0>:0
otherwise otherwise
401
withUf even with respect to 0 and odd with respect tof1Sincextis real,V f is odd with
2T
respect to 0 and by assumption it is even with respect tof1. Then,
2T
xt F1Xf
1Z1Z1
Z
2T2TT
j2 f tj2 f tj2 f t
1 T edf1Uf jV f edf
2TT
1
Z
T
sinct=TUf jV f ej2 f tdf
1
1
RT
Consider rst the integral1Uf ej2 f tdf. Clearly,
T
1Z0Z1
Z
TT
j2 f tj2 f tj2 f t
1Uf edf1Uf edfUf edf
TT0
and by using the change of variablesf0f1andf0f1for the two integrals on the right
2T2T
hand side respectively, we obtain
1
Z
T
j2 f t
1 Uf edf
T
1 Z1
Z
2T2T
1010
ejTtUf0ej2 ftdf0ejTtUf0ej2 ftdf0
11
2T 2T2T2T
1
Z
a2T1j0
ejTtejTtUf0e2 ftdf0
1
2T 2T
1
Z
2T
10
2jsintUf0ej2 ftdf0
T12T
2T
where for step (a) we used the odd symmetry ofUf0with respect tof01, that is
2T
11
Uf0 Uf0
2T2T
1
RT
For the integral1V f ej2 f tdfwe have
T
1
Z
T
j2 f t
1 V f edf
T
1
Z0Z
j2 f tTj2 f t
1 V f edfV f edf
T0
1Z1
Z
2T2T
1010
ejTtV f0ej2 ftdf0ejTtV f0ej2 ftdf0
11
2T 2T2T2T
402
However,V f is odd with respect to 0 and sinceV f01andV f01are even, the translated
2T2T
spectra satisfy
1 Z1
Z
2T2T
01j2 f0t001j2 f0t0
1V fedf1V fedf
2T 2T2T2T
Hence,
1
Z
2T
10
xtsinct=T 2jsintUf0ej2 ftdf0
T12T
2T
1
Z
2T
10
2 sintUf0ej2 ftdf0
T12T
2T
and therefore,
8
><1
n0
xnT
>:0
n0
Problem 10.8
The bandwidth of the channel is 1400 Hz. Since the minimum transmission bandwidth required
for baseband signaling isR=2, whereRis the symbol rate, we conclude that the maximum value
of the symbol rate for the given channel isRmax2800. If anM-ary PAM modulation is used for
transmission, then in order to achieve a bit-rate of 9600 bps, with maximum symbol rate ofRmax,
the minimum size of the constellation isM2k16. In this case, the symbol rate is
R96002400 symbols/sec
k
and the symbol intervalT11sec. The roll-o factorof the raised cosine pulse used for
R2400
transmission is determined by noting that 120011400, and hence,0:166. Therefore, the
Since the bandwidth of the ideal lowpass channel isW2400 Hz, the rate of transmission is
R224004800 symbols/sec
k144003
4800
403
Hence, the number of transmitted symbols is 238. If a duobinary pulse is used for transmission,
then the number of possible transmitted symbols is 2M115. These symbols have the form
bn0;2d;4d; : : : ;12d
where 2dis the minimum distance between the points of the 8-PAM constellation. The probability
2v3
ut2
6kEb;av
PM<211Q425
M24M1N0
WithPM106andM8 we obtain
kE
b;av3
1:319310=) E0:088
N0b;av
Problem 10.10
1)If the power spectral density of the additive noise isSf , then the PSD of the noise at the output
n
of the prewhitening lter is
Sf Sf jHpf j2
n
Hpf 1q
Sf
n
2)Lethptbe the impulse response of the prewhitening lterHpf . That is,hpt F1Hpf .
Then, the input to the matched lter is the signalstst ? hpt. The frequency response of the
j2 f t0j2 f t0
SmfSf eSf Hf e
p
wheret0is some nominal time-delay at which we sample the lter output.
3)The frequency response of the overall system, prewhitening lter followed by the matched lter, is
Sf
Gf Smf Hpf Sf jHpf j2ej2 f t0 ej2 f t0
Sf
n
404
4)The variance of the noise at the output of the generalized matched lter is
Z1Z1
22jSf j2
Sf jGf jdf df
n
11Snf
At the sampling instanttt0T, the signal component at the output of the matched lter is
Z1Z1
yTY f ej2 f TdfsgTd
11
Z1Z1
2
Sf Sf dfjSf j df
1 Snf1Snf
1Snf
Problem 10.11
.25.33.50.67.751.00
R240022562000179617141500
Problem 10.12
The following table shows the precoded sequence, the transmitted amplitude levels, the received
signal levels and the decoded sequence, when the data sequence 10010110010 modulates a duobinary
transmitting lter.
Data seq.dn:1 0 0 1 0 1 1 0 0 1 0
Precoded seq.pn:0 1 1 1 0 0 1 0 0 0 1 1
Transmitted seq.an:-1 1 1 1 -1 -1 1 -1 -1 -1 1 1
Received seq.bn:0 2 2 0 -2 0 0 -2 -2 0 2
Decoded seq.dn:1 0 0 1 0 1 1 0 0 1 0
Problem 10.13
405
The following table shows the precoded sequence, the transmitted amplitude levels, the received
signal levels and the decoded sequence, when the data sequence 10010110010 modulates a modied
Data seq.dn:1 0 0 1 0 1 1 0 0 1 0
Precoded seq.pn:0 0 1 0 1 1 1 0 0 0 0 1 0
Transmitted seq.an:-1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 -1
Received seq.bn:2 0 0 2 0 -2 -2 0 0 2 0
Decoded seq.dn:1 0 0 1 0 1 1 0 0 1 0
Problem 10.14
P zDzmodM
Xz
whereDzandP zare theZ-transforms of the data and precoded sequences respectively. For
P zDz=)P zDzz1P z
1z1
pndnpn1
However, the inverse lter1exists only ifx0, the rst coecient ofXzis relatively prime
Xz
withM. If this is not the case, then the precoded symbolspncannot be determined uniquely from
Problem 10.15
1)The dimensionality of the signal space is two. An orthonormal basis set for the signal space is
406
2)The optimal receiver is shown in the next gure
t=T
2
r1T
1(t)Select
r (t)
2
the
t=T
2(Tt) largestr2
3)Assuming that the signals1tis transmitted, the received vector at the output of the samplers is
s
2
rATn1; n2
2
wheren1,n2are zero mean Gaussian random variables with varianceN0. The probability of error
2
P ejs1is
s
2
P ejs1P n2n1>AT
2
2s3
12
x2
1Z2AT
5
pAeN0dxQ4
2 N02T2N0
2
where we have used the fact thenn2n1is a zero-mean Gaussian random variable with variance
r
2
N0. Similarly we nd thatP ejs1QAT, so that
2N0
2s3
1A2T
5
P e1P ejs1P ejs2Q4
222N0
4)The signal waveform 1Ttmatched to 1tis exactly the same with the signal waveform
2
2Ttmatched to 2t. That is,
8q
2T
<;
T>T0t <2
1t 2Tt 1t
2>:0
;otherwise
Thus, the optimal receiver can be implemented by using just one lter followed by a sampler which
samples the output of the matched lter attTandtTto produce the random variablesr1and
2
r2respectively.
r ts1t1s1tTnt
22
407
If the optimal receiver uses a thresholdVto base its decisions, that is
s1
r1r2>V
<
s2
2s3
s
22
5
P ejs1P n2n1>2ATV Q42ATVp
88N0N0
r ts2t1s2tTnt
22
r1n1
ss
r2A2T3A2Tn2
T42T4
s
5A2T
28n2
2s3
s
22
5ATV
5
p
P ejs2P n1n2>5ATV Q4
2828N0N0
1
P e1P ejs1P ejs2
22
2s32s3
1A2TV15A2TV
42p5Q4p5
2Q8N0N0228N0N0
The optimal value ofVcan be found by setting#P eequal to zero. Using Leibnitz rule to dierentiate
#V
denite integrals, we obtain
0s120s12
#P eA2TV5A2TV
@2pA@pA
#V08N0N028N0N0
408
6)Letabe xed to some value between 0 and 1. Then, if we argue as in part 5) we obtain
s
2
P ejs1; aP n2n1>2ATV a
8
s
2
P ejs2; aP n1n2> a2ATV a
8
For a givena, the optimal value ofV ais found by setting#P ejaequal to zero. By doing so we
#V a
nd thats
2
V a aAT
42
Z1s2Z1s2
VV af ada 1ATada 1AT
042082
Problem 10.16
pmdm pm1
The corresponding trellis has two states associated with the binary values of the historypm1. For
pmdmpm2
Hence, the corresponding trellis has four states depending on the values of the pairpm2; pm1.
The two trellises are depicted in the next gure. The branches have been labelled asx=y, where
xis the binary input datadmandyis the actual transmitted symbol. Note that the trellis for the
modied duobinary signal has more states, but the minimum free distance between the paths is
d3, whereas the minimum free distance between paths for the duobinary signal is 2.
free
1/1
10
1
0/-1
11
409
Problem 10.17
1
Sf 1Sf jXr cf j2jXr cf j2
Va
TT
whereT1and
2400
8
>>>T 1
0 jfj
4T
><
Xr cfT1cos2 T jfj 11 jfj 3
24T4T4T
>>>
>:
0 otherwise
If the carrier signal has the formctAcos2 fct, then the spectrum of the DSB-SC modulated
signal,Sf , is
U
Sf ASffc Sffc
UVV
2
2
AT
2)Assuming bandpass coherent demodulation using a matched lter, the received signalr tis rst
The output of the matched lter is sampled attTand the samples are passed to the detector. The
detector is a simple threshold device that decides if a binary 1 or 0 was transmitted depending on
the sign of the input samples. The following gure shows a block diagram of the optimum bandpass
coherent demodulator.
Detectort=TBandpass
r (t)
........(Thresholdmatched lter
.....
(t)
device)gR
410
Problem 10.18
W30006002400 Hz
Since each symbol of the QPSK constellation conveys 2 bits of information, the symbol rate of
transmission is
R24001200 symbols/sec
2
Thus, for spectral shaping we can use a signal pulse with a raised cosine spectrum and roll-o factor
1, that is
jfj
Xr cf T1cos Tjfj1cos2
224002400
If the desired spectral characteristic is split evenly between the transmitting lterGTf and the
GTf GRf1cosjfj;jfj<11200
12002400T
to ChannelGT(f )an
QPSK
cos(2 fct)
2)If the bit rate is 4800 bps, then the symbol rate is
R48002400 symbols/sec
2
In order to satisfy the Nyquist criterion, the the signal pulse used for spectral shaping, should have
the spectrum
Xf Tf
W
p
Thus, the frequency response of the transmitting lter isGTfTf.
W
Problem 10.19
The bandwidth of the bandpass channel is
W33003003000 Hz
In order to transmit 9600 bps with a symbol rateR2400 symbols per second, the number of
k96004
2400
411
Hence, a 2416 QAM signal constellation is needed. The carrier frequencyfcis set to 1800 Hz,
which is the mid-frequency of the frequency band that the bandpass channel occupies. If a pulse
with raised cosine spectrum and roll-o factoris used for spectral shaping, then for the bandpass
R120011500
and
0:25
A sketch of the spectrum of the transmitted signal pulse is shown in the next gure.
1/2T
f
-3300300
-3003300
600
1800
-1800
3000
Problem 10.20
k480048002
R2400
Thus, a 4-QAM constellation is used for transmission. The probability of error for an M-ary QAM
system withM2k, is
s#!2
"
PM11211pQ3kEb
MM1N0
WithPM105andk2 we obtain
s#
"
Q2Eb5106=)Eb9:7682
N0N0
s#!2
"
PM11211Q34 Eb
415N0
412
Thus,
s#
"
1E
Q3 Eb105=b25:3688
15N03)N0
k192008
2400
s#!2
"
PM11211Q38 Eb
16255N0
WithPM105we obtain
E
b
659:8922
N0
4)The following table gives the SNR per bit and the corresponding number of bits per symbol for the
k248
SNR (db)9.8914.0428.19
per symbol.
Problem 10.21
1
2T12000
frequencies isf1, where1is the bit rate, the two frequencies arefc1andfc1. Since
TT2T2T
W4000 Hz, we may select11000, or, equivalently,12000. Hence, the bit rate is 2000 bps,
2TT
and the two FSK signals are orthogonal.
(5) Four FSK with noncoherent detection. In this case we need four frequencies with separation of1
T
413
between adjacent frequencies. We selectf1fc1:5,f2fc1,f3fc1, andf4fc1:5,
T2T2TT
where1500 Hz. Hence, the symbol rate is11000 symbols per second and since each symbol
2TT
carries two bits of information, the bit rate is 2000 bps.
(6)M8 FSK with noncoherent detection. In this case we require eight frequencies with frequency
separation of1500 Hz for orthogonality. Since each symbol carries 3 bits of information, the bit
T
rate is 1500 bps.
Problem 10.22
1Z1
X
ytakgTkTbgRtdt
k11
1
X
akxtkTbt
k1
where,
sin tcos t
xtgTt ? gRtTT
tt2
T14T2
Hence,
1
X
ymTbakxmTbkTbvmTb
k1
11
amam1am1mTb
The term1am11am1represents the ISI introduced by doubling the symbol rate of transmission.
2)In the next gure we show one trellis stage for the ML sequence detector. Since there is postcursor
ISI, we delay the received signal, used by the ML decoder to form the metrics, by one sample. Thus,
the states of the trellis correspond to the sequenceam1; am, and the transition labels correspond
to the symbolam1. Two branches originate from each state. The upper branch is associated with
the transmission of1, whereas the lower branch is associated with the transmission of 1.
am+
1
(am, am)
-11
-1 -1
-11-1 1
1
-1
11 -1
-1
11 1
414
Problem 10.23
X1
ymamxkmamam1m
m
k4
N0
Ekxk
jj
2
2N0N0
2x02
p
If a symbol by symbol detector is employed and we assume that the symbolsamam1E
b
p
have been transmitted, then the probability of errorP ejamam1Eis
b
qq
P ejamam1EP ym<0jamam1E
bb
5p
q1Z4E2
bm
P m<5EpeN0dm
4b N01
r
#
52E "
bs
N2
1Z052E
p4e2dQb
214N0
p
If howeveram1E, then
b
"#
q q 3q3s2
P ejamE; am1EPE<0QEb
bbbm
44N0
pp
Since the two symbolsE,Eare used with equal probability, we conclude that
bb
qq
P eP ejamEP ejamE
bb
s#"s#
"
152E132E
bb
2Q4N02Q4N0
2)In the next gure we plot the error probability obtained in part (a) (logP e) vs. the SNR per bit
10
and the error probability for the case of no ISI. As it observed from the gure, the relative dierence
415
-2
-2.5
-3
-3.5
-4
-4.5
log(P(e)
-5
-5.5
-6
-6.5
-7
78910111213 14
6
SNR/bit, dB
Problem 10.24
1
2 RCf1
Cfj
R11j2 RCf
j2 RCf
f 12 RCRC
Tcf 1dc
2 df2142RC2f2142RC2f2
Problem 10.25
416
1)The envelope delay of the RC lter is (see Problem 9.19)
Tcf RC
142RC2f2
-7
x10
10
9.999
9.998
9.997
9.996
9.995
Tc(f)
9.994
9.993
9.992
9.991
9.99
050010001500200025003000350040004500 5000
Frequency (f)
2)The following gure is a plot of the amplitude characteristics of the RC lter,jCf j. The values
of the vertical axis indicate thatjCf jcan be considered constant for frequencies up to 2000 Hz.
Since the same is true for the envelope delay, we conclude that a lowpass signal of bandwidthf1
417
1
|C(f)|
0.999
50010001500200025003000350040004500 5000
0
Frequency (f)
Problem 10.26
LetGTf andGRf be the frequency response of the transmitting and receiving lter. Then, the
8
>>>T 1
0 jfj
4T
><
GTf Cf GRf Xr cfT1cos2 T jfj 11 jfj 3
2T4T4T
>>>
>:3
0jfj>
4T
Since the additive noise is white, the optimum transmitting and receiving lter characteristics are
418
Problem 10.27
A 4-PAM modulation can accommodatek2 bits per transmitted symbol. Thus, the symbol interval
duration is
Tk1sec
96004800
Since, the channels bandwidth isW24001, in order to achieve the maximum rate of
2T
transmission,Rmax1, the spectrum of the signal pulse should be
2T
Xf Tf
2W
Then, the magnitude frequency response of the optimum transmitting and receiving lter is (see
Example 9.4.1)
81
1
"2#4>><f24
;jfj<2400
jGTf j jGRf j1ff12400
24002W>>:
0 otherwise
Problem 10.28
1
X
hthntnT 0:3tT 0:9t0:3tT
n1
If byfcngwe denote the coecients of the FIR equalizer, then the equalized signal is
1
X
qmcnhmn
n1
010101
0:9 0:3 0:c10
BCBCBC
BCBCBC
B0CBcCB1C
:3 0:9 0:3CB0
BCBC
@A@A@A
0:0:3 0:9c10
The coecients of the zero-force equalizer can be found by solving the previous matrix equation.
Thus,
0101
c10:4762
BCBC
BCBC
BcCB1C
:4286C
0CB
B
@A@A
c10:4762
419
2)The values ofqmform 2;3 are given by
1
X
q2cnh2nc1h1 0:1429
n1
1
X
q2cnh2nc1h1 0:1429
n1
1
X
q3cnh3n0
n1
1
X
q3cnh3n0
n1
Problem 10.29
1
X
qmcnxm
n
n1
420
Hence, the residual ISI sequence is
Problem 10.30
23
N
X
JckE4ck;nykak625
n
nN
then itslthelement is
2013
@Jck1NXA5
gk;lE42@ck;nykakyk
2@ck;l2nl
nN
Eekyk Eekyk
ll
EgkEekyk Eekykgk
Problem 10.31
Iffcngdenote the coecients of the zero-force equalizer andfqmgis the sequence of the equalizers
output samples, then
1
X
qmcnxmn
n1
wherefxkgis the noise free response of the matched lter demodulator sampled attkT. With
421
The solution to the system is
c1c0c10:21370:3846 1:3248
Problem 10.32
The optimum tap coecients of the zero-force equalizer can be found by solving the system
010101
1:0 0:3 0:0c10
BCBCBC
BCBCBC
B0CBcCB1C
:2 1:0 0:3CB0
BCBC
@A@A@A
0:0 0:2 1:0c10
Hence,
0101
c10:3409
BCBC
BCBC
BcCB1C
:1364C
0CB
B
@A@A
c10:2273
8
>>>0
m3
>>>
>>>
c1x1 0:1023m 2
>>>
>>>
>>>0m 1
<
qm1m0
>>>
>>>
0m1
>>>
>>>
>>>c1x1 0:0455m2
>>>
:0
m3
Problem 10.33
422
1)If we assume that the signal pulse has durationT, then the output of the matched lter at the
time instanttTis
ZT
yTr sd
0
ZT
ssT nsd
0
ZTZT
s2dnsd
00
En
s
whereEis the energy of the signal pulse andnis a zero-mean Gaussian random variable with
s
E
variance2N0s. Similarly, the output of the matched lter att2Tis
n2
ZTZT
y2Ts2dnsd
00
En
s
withantaking the values 1;1 with equal probability, then the output of the demodulator at the
time instanttkTis
ykakEakEnk
s1s
The termakEexpresses the ISI due to the signal reection. If a symbol by symbol detector is
1s
employed and the ISI is ignored, then the probability of error is
2P 1Es2s
2s32s3
1212E1212E
ss
45Q45
2QN02N0
3)To nd the error rate performance of the DFE, we assume that the estimation of the parameter
is correct and that the probability of error at each time instant is the same. Since the transmitted
P ep1P eq
423
where
2QN02N0
and
P Enk<0Q2Es
s
N0
Input
Threshold
rk+Outputak
+
device
DelayEstimate
Problem 10.34
A discrete time transversal lter equivalent to the cascade of the transmitting ltergTt, the channel
ct, the matched lter at the receivergRtand the sampler, has tap gain coecientsfymg, where
8
>>>0
:9m0
><
ym0:3m 1
>>>
>:
0 otherwise
The noisek, at the output of the sampler, is a zero-mean Gaussian sequence with autocorrelation
function
Ek2yk;jklj 1
ll
424
If theZ-transform of the sequencefymg,Y z, assumes the factorization
Y zF zFz1
then the lter 1=Fz1can follow the sampler to white the noise sequencek. In this case the
output of the whitening lter, and input to the MSE equalizer, is the sequence
X
unakfnnk
k
k
wherenkis zero mean Gaussian with variance2. The optimum coecients of the MSE equalizer,
where
1
X
RunkEululfmfm2
knnkn;k
m0
8
><y2
nkn;k;jnkj 1
>:0
otherwise
8
><f
k;1k0
RuakEanun
k
>:0
otherwise
With
Y z0:3z0:90:3z1f0f1z1f0f1z
8p8p
><0><0
:7854:1146
f0; f1
pp
>:0>:0
:1146:7854
The parametersf0andf1should have the same sign sincef0f10:3. However, the sign itself does
not play any role if the data are dierentially encoded. To have a stable inverse system 1=Fz1,
we selectf0andf1in such a way that the zero of the systemFz1f0f1zis inside the unit
pp
circle. Thus, we choosef00:1146andf10:7854and therefore, the desired system for the
equalizers coecients is
01010p1
0:90:1 0:3 0:0c10:7854
BCBCBC
BCBCBpC
B0CBcCB0C
:3 0:90:1 0:3CB0:1146C
BCB
@A@A@A
0:0 0:3 0:90:1c10
425
Problem 10.35
The power spectral density of the noise at the output of the matched lter is
N0 N01 f
Sf Sf jGRf j2jXf jcos
n
22W2W
21W2W
Z1
N01 f f 1
jj2 f
2W4W
21Wcos2Weedf
Z1
N0 1
Xf ej2 f4Wdf
21
N01
2x4W
and therefore,
R0N0x1N0sinc1sinc12N0
24W222
RT R1N0sinc3sinc12N0
2W2223
Since the noise is of zero mean, the covariance matrix of the noise is given by
0101
R0 RT2N11
C0B3C
CB@A@1A
RT R01
3
Problem 10.36
a)Each segment of the wire-line can be considered as a bandpass lter with bandwidthW1200 Hz.
Thus, the highest bit rate that can be transmitted without ISI by means of binary PAM is
R2W2400 bps
Hence, using mathematical tables for the functionQ, we nd thatP2107is obtained for
s
2EE
bb
5:2=)13:5211:30 dB
N0N0
426
c)The received powerPRis related to the desired SNR per bit through the relation
PRE
Rb
N0N0
Problem 10.37
"#
X
stRea0QtnT
n
n
"#
X
Reanej2 fcnTgtnT cos 2 fctnT jsin 2 fctnT
n
"#
X
ReangtnT cos 2 fcnTjsin 2 fcnT cos 2 fctnT jsin 2 fctnT
n
"
X
ReangtnT cos 2 fcnTcos 2 fctnT sin 2 fcnTsin 2 fctnT
n
#
"#
X
ReangtnT cos 2 fctjsin 2 fct
n
"#
X
ReangtnT ej2 fct
n
st
2)
427
j2fnT
j2fnT
-
e
q(t)
e
q(t)
a
a'
nr
+
+nr
+
a'
-
a
ni
ni
^
^
q(t)
q(t)
Modulator Demodulator
1) The impulse response of the pulse having a square-root raised cosine characteristic, is an even
function, i.e.,xSQtxSQt, i.e., the pulsegtis an even function. We know that the product of
an even function times an even function is an even function, while the product of an even function
times an odd function is an odd function. Henceqtis even whileqtis odd and their product
Z1Z1
=2T
qtqt dtqtqt dt0
11=2T
QAM system (described in Problem 10.22) gives a trivial rotation of an integer number of full circles
Computer Problems
The impulse response and the frequency response of a lengthN41 FIR lter that meets these
specications is illustrated in Figures 10.1, 10.2, and 10.3 . SinceNis odd, the delay through the lter
isN1=2 taps, which corresponds to a time delay ofN1=20 ms at the sampling rate ofFs10
KHz. In this example, the FIR lter was designed in MATLAB using the Chebyshev approximation
428
0.6
0.5
0.4
0.3
h(m)
0.2
0.1
-0.1
051015202530354045
m
Figure 10.1: Impulse response of linear phase FIR lter in Computer Problem 10.1
echo on
fcuto=2000;% the desired cuto frequency
fstopband=2500;% the actual stopband frequency
fs=10000;% the sampling frequency
f1=2*fcuto/fs;% the normalized passband frequency
f2=2*fstopband/fs;% the normalized stopband frequency
N=41;% This number is found by experiment.
F=[0f1 f21];
M=[1 1 0 0];% describes the lowpass lter10
B=remez(N1,F,M);% returns the FIR tap coecients
% Plotting command follows.
gure(1);
[H,W]=freqz(B);
HindB=20*log10(abs(H));
plot(W/(2*pi),HindB);
gure(2);
plot(W/(2*pi),(180/pi)*unwrap(angle(H)));
% Plot of the impulse response follows.
gure(3);20
plot(zeros(size([0:N1])));
hold;
stem([0:N1],B);
429
10
-10
-20
-30
|H|
-40
-50
-60
-70
-80
00.10.20.30.40.5
Figure 10.2: Frequency response of linear phase FIR lter in Computer Problem 10.1
430
0
-200
-400
-600
-800
H|
\
|
-1000
-1200
-1400
-1600
-1800
-2000
00.10.20.30.40.5
Figure 10.3: Phase response of linear phase FIR lter in Computer Problem 10.1
431
Computer Problem 10.2
For Channel 1, the received signal sequenceynin the absence of noise is shown in Figure 10.4(a),
and with additive white Gaussian noise having a variance of20:1, the received signal sequence is
shown in Figure 10.4(b). We note that in the absence of noise, the ISI alone does not cause errors at
the detector that compares the received signal sequenceynwith the threshold set to zero. Hence,
the eye diagram is open in the absence of noise. However, when the additive noise is suciently
Figure 10.5. Now, we observe that the ISI can cause errors at the detector that compares the received
sequenceynwith the threshold set at zero, even in the absence of noise. Thus, for this channel
% channel 1
xch1= [ 0.10.25 10.25 0.1];
% channel 2
xch2= [0.2 0.5 1 0.50.2];
noisevar=0.1;
sigma=sqrt(noisevar);
10
forak=1:2:1
for i=0:15
a=dec2bin(i,4);
%Output of channel 1
yk1(i+1) =ak+xch1(4)*(2*str2num(a(1))1) +xch1(2)*(2*str2num(a(2))1) + . . .
xch1(5)*(2*str2num(a(3))1) +xch1(1) * (2*str2num(a(4))1);
yk1noise(i+1) =yk1(i+1) +gngauss(sigma);
%Output of channel 2
yk2(i+1) =ak+xch2(4)*(2*str2num(a(1))1) +xch2(2)*(2*str2num(a(2))1) + . . .
xch2(5)*(2*str2num(a(3))1) +xch2(1) * (2*str2num(a(4))1);20
yk2noise(i+1) =yk2(i+1) +gngauss(sigma);
end
if(ak==1)
gure(1);
plot(yk1, 0,x)
axis([2 2 0 1]);
holdon;
gure(2);
plot(yk1noise, 0,x)
axis([2 2 0 1]);30
holdon;
gure(3);
plot(yk2, 0,x)
axis([2 2 0 1]);
holdon;
gure(4);
plot(yk2noise, 0,x)
axis([2 2 0 1]);
432
1
1 is transmitted
0.9
-1 is transmitted
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-2-1.5-1-0.500.511.52
(a)
1 is transmitted
0.9
-1 is transmitted
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-2-1.5-1-0.500.511.52
(b)
Figure 10.4: Output of channel model 1 without and with AWGN. (a) No noise. (b) Additive Gaussian
noise with20:1
433
1
0.9
1 is transmitted
-1 is transmitted
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-2.5-2-1.5-1-0.500.511.522.5
(a)
0.9
1 is transmitted
-1 is transmitted
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3-2-10123
(b)
Figure 10.5: Output of channel model 2 without and with AWGN. (a) No noise. (b) Additive Gaussian
434
holdon;
else40
gure(1);
plot(yk1, 0,o)
axis([2 2 0 1]);
gure(2);
plot(yk1noise, 0,o)
axis([2 2 0 1]);
gure(3);
plot(yk2, 0,o)
axis([2 2 0 1]);
gure(4);50
plot(yk2noise, 0,o)
axis([2 2 0 1]);
end
end
Figure 10.6 illustrates the impulse response of the transmitter ltergTnN1,n0;1; :::; N1 for
2
1
4andN31. The corresponding frequency response characteristics are shown in Figure 10.7.
Note that the frequency response is no longer zero forjfj 1=T, because the digital lter has
nite duration. However, the sidelobes in the spectrum are relatively small. Further reduction in the
Also in Figure 10.8, we compare thejGTf j2andXr cf . Finally we repeat the rst three parts
usingN41. Figure 10.9 illustrates the impulse response of the transmitter ltergTnN1
2
forN41. The corresponding frequency response characteristics are shown in Figure 10.10. Note
Figure 10.11, we compare thejGTf j2andXr cf and in Figure 10.12, we compare the frequency
435
0.2
0.15
)
0.1
2
N1
(n
T
0.05
g
-0.05
051015202530
n2=0:N1;
% Get the frequency response characteristics.
[GT,W]=freqz(gT,1);20
% normalized magnitude response
magGTindB=20*log10(abs(GT)/max(abs(GT)));
GT2indB=20*log10(abs(GT).*abs(GT)/max(abs(GT).*abs(GT)));
forl=1:length(W),
Xrc(l) =xrc(W(l)/(2*T),alpha,T);
end;
XrcindB= 20*log10(Xrc/T);
% impulse response of the cascade of the transmitter and the receiver lters30
gR=gT;
imprespofcascade=conv(gR,gT);
% Plotting commands follow.
436
0
-10
-20
-30
2
(f )|
T
|G
-40
-50
-60
-70
00.050.10.150.20.250.30.350.40.450.5
f
frequency response characteristic is shown in Figure 10.14. Finally in Figure 10.15, we show the
impulse response of the cascade of the transmitter and receiver FIR lters. This impulse response
may be compared with the ideal impulse response obtained by samplingxtat a rateFs4=T8W.
Note that the frequency response is no longer zero forjfj Wbecause the digital lter has nite
437
0
|G(f)|
(f)
rc
-20
-40
(f )|
rc
-60
-80
(f )|vs.|X
T
|G
-100
-120
-140
00.050.10.150.20.250.30.350.40.450.5
end;
end;
echoon;
gT=real(gT) ;% The imaginary part is due to the nite machine precision
% Obtain gT(n-(N-1)/2).
n2=0:N1;20
% Obtain the frequency response characteristics.
[GT,Wf]=freqz(gT,1);
% normalized magnitude response
magGTindB=20*log10(abs(GT)/max(abs(GT)));
GT2=abs(GT).*abs(GT);
GT2indB= 20*log10(GT2/max(GT2));
form=1:length(Wf),
f=4*W*m/length(Wf);
if(f<W)
X(m) = (1/W)*cos(pi*f/(2*W));30
else
X(m)=0;
end
end;
X=X/max(abs(X));
X= 20.*log10(abs(X));
438
0.3
0.25
0.2
0.15
),N=41
2
N1
0.1
(n
T
g
0.05
-0.05
0510152025303540
439
0
-20
-40
-60
(f )|
T
|G
-80
-100
-120
00.050.10.150.20.250.30.350.40.450.5
f
440
0
N=41
-50
-100
-200
-250
00.050.10.150.20.250.30.350.40.450.5
441
0
N=31
-20
-40
-60
N=31 vs.N=41
2
(f )|
-80
T
|G
-100
-120
00.050.10.150.20.250.30.350.40.450.5
f
442
0.14
0.12
0.1
0.08
)
2
N1
0.06
(n
T
g
0.04
0.02
-0.02
051015202530
Figure 10.13: Impulse response of truncated discrete-time duobinary FIR lter at the transmitter
% impulse response of the cascade of the transmitter and the receiver lters
gR=gT;
imprespofcascade=conv(gR,gT);
% Plotting commands follow.40
443
0
-10
-20
-30
2
(f )|
T
|G
-40
-50
-60
-70
00.050.10.150.20.250.30.350.40.450.5
f
Figure 10.14: Frequency response of truncated discrete-time duobinary FIR lter at the transmitter
444
0
N=31
-20
-40
-60
-80
-100
(f )|
T
|G
-120
-140
00.050.10.150.20.250.30.350.40.450.5
445
dd(1)=0;
for i=1:length(d)
b(i+1)=a(i+1)+a(i);
dout(i+1)=rem(b(i+1)/2+1,2);
echoo;
end
echoon;
dout=dout(2:length(d)+1);
Figure 10.16 illustrates the error probability of the receiver for dierent values of20:1,20:5
and21. Inter Symbol Interference (ISI) causes degradation in the performance of the system.
0
10
with ISI
-1
10
-2
b
10
P
-3
10
-4
10
012345678910
10log12
Figure 10.16: Bit Error Probability of duobinary system using binary PAM with and without ISI
446
N=100;
noisevar=0.1;
sigma=sqrt(noisevar);% standard deviation of the noise
errors= 0;
form=1:L,
d=zeros(1,N);10
d(nd(rand(1,N)<0.5 ) )=1;
p(1)=0;
for i=1:length(d)
p(i+1)=rem(p(i)+d(i),2);
echoo;
end
echoon;
a=2.*p1;
for i=1:N,20
noise(i)=gngauss(0,sigma);% channel noise
echoo;
end;
b(1)=0;
dd(1)=0;
for i=1:length(d)
b(i+1)=a(i+1) +a(i) +noise(i);
if(b(i+1)<1)30
brec(i+1)=2;
elseif(b(i+1)<1)
brec(i+1)=0;
else
brec(i+1)=2;
end;
dout(i+1) =rem(brec(i+1)/2+1,2);
echoo;
end
40
echoon;
dout=dout(2:length(d)+1);
errors=errors+sum(abs(doutd));
end
[errors,errors/(N*L) ]
The equation
2
XnT
qmTcnxmT
n22
447
1
0.9
0.8
0.7
0.6
x
0.5
0.4
0.3
0.2
0.1
0
0510152025
n
(b)
Figure 10.17: Original pulse
element. Thus, we obtain a set of 2K1 linear equations for the coecients of the zero-forcing
coptX1q
Figure 10.17 illustrates the original pulsext. Figures 10.18, 10.19, and 10.20 present the
equalized pulse forK2,K4, andK6, respectively. We should emphasize that the FIR
zero-forcing equalizer does not completely eliminate ISI for K = 2. However, asKis increased, the
0.8
0.6
0.4
0.2
-0.2
02468101214
n
(b)
Figure 10.18: Equalized pulse forK2
449
1.4
1.2
0.8
0.6
0.4
0.2
0
02468101214
n
(b)
Figure 10.19: Equalized pulse forK4
450
1.2
0.8
0.6
0.4
0.2
-0.2
02468101214
n
(b)
Figure 10.20: Equalized pulse forK6
for i=1:2*K+1
n=K;
for j= 1:2*K+1
X(i,j) = 1/(1+(2*(m*Tn*(T/2))/T)^2);
n=n+1;
end
m=m+1;
end
q=zeros(1, 2*K+1);
q(K+1)=1;20
copt=inv(X) *q
equalizedx=lter(copt,1,[xzeros(1,K)]);% since there will be a delay of two samples at the output
% to take care of the delay
equalizedx=equalizedx(K+1:length(equalizedx));
% Now, let us downsample the equalizer output.
for i=1:2:length(equalizedx),
downsampledequalizeroutput((i+1)/2)=equalizedx(i);
end;
gure;
stem(downsampledequalizeroutput);30
end
451
Computer Problem 10.8
The error in MSE equalizer is dened as dierence betweenamand the equalized symbolzmT .
The mean square error (MSE) between the actual output symbolzmT and the desired valuesamis
MSEEjzmT amj2(10.32)
K
X2
EcnymTn(10.33)
nK
KKK
XXX
cnckRynk2ckRaykEjamj2(10.34)
nKKkK
RynkEymTnymTk(10.35)
RaykEymTka(10.36)
m
and the expectation is taken with respect to the random information sequencefamgand the additive
noise.
The MSE solution is obtained by dierentiating with respect to the equalizer coecientsfcng.
K
X
cnRynkRayk; ; k0;1;2; :::;K(10.37)
nK
or
RycRay
coptR1Ray
y
First we construct the matrixRyand vectorRay, then we determine the lter coecient using
RyXtXN0I
2
whereXis given in previous problem andIis identity matrix. The vector with elementsRaykis
given as
23
1
5
67
617
67
627
67
Ray66177
67
617
627
45
1
5
452
The equalizer coecients obtained by inverting the matrixRyand the results are as follows
23
0:0956
67
67
60:73477
67
67
coptX1q661:676177
67
607
6:73477
45
0:0956
Figure 10.21 presents the equalized pulse. Note the small amount of residual ISI in the equalized
pulse. Using a MSE linear equalizer with higher number of taps, a better equalization can be achieved.
Figures 10.22 and 10.23 illustrates the equalized pulse for linear lters withK4 andK6. Note
1.2
0.8
0.6
0.4
x(nT )withK=2
0.2
-0.2
-4-3-2-101234
453
1.2
0.8
0.6
0.4
x(nT )withK=4
0.2
-0.2
-5-4-3-2-1012345
forn=K:K,
fork=K:K,
temp=0;
for i=K:K,temp=temp+(1/(1+(ni)^2))*(1/(1+(ki)^2));end;10
XX(k+K+1,n+K+1)=temp;
echoo;
end;
end;
echoon;
Ry=XX+(N0/2)*eye(2*K+1);
% Riy
t=K:K;
Riy= (1 ./ (1+(t./T).^2)).;
20
copt=inv(Ry)*Riy;% optimal tap coecients
% nd the equalized pulse. . .
t=3:1/2:3;
x=1./(1+(2*t/T).^2);% sampled pulse
equalizedpulse=conv(x,copt);
% Decimate the pulse to get the samples at the symbol rate.
decimatedequalizedpulse=equalizedpulse(1:2:length(equalizedpulse));
% Plotting command follows.
454
1.2
0.8
0.6
0.4
x(nT )withK=6
0.2
-0.2
-6-4-20246
The bit error probability of the adaptive equalizer for various values of2versus AWGN channel
455
0
10
-1
10
-2
b
10
P
-3
10
-4
10
0246810121416
10log12
Figure 10.24: Symbol error probability of LMS adaptive equalizer for20:01,20:1 and21
for j= 1:2*K+1
X(i,j) = 1/(1+(2*(m*Tn*(T/2))/T)^2);
n=n+1;
end
m=m+1;
end
q=zeros(1, 2*K+1);
q(K+1)=1;20
copt=inv(X) *q
equalizedx=lter(copt,1,[xzeros(1,K)]);% since there will be a delay of two samples at the output
% to take care of the delay
equalizedx=equalizedx(K+1:length(equalizedx));
% Now, let us downsample the equalizer output.
for i=1:2:length(equalizedx),
downsampledequalizeroutput((i+1)/2)=equalizedx(i);
end;
gure;
stem(downsampledequalizeroutput);30
end
456
Chapter 11
Problem 11.1
The subcarrier frequencies are:Fkk=T ; k0;1; : : : ;N, and, hence, the maximum frequency in the
analog signal is:N=T. If we sample at the Nyquist rate: 2N=TN=T, we obtain the discrete-time
sequence:
N1N1
X1X
xnxtnT =N1pXkej2 knT =N=TpXkej2 kn=N; n0;10; : : : ; N1
NN
k0k0
Problem 11.2
The lter with system functionHnzhas the impulse responsehkej2 nk=N; k0;1; : : : :If we
pass the sequencefXk; k0;1; : : : ; N1gthrough such a lter, we obtain the sequenceynm,
given as
m
X
ynmXkhmk; m0;1; : : :
k0
m
X
Xkej2 nmk=N
k0
PNPN
AtmN, whereynNXkej2 nk=N1Xkej2 nk=N, sinceXN0. Therefore, the
k0k0
IDFT offXkgcan be computed by passingfXkgthrough theNltersHnzand sampling their
outputs atmN.
457
Problem 11.3
IfTis the time duration of the symbols on each subcarrier andTcis the ime duration of the channel
impulse response, then the cyclic prex (or time-guard interval) must spanTcseconds. Equivalently,
ifNis the number of signal samples in the time intervalTandmis the number of samples in the
Problem 11.4
Dene
8
<x
n;for 0nN1
yn
:0
;forNnNL1
NL1
X
X0kynej2 nk=NL;0kNL1
n0
PNPNPN
Then,X01xnandX00L1yn1xnX0
n0n0n0
To determine the relationship betweenXkandX0k, we begin by computing the Fourier
transform ofxn,
N1
X
Xfxnej2 f n
n0
The DFTfXkgis simply the sampled version ofXf at the frequenciesfkk=N, 0kN1.
0kN1.
Computer Problems
458
Computer Problem 11.1
p
From Equation (11.2.1) we haveU62=T X6. Since the channel is noise free,R6C6U6.Y6is
obtained by demodulation through correlating with signals given in Equation (11.2.4) and then
sampling at timeT. Since 1tand 2thave the channel phase in them, the correlation and
pj
sampling process is equivalent to multiplyingR6byT =2e\C6. Therefore,
pjpj
Y6R6T =2e\C6T =2e\C6C6U6ej\C6C6X6 jC6jX6
HereK10 andN20. The plot is shown below and the MATLAB script for this problem is given
next.
0
020406080100
echo on
K=10;N=2*K;T=100;
a=rand(1,36);
a=sign(a0.5);
b=reshape(a,9,4);
% Generate the 16QAM points
XXX=2*b(:,1)+b(:,2)+j*(2*b(:,3)+b(:,4));
XX=XXX;
X=[0XX0conj(XX(9:1:1))];
459
xt=zeros(1,101);10
for t=0:100
for k=0:N1
xt(1,t+1)=xt(1,t+1)+1/sqrt(N)*X(k+1)*exp(j*2*pi*k*t/T);
echo o
end
end
echo on
xn=zeros(1,N);
for n=0:N1
for k=0:N120
xn(n+1)=xn(n+1)+1/sqrt(N)*X(k+1)*exp(j*2*pi*n*k/N);
echo o
end
end
echo on
pause% press any key to see a plot of x(t)
plot([0:100],abs(xt))
% Check the dierence between xn and samples of x(t)
for n=0:N1
d(n+1)=xt(T/N*n+1)xn(1+n);30
echo o
end
echo on
e=norm(d);
Y=zeros(1,10);
for k=1:9
for n=0:N1
Y(1,k+1)=Y(1,k+1)+1/sqrt(N)*xn(n+1)*exp(j*2*pi*k*n/N);
echo o
end40
end
echo on
dd=Y(1:10)X(1:10);
ee=norm(dd);
HereN2K32 andXks are selected from a QPSK constellation, i.e.,1j. Let us assume we
thatX00. Using Equation (11.3.5) we computexnvalues using the following Matlab code
460
X=[1+j,-1+j,-1-j,1-j,1+j,1+j,-1-j,1-j,1-j,1+j,-1+j,-1-j,1-j,1-j,1+j,-1+j];
Xp=[real(X(1)),X(2:16),conj(X(16:-1:2)),imag(X(1))];
x(1:32)=0;
for n=1:32
for k=1:32
x(n)=x(n)+1/sqrt(32)Xp(k)exp(2pi(k-1)(n-1)j/32);
******
end
end
and then computeXf and plot its magnitude using the following Matlab code
f=[0:0.005:pi];
Xf=zeros(size(f));
for m=1:32
Xf=Xf+x(m)exp(-j2pi(m-1)f);
*****
end
plot(f,abs(Xf))
14
12
10
8
j
f
jX
6
f
0
0:511:522:533:5
461
Computer Problem 11.5
In this problemK10 andN20. The signal values from theN-point DFT arex0; x1; : : : ; x19. To
this sequence, we append the valuesx16; x17; x18;andx19at the front end, prior tox0. Thus, the
echo on
K=10;N=2*K;T=100;m=4;
a=rand(1,36);
a=sign(a0.5);
b=reshape(a,9,4);
% Generate the 16QAM points
XXX=2*b(:,1)+b(:,2)+1i*(2*b(:,3)+b(:,4));
XX=XXX;
X=[0XX0conj(XX(9:1:1))];10
xt=zeros(1,101);
for t=0:100
for k=0:N1
xt(1,t+1)=xt(1,t+1)+1/sqrt(N)*X(k+1)*exp(1i*2*pi*k*t/T);
echo o
end
end
echo on
xn=zeros(1,N+m);
for n=0:N120
for k=0:N1
xn(n+m+1)=xn(n+1)+1/sqrt(N)*X(k+1)*exp(1i*2*pi*n*k/N);
echo o
end
end
xn(1:m)=xn(Nm+1:N);
echo on
pause% press any key to see a plot of x(t)
plot([0:100],abs(xt))
% Check the dierence between xn and samples of x(t)30
for n=0:N1
d(n+1)=xt(T/N*n+1)xn(1+n+m);
echo o
end
echo on
e=norm(d);
Y=zeros(1,10);
for k=1:9
for n=0:N1
Y(1,k+1)=Y(1,k+1)+1/sqrt(N)*xn(n+m+1)*exp(1i*2*pi*k*n/N);40
echo o
end
end
echo on
462
dd=Y(1:10)X(1:10);
ee=norm(dd);
V f 1ffkffk$cos 2 fkt
2
p
Gf2T ej f T =2sincf T
Hence,
s
jUkf jTsincffkTsincffkT
2
The plot ofjUkf jis shown below. Note the large spectral overlap of the main lobes of each
jUkf j. Also note that the rst sidelobe in the spectrum is only 13 dB down from the main lobe.
Therefore, there is a signicant amount of spectral overlap among the signals transmitted on dierent
subcarriers. Nevertheless, these signals are orthogonal when transmitted synchronously in time.
20
-20
-40
-60
-80
(f)| (dB)
k
|U
-100
-120
-140
-160
-180
00.511.522.533.54
f
T= 1;
k= 0 : 5;
fk=k/T;
f=4/T: 0.01*4/T: 4/T;
Ukabs=zeros(length(k),length(f));
for i= 1 :length(k)
Ukabs(i,:) =abs(sqrt(T/2)*(sinc((ffk(i))*T) +sinc((f+fk(i))*T)));
end
463
plot(f,Ukabs(1,:),.-,f,Ukabs(2,:),--,f,Ukabs(3,:),c-,f,Ukabs(4,:),.,f,Ukabs(5,:),f,Ukabs(6,:))10
xlabel(f)
ylabel(|U_k(f)|)
1199X2
Pavx
200n
n0
Ppeakmaxfx2g
nn
10
6
PAR
0
2468101214161820
Realization
T= 1;
Fs= 200;
t= 0 : 1/(Fs*T) :T1/(Fs*T);
K= 32;
k= 1 :K1;
rlz= 20;% No. of realizations
PAR=zeros(1,rlz);% Initialization for speed
for j= 1 :rlz
theta=pi*oor(rand(1,length(k))/0.25)/2;10
x=zeros(1,Fs);% Initialization for speed
echo o;
for i= 1 :Fs
464
for l= 1 :K1
x(i) =x(i) +cos(2*pi*l*t(i)/T+theta(l));
end
end
echo on;
% Calculation of the PAR:
Ppeak=max(x.^2);20
Pav=sum(x.^2)/Fs;
PAR(j) =Ppeak/Pav;
end
% Plotting the results:
stem(PAR)
axis([1 20min(PAR)max(PAR)])
xlabel(Realization)
ylabel(PAR)
20
18
16
14
12
10
8
Distortion (D)
0
2468101214161820
Realization
T= 1;
Fs= 200;
465
t= 0 : 1/(Fs*T) :T1/(Fs*T);
K= 32;
k= 1 :K1;
rlz= 20;% No. of realizations
% Initialization for speed:
PAR=zeros(1,rlz);
PARdB=zeros(1,rlz);10
D=zeros(1,rlz);
echo o;
for j= 1 :rlz
theta=pi*oor(rand(1,length(k))/0.25)/2;
x=zeros(1,Fs);% Initialization for speed
for i= 1 :Fs
for l= 1 :K1
x(i) =x(i) +cos(2*pi*l*t(i)/T+theta(l));
end
end20
xh=x;
% Calculation of the PAR:
[Ppeak idx] =max(x.^2);
Pav=sum(x.^2)/Fs;
PAR(j) =Ppeak/Pav;
PARdB(j) = 10*log10(PAR(j));
% Clipping the peak:
if Ppeak/Pav>1.9953
while Ppeak/Pav>1.9953
xh(idx) =sqrt(10^0.3*Pav);30
[Ppeak idx] =max(xh.^2);
Pav=sum(xh.^2)/Fs;
PARdB(j) = 10*log10(Ppeak/Pav);
end
end
D(j) =sum((xxh).^2)/Fs;% Distortion
end
echo on;
% Plotting the results:
stem(D)40
axis([1 20min(D)max(D)])
xlabel(Realization)
ylabel(Distortion (D))
466
9
8.5
7.5
7
PAR
6.5
5.5
5
5101520
Realization
The MATLAB script for the problem is given below.
T= 1;
Fs= 200;
t= 0 : 1/(Fs*T) :T1/(Fs*T);
K= 32;
k= 1 :K1;
rlz= 20;% No. of realizations
PAR=zeros(1,rlz);% Initialization for speed
echo o;
for j= 1 :rlz10
theta=pi*oor(rand(1,length(k))/0.25)/2;
phi= 2*pi*rand(4,length(k));
PARphi=zeros(1,size(phi,1));% Initialization for speed
for m= 1 :size(phi,1)
x=zeros(1,Fs);% Initialization for speed
for i= 1 :Fs
for l= 1 :K1
x(i) =x(i) +cos(2*pi*l*t(i)/T+theta(l)+phi(m,l));
end
end20
% Calculation of the PAR:
Ppeak=max(x.^2);
Pav=sum(x.^2)/Fs;
PARphi(m) =Ppeak/Pav;
end
[PAR(j)idxtheta]=min(PARphi);
end
echo on;
467
% Plotting the results:
stem(PAR)30
axis([1 20min(PAR)max(PAR)])
xlabel(Realization)
ylabel(PAR)
468
Chapter 12
Problem 12.1
6
X
HXpilogpi 0:1 log0:10:2 log0:2
222
i1
0:3 log0:30:05 log0:050:15 log0:150:2 log0:2
2222
2:4087 bits/symbol
6
X1
HuXpilogpi loglog62:5850 bits/symbol
222
i16
As it is observed the entropy of the source is less than that of a uniformly distributed source.
Problem 12.2
NN
XX1
HXpilogpilog1
22
i1i1NN
11
N
NNlog2Nlog2
Problem 12.3
XX1
HXpilogpipilog
iipi
By denition the probabilitiespisatisfy 0< pi1 so that11 andlog10. It turns out that
pipi
each term under summation is positive and thusHX0. IfXis deterministic, thenpk1 for
X
HXpilogpi pklog 1 pk00
i
Note thatlimx!xlogx0 so if we allow source symbols with probability zero, they contribute
0
nothing in the entropy.
469
Problem 12.4
1)
1
X
HXp1pk1logp1pk1
2
k1
11
XX
plogp1pk1plog1pk11pk1
22
k1k1
plogp1plog1p1p
22
11p11p2
logp1plog1p
22
p
k1
pXkjX > KpXk; X > Kp1p
pX > KpX > K
But,
01
11K
XXX
pX > Kp1pk1p@1pk11pk1A
kK1k1k1
!
K
p111p1pK
11p11p
so that
k1
pXkjX > Kp1p
1pK
If we letkKlwithl1;2; : : :, then
Kl1
pXkjX > Kp1p1pp1pl1
1pK
that ispXkjX > Kis the geometrically distributed. Hence, using the results of the rst part we
obtain
1
X
HXjX > Kp1pl1logp1pl1
2
l1
logp1plog1p
22
p
470
Problem 12.5
HgXHXjgX
HXHgXHXjgX
HXHgX
Equality holds whenHXjgX0. This means that the valuesgXuniquely determineX, or that
Problem 12.6
6
X
HXpilogpi2:4087 bits/symbol
2
i1
fs20002600014000 Hz
This means that 14000 samples are taken per each second. Hence, the entropy of the source in bits
HX2:408714000bits/symbolsymbols/sec33721:8 bits/second
Problem 12.7
df x1
dx1x>0
Thus, the function is monotonically increasing. Since,f 10, the latter implies that ifx >1 then,
df x1
dx1x<0
which means that the function is monotonically decreasing. Hence, forx <1,f x > f 10 or
lnx < x1. Therefore, for everyx >0,
lnxx1
471
with equality ifx0. Applying the inequality withx1=N, we obtain
pi
1=N
ln1lnpi1
Npi
NNN
X1XX1
pilnpilnpipi0
i1Ni1i1N
Hence,
NN
X1X
HXpilnlnNpilnN
i1Ni1
But,lnNis the entropy (in nats/symbol) of the source when it is uniformly distributed (see Problem
12.2). Hence, for equiprobable symbols the entropy of the source achieves its maximum.
Problem 12.8
1
X
iqim
i1
i1
Letvi111and apply the inequality lnxx1 (see Problem 12.7) tovi. Then,
qimm
"i#i
11
11
ln111lnqi11
mmqimm
1"i1#111
X1XX1X
qiln11qilnqi11i1qi0
i1mmi1i1mmi1
But,
1"i1#1
X1X1
qiln11qilni1ln11
i1mmi1mm
1
X
ln1ln11i1qi
mm
i1
23
11
XX
ln1ln114iqiqi5
mm
i1i1
ln1ln11m1 Hp
mm
whereHpis the entropy of the geometric distribution (see Problem 12.4). Hence,
1
X
Hpqilnqi0=)HqHp
i1
472
Problem 12.9
1)
2)After quantization, the new alphabet isB f4;0;4gand the corresponding symbol probabilities
are given by
p4p5p3:05:1:15
p0p1p0p1:1:15:05:3
p4p3p5:25:3:55
Problem 12.10
HlimHXnjX1; : : : Xn1
n!1
limHX1; X2; : : : ; XnHX1; X2; : : : ; Xn1
n!1
where the last equality follows from the fact thatX1; : : : ; Xnare identically distributed.
Hlim1HX1; X2; : : : ; Xn
n!1
n
n
X
lim1HXi
n!1
n
i1
lim1nHXHX
n!1
n
The second line of the previous relation follows from the independence ofX1,X2,: : : Xn, whereas
the third line from the fact that for a DMS the random variablesX1; : : : Xnare identically distributed
independent ofn.
473
Problem 12.11
HlimHXnjX1; : : : ; Xn1
n!1
23
X
lim4px1; : : : ; xnlogpxnjx1; : : : ; xn15
n!12
x1;:::;xn
23
X
lim4px1; : : : ; xnlogpxnjxn15
n!12
x1;:::;xn
23
X
lim4pxn; xn1logpxnjxn15
n!12
xn;xn1
limHXnjXn1
n!1
HlimHXnjXn1HXnjXn1
n!1
Problem 12.12
XX
HXjYpx; ylogpxjypxjypylogpxjy
x;yx;y
!
XXX
pypxjylogpxjypyHXjYy
yxy
Problem 12.13
P
1)The marginal distributionpxis given bypxpx; y. Hence,
y
X XX
HXpxlogpxpx; ylogpx
xxy
X
px; ylogpx
x;y
P
Similarly it is proved thatHYpx; ylogpy.
x;y
2)Using the inequality lnww1 (see Problem 12.7) withwpxpy, we obtain
px;y
lnpxpypxpy1
px; ypx; y
474
Hence,
XX
HX; Ypx; ylnpxpypx; ylnpxlnpy
x;yx;y
XX
Problem 12.14
Also, from Problem 12.15,HX; Y HXHY . Combining the two relations, we obtain
Suppose now that the previous relation holds with equality. Then,
X XXp
pxlogpxjypxlogpx)pxlogx0
xxxpxjy
px >0, the above equality holds if and only iflogpx=pxjy0 or equivalently if and only if
Problem 12.15
Therefore,
n
X
HXiHX1; X2; Xn
i1
!
XX Xp
; x2; ; xn
px1; x2; ; xnlogx1Qn
x1x2xni1pixi
Qn!
XX Xi
pixi
px1; x2; ; xn11
x1x2xnpx1; x2; ; xn
XX XXX X
px1; x2; ; xnp1x1p2x2 pnxn
x1x2xnx1x2xn
110
475
where we have used the inequalitylnx11. This inequality is obtained by substitutingy1=x
x
into lnyy1 (see Problem 12.7). Hence,
n
X
HX1; X2; XnHXi
i1
Qn
with equality ifpixipx1; ; xn, i.e. a memoryless source.
i1
Problem 12.16
n
pX10; X20; ; Xn0pX10pX20 pXn01
2
n
pX11; X21; ; Xn1pX11pX21 pXn11
2
3)
1k1nk1n
222
5)In case thatpXi1p, the answers of the previous questions change as follows
prstkones;nextnkzerospk1pnk
01
n
Ck
pkonesB@Ap1pnk
k
476
Problem 12.17
From the discussion in the beginning of Section 12.2 it follows that the total number of sequences
of lengthnof a binary DMS source producing the symbols 0 and 1 with probabilitypand 1p
respectively is 2nHp. Thus ifp0:3, we will observe sequences havingnp3000 zeros and
Another approach to the problem is via the Stirlings approximation. In general the number of binary
01
nn!
BC
@A
kk!nk!
pnn
n!2 n
e
Hence,
Problem 12.18
X
HXpilogpi1:4855
2
i
Hence,
# typical sequences21485:5
2)The number of all sequences of lengthnisNn, whereNis the size of the source alphabet. Hence,
# typical sequences2nHX
1:1451030
# non-typical sequencesNn2nHX
pXx;xtypical2nHX21485:5
4)Since the number of the total sequences is 2nHXthe number of bits required to represent these
sequences isnHX1486.
477
5)The most probable sequence is the one with alla3s that isfa3; a3; : : : ; a3g. The probability of this
sequence is
n1000
pfa3; a3; : : : ; a3g11
22
6)The most probable sequence of the previous question is not a typical sequence. In general in a
Problem 12.19
4
X
HXpailogpai1:8464 bits/output
2
i1
2)The average codeword length is lower bounded by the entropy of the source for error free
3)The following gure depicts the Human coding scheme of the source. The average codeword
length is
RX3:2:12:3:41:9
00.4
10.3
0
.6
11001.2
1.3
1111.1
4)For the second extension of the source the alphabet of the source becomesA2 fa1; a1; a1; a2; : : : a4; a4g
and the probability of each pair is the product of the probabilities of each component, i.e.pa1; a2
:2. A Human code for this source is depicted in the next gure. The average codeword length in
RX3:494:325:166:033:7300
2
The average codeword length in bits per each source output isR1XR2X=21:865.
5)Human coding of the original source requires 1.9 bits per source output letter whereas Human
coding of the second extension of the source requires 1.865 bits per source output letter and thus it
is more ecient.
478
; a4.16
0000a4
0010a4; a3.12
0
; a4.12
0100a3
0110a3; a3.09
0
00010a4; a2.08
1
; a4.08
110011a2
; a2.06
00110a3
0
; a3.06
01010a2
11
1110a4; a1.04
01
01110a2; a2.04
1
01111a1; a4.04
1
; a1.03
110110a3
1
10111a1; a3.03
011110a2; a1.02
01111110a1; a2.02
1
1111111a1; a1.01
Problem 12.20
The following gure shows the design of the Human code. Note that at each step of the algorithm
the branches with the lowest probabilities (that merge together) are those at the bottom of the tree.
479
01
02
101
04
1
..
1
..
..
0
11...101
02n2
111...1011
02n1
111...1111
12n1
The entropy of the source is
n1
X1
1
HXlog2ilog2n1
i2n12
i122
n1
X1
1
iilog22n1n1log22
i122
n1
Xi
n1
in1
i122
In the way that the code is constructed, the rst codeword (0) has length one, the second codeword
(10) has length two and so on until the last two codewords (111...10, 111...11) which have length
n1
in1
RXpxlxX
1
x2Xi12i2n
211=2n1HX
Problem 12.21
The following gure shows the position of the codewords (black lled circles) in a binary tree.
Although the prex condition is not violated the code is not optimum in the sense that it uses
more bits that is necessary. For example the upper two codewords in the tree (0001, 0011) can be
substituted by the codewords (000, 001) (un-lled circles) reducing in this way the average codeword
length. Similarly codewords 1111 and 1110 can be substituted by codewords 111 and 110.
480
0
6
?
1
Problem 12.22
00.22
100.18
1111.50.17
122.15
200.13
2112.28.1
222.05
RXXpxlx:222:18:17:15:13:10:05
x
1:78ternary symbols/output
For a fair comparison of the average codeword length with the entropy of the source, we compute
X
HXpxlogpx1:7047
3
x
As it is expectedHXRX.
481
Problem 12.23
IfDis the size of the code alphabet, then the Human coding scheme takesDsource outputs and it
merges them to 1 symbol. Hence, we have a decrease of output symbols byD1. InKsteps of the
algorithm the decrease of the source outputs isKD1. If the number of the source outputs is
KD1D, for someK, then we are in a good position since we will be left withDsymbols for
which we assign the symbols 0;1; : : : ; D1. To meet the above condition with a ternary code the
number of the source outputs should be 2K3. In our case that the number of source outputs is six
we can add a dummy symbol with zero probability so that 7223. The following gure shows
.40
0
.171
1
.1520
0
.1321
1
.122002
.052211
2
.02202
Problem 12.24
3 0.4 00 0.4
-3 0
1
00.35
0 101
1
0.6
-1 1
0 10.25
0.13
1 10
10.05
2
1
results in
R0:4130:20:150:1240:0850:030:022:38
P7
2.HXpilogpi2:327 bits andHX0:977
i12
R
482
3. We have
8
>>>P
X 20:20:080:28
<
P X00:120:150:030:3
>>>
:P
X20:020:40:42
5.In general for the second extension we haveHXR < HX1and therefore 2:327
2
R <2:827. But in this case since the second extension will not perform worse than the rst
extension, the upper bound is theRwe derived in part 1. Therefore, the tightest bounds are
2:327R2:38.
Problem 12.25
1.
0
0
x3;1
2
010
x6;1
4
10110
x2;11
82
x4;11101110
16
4
x1;111011110
328
1111111
x5;1
3216
1
Since the average codeword length is already equal to the entropy no improvement is possible
3.No, in general entropy is the lower limit for the average codeword length and no improvement
483
Problem 12.26
1.
Since the entropy exceeds 2, lossless encoding of this source at 2 bits per symbol is impossible.
4.The process of merging should be done such that the entropy of the resulting sources (with
an alphabet of size 4) is less than 1.5 bits per symbol. To minimize the entropy by combining
two letters we have to combine the two letters that have the maximum contribution to the
entropy. These area4anda4with probabilities of 0.3 and 0.35, respectively. Combining these
two results in a single letterbwith probability of 0.65. The entropy of the resulting source
would be
Since the entropy is less than 1.5, it is possible to transmit this source at a rate of 1.5 bits per
symbol.
Problem 12.27
P
1.The minimum rate is equal to the entropy of the source, given byHXpilogpi, and
i2
this is given by
484
0.25
00a5
0.2
0a4
0.58
0
0.18
a
00102
0.42
1
0.11
0
1a1
0.22
0
0.33
111
a
17
1
0.10
0110a
3
0.15
0.05
0111a
6
RXpl
ii
i
0:2520:220:1830:1130:1130:140:054
Problem 12.28
Parsing the sequence by the rules of the Lempel-Ziv coding scheme we obtain the phrases
0, 00, 1, 001, 000, 0001, 10, 00010, 0000, 0010, 00000, 101, 00001,
The number of the phrases is 19. For each phrase we need 5 bits plus an extra bit to represent the
485
DictionaryDictionaryCodeword
LocationContents
1 00001000000 0
2 000100000001 0
3 00011100000 1
4 0010000100010 1
5 0010100000010 0
6 00110000100101 1
7 001111000011 0
8 010000001000110 0
9 01001000000101 0
10 01010001000100 0
11 010110000001001 0
12 0110010100111 1
13 011010000101001 1
14 0111000000001011 0
15 011111100011 1
16 100000100001 1
17 10001000000001110 0
18 1001011001111 0
19000000
Problem 12.29
IX;Y HXHXjY
XX
pxlogpxpx; ylogpxjy
xx;y
XX
px; ylogpxpx; ylogpxjy
x;yx;y
XpXp
px; ylogxjypx; ylogx; y
x;ypxx;ypxpy
486
this inequality withxpx;ywe obtain
pxpy
Xp
IX;Ypx; ylogx; y
x;ypxpy
!
XpXX
px; y1xpypx; ypxpy0
x;ypx; yx;yx;y
Problem 12.30
inequalities, we obtain
IX;Y minfHX; HY g
2)It can be shown (see Problem 12.7), that ifXandZare two random variables over the same set
the size of the setX(see Problem 6.2). Hence,HXlogjXjand similarly we can prove that
HY logjYj. Using the result of the rst part of the problem, we obtain
Problem 12.31
HY HYjXIY;X
Problem 12.32
pY0; X1pY0jX1pX11p
pY1; X111p
pY0; X01p
487
The marginal distribution ofYis
pY1p11p12pp
pY01p1pp2p
Hence,
HX plogp1plog1p
22
HY 12pplog12pp
2
p2plogp2p
2
X
HYjXpx; ylogpyjx plog1plog
222
x;y
11plog11plog1
22
log1log1
22
HX; Y HXHYjX
plogp1plog1plog1log1
2222
HXjY HX; Y HY
plogp1plog1plog1log1
2222
12pplog12pp
2
p2plogp2p
2
log1log1
22
12pplog12pp
2
p2plogp2p
2
2)The mutual information isIX;Y HY HYjX. As it was shown in the rst question
q12pp, that is
HY HbqHb12pp
Hbqachieves its maximum value, which is one, forq1. Thus,
2
12pp1=)p1
22
3)SinceIX;Y 0, the minimum value ofIX;Y is zero and it is obtained for independentXand
Y. In this case
pY1; X0pY1pX0=)p12ppp
488
or1. This value of epsilon also satises
2
pY0; X0pY0pX0
pY1; X1pY1pX1
pY0; X1pY0pX1
resulting in independentXandY.
Problem 12.33
HY HZjY HWjY Z
HYjXHZjXY HWjXY Z
HY HYjXHZjY HZjY X
HWjY ZHWjXY Z
IX;Y IZjY;XIWjZY;X
This result can be interpreted as follows: The information that the triplet of random variables
(Y ; Z; W) gives about the random variableXis equal to the information thatYgives aboutXplus the
information thatZgives aboutX, whenYis already known, plus the information thatWprovides
Problem 12.34
1)Using Bayes rule, we obtainpx; y; zpzpxjzpyjx; z. Comparing this form with the one
given in the rst part of the problem we conclude thatpyjx; zpyjx. This implies thatYand
IY;ZXIY;ZIY;XjZ
IY;XIY;ZjXIY;X
SinceIY;Z0, we have
IY;XjZIY;X
2)Comparingpx; y; zpxpyjxpzjx; ywith the given form ofpx; y; zwe observe that
IY;ZXIY;ZIY;XjZ
IY;XIY;ZjXIY;ZjX
489
Since in generalIY;XjZ0, we have
IY;ZIY;ZjX
3)For the rst case consider three random variablesX,YandZ, taking the values 0, 1 with equal
IY;XHY HYjX101. Hence,IY;XjZ < IX;Y . For the second case consider
two independent random variablesX,Y, taking the values 0, 1 with equal probability and a random
Problem 12.35
HYjXpXaHYjXapXbHYjXbpXcHYjXc
However,
X
HYjXapYkjXalogP YkjXa
k
0:2 log 0:20:3 log 0:30:5 log 0:5
HYjXbHYjXc1:4855
and therefore,
X
HYjXpXkHYjXk1:4855
k
Thus,
IX;Y HY 1:4855
input distribution. Using the symmetry of the channel, we observe that a uniform input distribution
490
Problem 12.36
8
><p
X0
pX
>:1
p X1
then,
HYjXpHYjX01pHYjX1
ph1phh
entropyHY we reduce rst the number of possible outputs as follows. LetVbe a function of the
output dened as
8
><1
YE
V
>:0
otherwise
HY ; V HY HVjY HY
HV HYjV
HYjV pV0HYjV0pV1HYjV1
X
HYjV0pYkjV0logpYkjV0
2
k0;1
CmaxHV HYjV h
px
maxHYjV max1hp1
pxpx
491
and it is achieved forp1. The next gure shows the capacity of the channel as a function of.
2
C
1
10
Problem 12.37
The overall channel is a binary symmetric channel with crossover probabilityp. To ndpnote that
and therefore,
C1hp
ClimCn1h10
n!1
2
Problem 12.38
ppp
Denoting1, we haven!2 nnnen,n!2 nnnen, andn!2 nnnen
!
nn!
nn!n!
p
2 nnnen
pp
2 nnnen2 nnnen
1
p
2 nnn
From above
!
1n 1
2 nloglog
nlog2n2nlog222
! loglogasn! 1
22
Hb
492
Problem 12.39
Due to the symmetry in channel, the capacity is achieved for uniform input distribution, i.e., for
pXApX A1. For this input distribution, the output distribution is given by
2
22122
py1peyA=2peyA=2
22 222 2
and the mutual information between the input and the output is
Z1
IX;Y 1pyjXAlogpyjXAdy
212py
1
1ZpyjX A
pyjX Alogdy
212py
11
2I12I2
where
Z1
I1pyjXAlogpyjXAdy
12py
Z1
I2pyjX AlogpyjX Ady
12py
Now consider the rst term in the above expression. Substituting forpyjXAandpy, we
obtain,
A2
Z11py22
2e
1yA 2
I1pe22log2dy
22
12 221yA1yA
p22p22
ee
2 22 2
Z1
2
1y=A=2
pe2logdy
12 221e2yA=2
using the change of variableuy=and denotingA=byawe obtain
Z1
1ua22
I1pe2logdu
1221e2ua
A similar approach can be applied toI2, the second term in the expression forIX;Y , resulting in
IX;Y 1fA1fA
22
where
Z1
22
f a1peua=2logdu
1221e2au
493
Problem 12.40
However,
XX
HYjXpxHYjXxpxHRHR
xx
whereHRis the entropy of a source with symbols having probabilities the elements of a row of the
probability transition matrix. The last equality in the previous equation follows from the fact that
HRis the same for each row since the channel is symmetric. Thus
CmaxHY HR
px
HY is maximized whenYis a uniform random variable. With a symmetric channel we can always
nd an input distribution that makesYuniformly distributed, and thus maximizeHY . To see this,
let
X
pYypxP YyjXx
x
X
pYy1P YyjXx
jXj
x
P
ButP YyjXxis the same for eachysince the columns of a symmetric channel are
x
permutations of each other. Thus,
ClogjYj HR
Problem 12.41
C1maxHY HYjX
px
b)Letqbe the probability of the input symbol 0, and thus1qthe probability of the input symbol
1. Then,
X
HYjXpxHYjXx
x
qHYjX01qHYjX1
1qHYjX11qh0:51q
494
The probability mass function of the output symbols is
P YcqpYcjX01qpYcjX1
q1q0:50:50:5q
pYd1q0:50:50:5q
Hence,
C2maxh0:50:5q1q
q
To nd the probabilityqthat achieves the maximum, we set the derivative ofC2with respect toq
equal to 0. Thus,
"#
@C20:51
0:50:5q0:50:5q
@q010:5 log20:50:5qln 2
"#
0:5 log0:50:5q0:50:5q0:51
2
0:50:5qln 2
Therefore,
3
log0:50:5q 2=
2)q
0:50:5q5
C2h120:3219
55
1
Q1Q1Q2
22
have assumed that the output space of both channels has been augmented by adding two new
symbols so that the size of the matricesQ,Q1andQ2is the same. The transition probabilities to
these newly added output symbols is equal to zero. Now we show that in general, the capacity of
a channel is a convex function of the probability transition of the channel, in other words for any
495
probability isQi. To show this we have (note that1)
Ip;Q1Q2Ip;Q1Ip;Q2
XXp
yjxp2yjx
pxp1yjxp2yjxlog1P
xyxpxp1yjxp2yjx
XXp
yjx
pxp1yjxlog1P
xyxpxp1yjx
XXp
yjx
pxp2yjxlog2P
xyxpxp2yjx
"P#
XXp
yjxp2yjxpxp1yjx
pxp1yjxlog1Px
xyxpxp1yjxp2yjxp1yjx
"P#
XXp
yjxp2yjxpxp2yjx
pxp2yjxlog1Px
xyxpxp1yjxp2yjxp2yjx
"P#
XXp
yjxp2yjxpxp1yjx
pxp1yjx1Px1
xyxpxp1yjxp2yjxp1yjx
"P#
XXp
yjxp2yjxpxp2yjx
pxp2yjx1Px1
xyxpxp1yjxp2yjxp2yjx
PX
Xx
pxp1yjxp1yjxp2yjx
Ppxp1yjx
yxpxp1yjxp2yjxxp1yjx
XX
pxp1yjx
xy
PX
Xx
pxp2yjxp1yjxp2yjx
Ppxp2yjx
yxpxp1yjxp2yjxxp2yjx
X
Xp
xp2yjx
xy
0
CminfmaxHY ;maxHXg
However, the maximum ofHXis attained whenXis uniformly distributed, in which case
496
we obtain
minflogM;logNg
Problem 12.43
1)Letqbe the probability of the input symbol 0, and therefore1qthe probability of the input
symbol 1. Then,
X
HYjXpxHYjXx
x
qHYjX01qHYjX1
1qHYjX11qh
pY0qpY0jX01qpY0jX1
q1q11q
pY11qq
Hence,
Cmaxhq1qh
q
To nd the probabilityqthat achieves the maximum, we set the derivative ofCwith respect toq
equal to 0. Thus,
@C
qlog1q
@q0hlog22
Therefore,
h
logq h=)q21
2h
1q
12
and therefore
limCh00
!0
497
If0:5, thenh1 andCh120:3219. In this case the probability of the input symbol
55
0 is
h
q210:50:250:513
h
120:510:255
3)The following gure shows the topology of the cascade channels. If we start at the input labelled
0, then the output will be 0. If however we transmit a 1, then the output will be zero with probability
pY0jX11121
112
n
111n
1
111
00
111
...
11
Problem 12.44
CAminflogM;logNg
22
whereM,Nis the size of the output and input alphabet respectively. SinceM2<3N, we
pa0pb00:5;
achieved when interpretingB0andC0as a single output. Therefore, the capacity of the cascade
channel isCAB1.
Problem 12.45
The SNR is
SNR2PP10104
N02W2W109106
498
Thus the capacity of the channel is
CWlog1P106log11000013:2879106bits/sec
22
N0W
Problem 12.46
C1log1P
2N0W
For the nonwhite Gaussian noise channel, although the noise power is equal to the noise power in
the white Gaussian noise channel, the capacity is higher, The reason is that since noise samples are
correlated, knowledge of the previous noise samples provides partial information on the future noise
Problem 12.47
entropyHYjXis given by
X
HYjXpxHYjXx12pHYjXA2pHYjXB
02ph0:52p
X
pY1pxpY1jXx12pp1p
X
pY2pxpY2jXx0:5p0:5pp
Therefore,
CmaxHY HYjXmaxhp2p
pp
To nd the optimum value ofpthat maximizesIX;Y , we set the derivative ofCwith respect top
equal to zero. Thus,
@C11
pplog1p1p2
@p0 log2pln221pln2
log1plogp2
22
499
and therefore
log1p2=)1p4=)p1
2
pp5
Ch120:72190:40:3219 bits/transmission
55
Problem 12.48
CmaxIX1X2;Y1Y2
px1;x2
However,
IX1X2;Y1Y2HY1Y2HY1Y2jX1X2
HY1Y2HY1jX1HY2jX2
HY1HY2HY1jX1HY2jX2
IX1;Y1IX2;Y2
and therefore,
CmaxIX1X2;Y1Y2maxIX1;Y1IX2;Y2
px1;x2px1;x2
maxIX1;Y1maxIX2;Y2
px1px2
C1C2
The upper bound is achievable by choosing the input joint probability densitypx1; x2, in such a
way that
px1; x2px1px2
wherepx1,px2are the input distributions that achieve the capacity of the rst and second
channel respectively.
Problem 12.49
the values 1;2 depending on the indexiofX. Note thatMis a function ofXorY. This is because
500
X\ Xand therefore, knowingXwe know the channel used for transmission. The capacity of
12
the sum channel is
maxHY HY1jX11HY2jX2
px
wherepM1. Also,
HY HY ; MHMHYjM
HHY11HY2
CmaxIX;Y
px
maxHHY11HY2HY1jX11HY2jX2
px
maxHIX1;Y11IX2;Y2
px
CmaxHC11C2
To nd the value ofthat maximizesC, we set the derivative ofCwith respect toequal to zero.
Hence,
dC2C1
log1C1C2=)
d0 log222C12C2
Substituting this value ofin the expression forC, we obtain
!!
C1C1C1
CH22C112C2
2C12C22C12C22C12C2
!!!
2C12C12C12C1
log1log
22
2C12C22C12C22C12C22C12C2
!
2C12C1
C11C2
2C12C22C12C2
2C12C2
log2C12C2log2C12C2
22
2C12C22C12C2
log2C12C2
2
Hence
Clog2C12C2=)2C2C12C2
2
501
2)
2C20202=)C1
Thus, the capacity of the sum channel is nonzero although the component channels have zero
capacity. In this case the information is transmitted through the process of selecting a channel.
3)The channel can be considered as the sum of two channels. The rst channel has capacity
Clog2C12C2log21
22
Problem 12.50
HXh0:30:8813
C1h0:110:4690:531
If the source is directly connected to the channel, then the probability of error at the destination is
P errorpX0pY1jX0pX1pY0jX1
0:30:10:70:10:1
obtain
Computer Problems
502
3) The entropy of the source is given as
9
X
HXpilogpi3:0371 bits per source output
i1
The MATLAB function entropy.m given next calculates the entropy of a probability vectorp.
function h=entropy(p)
% H=ENTROPY(P) returns the entropy function of
% the probability vector p.
if length(nd(p<0))=0,
error(Not a prob. vector, negative component(s))
end
if abs(sum(p)1)>10e10,
error(Not a prob. vector, components do not add up to 1)
end
h=sum(p.*log2(p));10
1) The entropy of the source is derived via the entropy.m function and is found to be 2.3549 bits per
source symbol.
Codewords
x10:20000
x20:15100100
x30:130:420110110
x40:120:32Prob. = 101010010
0:22
0:5801
x30:11011011
0:26
x60:091110101010
0:17
101
x70:0810111011
x80:0711101110
0:13
111
x90:0611111111
for a discrete-memoryless source with probability vectorpand returns both the codewords and the
function[h,l]=human(p);
%HUFFMAN Human code generator
% [h,l]=human(p), Human code generator
% returns h the Human code matrix, and l the
% average codeword length for a source with
% probability vector p.
if length(nd(p<0))=0,
error(Not a prob. vector, negative component(s))
end10
if abs(sum(p)1)>10e10,
error(Not a prob. vector, components do not add up to 1)
end
n=length(p);
q=p;
m=zeros(n1,n);
for i=1:n1
[q,l]=sort(q);
m(i,:)=[l(1:ni+1),zeros(1,i1)];
q=[q(1)+q(2),q(3:n),1];20
end
for i=1:n1
c(i,:)=blanks(n*n);
end
c(n1,n)=0;
c(n1,2*n)=1;
for i=2:n1
c(ni,1:n1)=c(ni+1,n*(nd(m(ni+1,:)==1)). . .
(n2):n*(nd(m(ni+1,:)==1)));
c(ni,n)=0;30
c(ni,n+1:2*n1)=c(ni,1:n1);
c(ni,2*n)=1;
for j=1:i1
c(ni,(j+1)*n+1:(j+2)*n)=c(ni+1,. . .
n*(nd(m(ni+1,:)==j+1)1)+1:n*nd(m(ni+1,:)==j+1));
end
end
for i=1:n
h(i,1:n)=c(1,n*(nd(m(1,:)==i)1)+1:nd(m(1,:)==i)*n);
l1(i)=length(nd(abs(h(i,:))=32));40
end
l=sum(p.*l1);
Using this function, the codewords are found to be 010, 11, 0110, 0111, 00, and 10.
3) The average codeword length for this code is found to be 2.38 binary symbols per source
2:3549
10:9895
2:38
504
4) A new source whose outputs are letter pairs of the original source has 36 output letters of the
formfxi; xjg6. Since the source is memoryless, the probability of each pair is the product of
i;j1
the individual letter probabilities. Thus, in order to obtain the probability vector for the extended
source, we must generate a vector with 36 components, each component being the product of two
probabilities in the original probability vectorp. This can be done by employing the MATLAB function
1110000, 01110, 10110111, 1011001, 111001, 00101, 01111, 000, 011010, 00111, 1001, 1100,
11101110, 011011, 111011110, 111011111, 1110001, 001000, 1011010, 01100, 10110110, 1011000,
101110, 111110, 111010, 1010, 1110110, 101111, 11110, 0100, 00110, 1101, 001001, 111111, 0101,
1000
The average codeword length for the extended source is 4.7420. The entropy of the extended source
4:7097
20:9932
4:7420
which shows an improvement compared to the eciency of the Human code designed in part 2.
1) We use the human.m function to determine a Human code. The resulting codewords are 1, 01,
001, 0001, 00001, 000001, 0000001, 00000000, and 00000001. The gure below presents the code
tree.
505
1
1/2
1
01
1/4
1/2
001
0
1/8
1/4
0001
1/16
00
1/8
00001
1/32
1/16
000001
1/64
1/32
0000001
1/64
00000001
1/256
1/128
1/256
2) The average codeword length is found to be 1.9922 binary symbols per source output by using
human.m function. If we nd the entropy of the source using the entropy.m function, we see that
the entropy of the source is also 1.9922 bits per source output; hence the eciency of this code is 1.
3) For the eciency of the Human code to be equal to one, the source must have a diadic distribution,
1) The entropy is found to be 3.7179 using the Matlab function entropy.m introduced in Computer
Problem 12.1.
2) We design a Human code using the Matlab function human.m. that was presented in Computer
Problem 12.2. This function generates the resulting code words 1011, 100000, 00000, 10100,
010, 110011, 100001, 0001, 0111, 11000000111 11000001, 10101, 110010, 0110, 1001, 100010,
1100000010, 0010, 0011, 1101, 00001, 1100001, 110001, 110000000, 100011, 11000000110, 111.
3) The average code word is found to be 4.1195. In this case eciency of the code is
3:7179
4:11950:9025
506
The MATLAB script for this problem follows.
q
pQ2 (12.38)
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
-20 -10 0 10 20
(dB)
507
2. Here we use the relation
C1Hbp
q
1HbQ2 (12.39)
1
C(bits/transmission)
0.8
0.6
0.4
0.2
-20-1001020
(dB)
echo on
gammadb=[20:0.1:20];
gamma=10.^(gammadb./10);
perror=q(sqrt(2.*gamma));
capacity=1.entropy2(perror);
pause% Press a key to see a plot of error probability vs. SNR/bit.
clf
semilogx(gamma,perror)
xlabel(SNR/bit)
title(Error probability versus SNR/bit)10
ylabel(Error Prob.)
pause% Press a key to see a plot of channel capacity vs. SNR/bit.
clf
semilogx(gamma,capacity)
xlabel(SNR/bit)
title(Channel capacity versus SNR/bit)
ylabel(Channel capacity)
508
Computer Problem 12.6
Due to the symmetry in the problem, the capacity is achieved for uniform input distributionthat is,
forpXApX A1. For this input distribution, the output distribution is given by
2
22122
py1peyA=2peyA=2(12.40)
22 222 2
and the mutual information between the input and the output is given by
Z1
IX;Y 1pyjXAlogpyjXAdy
212py
1
1ZpyjX A
pyjX Alogdy(12.41)
212py
IX;Y fA(12.42)
whereZ1
22
f a1peua=2logdu(12.43)
1221e2au
Using these relations we can calculateIX;Y for various values ofA=and plot the result. A plot
1
C(bits/transmission)
0.8
0.6
0.4
0.2
0
-2-1012
1010101010
A/
echo on
adb=[20:0.2:20];
a=10.^(adb/10);
for i=1:201
509
f(i)=quad(il3_8fun,a(i)5,a(i)+5,1e3,[ ],a(i));
g(i)=quad(il3_8fun,a(i)5,a(i)+5,1e3,[ ],a(i));
c(i)=0.5*f(i)+0.5*g(i);
echo o;
end
echo on;10
semilogx(a,c)
xlabel(SNR)
ylabel(Capacity (bits/transmission))
1400
1200
1000
800
600
Capacity (bits/second)
400
200
0
-2-10123
101010101010
P/N (dB)
0
510
500
450
400
350
300
250
200
Capacity (bits/second)
150
100
50
0
012345
101010101010
W (Hz)
As is seen in the plots, when eitherP =N0orWtend to zero, the capacity of the channel also tends
to zero. However, whenP =N0orWtends to innity, the capacity behaves dierently. WhenP =N0
tends to innity, the capacity also tends to innity, as shown in the rst gure. However, whenW
tends to innity, the capacity does go to a certain limit, which is determined byP =N0. To determine
limWlog1PP(12.44)
W!12N0WN0ln 2
1:4427P(12.45)
N0
511
ylabel(Capacity (bits/second))
10
5
C/W
0
-50510152025
10 logE/N0
10b
512
Chapter 13
Problem 13.1
c10 0 0 0 0
c21 0 1 0 0
c30 1 1 1 1
c41 1 0 1 1
Since the code is linear the minimum distance of the code is equal to the minimum weight of the
codewords. Thus,
dminwmin2
There is only one codeword with weight equal to 2 and this isc2.
Problem 13.2
c10 0 0 0 0
c21 0 1 0 0
c30 1 1 1 1
c41 1 0 1 1
Any of the previous codewords when postmultiplied byHtproduces an all-zero vector of length 3.
For example
c2Ht11 0 00 0 0
c4Ht11 11 110 0 0
513
Problem 13.3
The following table lists all the codewords of the (7,4) Hamming code along with their weight. Since
the Hamming codes are lineardminwmin. As it is observed from the table the minimum weight is
3 and thereforedmin3.
No.CodewordsWeight
100000000
210001103
301000113
400101013
500011114
611001014
710100114
810010013
901101104
1001011003
1100110103
1211100003
1311010104
1410111004
1501110014
1611111117
Problem 13.4
The parity check matrixHof the (15,11) Hamming code consists of all binary sequences of length 4,
except the all zero sequence. The systematic form of the matrixHis
01
B C 1
1 1 0 0 0 1 1 1 0 11 0 0 0C
B
BC
BC
BC
BC
B 1 0 0 1 1 0 1 1 0 1 10 1 0 0C
C
C
HPtjIBBC
4BBC
0
B C
1 0 1 0 1 1 0 1 1 10 0 1 0C
B
BC
BC
BC
@A
0 0 1 0 1 1 0 1 1 1 10 0 0 1
514
The corresponding generator matrix is
01
11 1 0 0
BC
BC
B1C
1010
BC
BC
B1C
01 0 0 1C
B
BC
BC
B10 1 1 0C
BC
BC
B10 1 0 1C
BC
BC
GIjPBB10 0 1 1CC
11
BC
B1C
B1 1 1 0C
BC
BC
B11 1 0 1C
BC
BC
B0C
11 0 1 1
BC
BC
B1C
0 1 1 1C
B
@A
11 1 1 1
Problem 13.5
LetCbe ann; klinear block code with parity check matrixH. We can express the parity check
Hhh h
12n
cHt0c1h1c2h2 cnhn
cihicihi cihi
1122ll
hihi hi0
12l
This proves thatlcolumn vectors of the matrixHare linear dependent. Since for a linear code the
Now we assume that the minimum number of column vectors of the matrixHthat are linear
dependent isdminand we will prove that the minimum weight of the code isdmin. Lethi,hi,: : :,
12
hdbe a set of linear dependent column vectors. If we form a vectorcwith non-zero components
min
at positionsi1,i2,: : :,id, then
min
cHtcihi ci0
11d
min
which implies thatcis a codeword with weightdmin. Therefore, the minimum distance of a code is
equal to the minimum number of columns of its parity check matrix that are linear dependent.
515
For a Hamming code the columns of the matrixHare non-zero and distinct. Thus, no two
columnshi,hjadd to zero and sinceHconsists of all thenktuples as its columns, the sum
hihjhm0
Problem 13.6
codeword. Thus,
G1j1 1
This generator matrix is already in systematic form, so that the parity check matrix is given by
01
11 0 0
BC
BC
B10 1 0C
HBBB.CCC
.......
B....C
@A
10 0 1
Problem 13.7
1)The parity check matrixHeof the extended code is ann1kn1matrix. The codewords
cecjx
;ii
wherexis 0 if the weight ofciis even and 1 if the weight ofciis odd. SinceceHtcijxHt0
;iee
andciHt0, the rstnkcolumns ofHtcan be selected as the columns ofHtwith a zero added
e
in the last row. In this way the choice ofxis immaterial. The last column ofHtis selected in such
e
a way that the even-parity condition is satised for every codewordce. Note that ifcehas even
;i;i
weight, then
for everyi. Therefore the last column ofHtis the all-one vector and the parity check matrix of the
e
516
extended code has the form
01t
1101
BC
BC
B1C
011
BC01
BC
B0C1
1 1 1CB 1 0 1 0 0 0
BC
BCBC
BCBC
1 0 0 1CB1 0 1 0 1 0 0
tBBCC
HeHtBBCC
eBC
B0 1 0 1CB0 1 1 0 0 1 0
C
BC@A
BC
B0C1
011111111
BC
BC
BC
BC
@A
0001
2)The original code has minimum distance equal to 3. But for those codewords with weight equal to
the minimum distance, a 1 is appended at the end of the codewords to produce even parity. Thus,
the minimum weight of the extended code is 4 and since the extended code is linear, the minimum
distance isde;minwe;min4.
GdeRc431:7143
coding;min
7
Problem 13.8
pbQ2EbQP
N0RN0
where
P106
5
RN010421011
Thus,
p
pbQ51:2682102
P11pb110:1310
error in 11 bits
where
EEP11
sb
RcRc53:6667
N0N0RN015
517
Thus
hpi
pe10Q33:66674:560103
As it is observed the probability of error decreases by a factor of 28. If hard decision is employed,
then
01
dmin
XBd
minCi
peM1@Ap1pbdmini
ib
idmin1
2
hqi
whereM10,dmin3 andpbQRcP2:777102. Hence,
RN0
pe103p21pbp30:0227
bb
Problem 13.9
k=1
.n=3
+
2)The state transition diagram for this code is depicted in the next gure.
.............0/000
........ .
00
0/0111/111
0/001
0110
1/100
0/0101/110
1
..................... 1
1/101
3)In the next gure we draw two frames of the trellis associated with the code. Solid lines indicate
518
..000
..00
..111
..
011
......
....01100
..
....
..
....
....001
..
......
..10110
..
..
..
..
..010
..
.. . . . . . .. . . . . . ..
11
101
4)The diagram used to nd the transfer function is shown in the next gure.
Xd
D2NJ
DJ
D2JDJD3NJ
XcXbXaXa
DNJ
XcD3NJXa0DNJXb
XbDJXcDJXd
XdD2NJXcD2NJXd
Xa00D2JXb
EliminatingXb,XcandXdresults in
D6NJ3
00
T D; N; JXa
Xa01D2NJD2NJ2
To nd the free distance of the code we setNJ1 in the transfer function, so that
6
T1DT D; N; JjDD62D84D10
NJ1
12D2
Hence,d6
free
5)Since there is no self loop corresponding to an input equal to 1 such that the output is the all zero
Problem 13.10
The number of branches leaving each state correspond to the number possible dierent inputs to the
encoder. Since the encoder at each state takeskbinary symbols at its input, the number of branches
leaving each state of the trellis is 2k. The number of branches entering each state is the number of
possiblekLcontents of the encoder shift register that have their rstkL1bits corresponding to
that particular state (note that the destination state for a branch is determined by the contents of
the rstkL1bits of the shift register). This means that the number of branches is equal to the
number of possible dierent contents of the lastkbits of the encoder, i.e., 2k.
519
Problem 13.11
1.
00
10
1/0101/101
0000
11000/0001/0010/1111/110
0/100
01
2.
DD
22
3
aDDD
abc
D2
XbD2XaD2Xc
XcD3XbDXd
XdDXdDXb
Xa0D2Xc
520
3. ExpandingT Dwe have
T DD62D7D8: : :
Thereforedfree6.
4.
Received
sequence110 110 110 111 010 101 101
00024 5 5 3 5 7000000 000 000 000 000
??
101 101 101101 101
??
011 011 011 011 011
53343
110 110 110
435 4
100 100 100 100?
010 010010 010
From this gure we see that there are many options, one is the sequence 0101000, in which the
two last bits are the additional two zeros to reset the memory. Therefore (one of the) most
likely transmitted sequences is 01010. Other options are 10101 and 11000. All these sequences
result in codewords that are at a Hamming distance of 7 from the received sequence.
1@T2D; N
Pbp
k@NN1;D4p1p
But herep105is very small, therefore the dominating term in the expansion on the right
side of the inequality will be the rst term in expansion ofT2D; Ncorresponding todfree.
This term inT2D; NisD6N, since the path with weight 6 at the output corresponds to the
1@D6N13
Pb4105110521014
k@Np3
N1;D4p1p
Problem 13.12
1.
521
00
10
1/0101/111
0000
11000/0001/0010/1011/100
0/1100/011
01
2.
ND
D2ND
322
D
aNDD
abc
ND
XbND3XaNDXc
XcD2XbD2Xd
XdNDXdNDXb
Xa0D2Xc
T2N; DND7N2D8N3D9: : :
and thereforedfree7. This path corresponds to the sequence 100. The path is highlighted
below
522
000000000
101
Received
sequence111 111 111 111 111 111
00036 2 4 5 4000000 000 000 000
332
110 110 110
010 010010
001 001
245
We see that the best matching path through the trellis is the highlighted path corresponding to
Problem 13.13
The code of Problem 13.11 is a3;1convolutional code withL3. The length of the received
sequenceyis 15. This means that 5 symbols have been transmitted, and since we assume that the
information sequence has been padded by two 0s, the actual length of the information sequence is
3. The following gure depicts 5 frames of the trellis used by the Viterbi decoder. The numbers on
the nodes denote the metric (Hamming distance) of the survivor paths. In the case of a tie of two
Problem 13.14
+
k=1
n=3
+
.............0/000
........ .
00
0/0111/111
0/101
0110
1/100
0/1101/010
1
..................... 1
1/001
3)In the next gure we draw two frames of the trellis associated with the code. Solid lines indicate
524
..000
..00
..111
..
011
......
....01100
..
....
..
....
....101
..
......
..10010
..
..
..
..
..110
..
.. . . . . . .. . . . . . ..
11
001
4)The diagram used to nd the transfer function is shown in the next gure.
Xd
DNJ
D2J
D2JD2JD3NJ
XcXbXaXa
DNJ
XcD3NJXa0DNJXb
XbD2JXcD2JXd
XdDNJXcDNJXd
Xa00D2JXb
EliminatingXb,XcandXdresults in
D7NJ3
00
T D; N; JXa
Xa01DNJD3NJ2
To nd the free distance of the code we setNJ1 in the transfer function, so that
7
T1DT D; N; JjDD7D8D9
NJ1
1DD3
Hence,d7
free
5)Since there is no self loop corresponding to an input equal to 1 such that the output is the all zero
Problem 13.15
Using the diagram of Figure 13.13, we see that there are only two ways to go from stateXa0to
stateXa00with a total number of ones (sum of the exponents ofD) equal to 6. The corresponding
transitions are:
D2DDD2
Path 1:Xa0!Xc!Xd!Xb!Xa00
D2DDD2
Path 2:Xa0!Xc!Xb!Xc!Xb!Xa00
525
These two paths correspond to the codewords
c10;0;1;0;1;0;1;1;0;0;0;0; : : :
c20;0;0;1;0;0;0;1;1;1;0;0; : : :
Problem 13.16
1)The state transition diagram and the ow diagram used to nd the transfer function for this code
.............0/00
........ .
00
0/101/01
0/01DNJ
0110X
d
1/11NJ2
DJ
0/111/00
1 DJDJDNJ
..................... 1XcXXaXa
b
1/10D2NJ
Thus,
XcDNJXa0D2NJXb
XbDJXcD2JXd
XdNJXcDNJXd
Xa00DJXb
D3NJ3
00
T D; N; JXa
Xa01DNJD3NJ2
To nd the transfer function of the code in the formT D; N, we setJ1 inT D; N; J. Hence,
3
T D; NDN
1DND3N
2)To nd the free distance of the code we setN1 in the transfer functionT D; N, so that
3
T1DT D; NjDD3D4D52D6
N1
1DD3
Hence,d3
free
3)An upper bound on the bit error probability, when hard decision decoding is used, is given by
P1@T D; N
bp
k@NN1;D4p1p
526
Since
@T D; N@D3ND3
@NN1@N1DD3NN11DD32
withk1,p106we obtain
3
PD8:0321109
bp
1DD32D4p1p
Problem 13.17
1)Let the decoding rule be that the rst codeword is decoded whenyiis received if
Given that the rst codeword is sent, then the probability of error is
XX
P errorjx1pyijx1pyijx111yi
yi2YY1yi2Y
!2
Xp1X
yijx2q
pyijx1pyijx1pyijx2
yi2Ypyijx1yi2Y
2nq
X
pyijx1pyijx2
i1
whereYdenotes the set of all possible sequencesyi. Since, each element of the vectoryican take
2nq2ns
XXpsp
yijx1yijx2
P errorpyijx1pyijx2pyi
i1i1pyipyi
2ns2nq
XpspX
x1jyix2jyi
pyi2pyipx1jyipx2jyi
i1px1px2i1
However, given the vectoryi, the probability of error depends only on those values thatx1andx2
are dierent. In other words, ifx1x2, then no matter what value is thekthelement ofyi, it will
;k;k
not produce an error. Thus, if bydwe denote the Hamming distance betweenx1andx2, then
px1jyipx2jyipd1pd
527
and sincepyi1n, we obtain
2
ddd
P errorP d2p21p24p1p2
3)Assuming codewordcis sent, letd1; d2; : : : ; dM1denote its Hamming distance from other
M1
dd
Xi
min
P Errorjc4p1p2M14p1p2
i1
where in the last step we have used the fact that since 0p1, then 4p1p1, and
di
forx1 the functionxpis a decreasing function ofp. Therefore sincedminwe have
22
dd
imin
4p1p24p1p2.
Problem 13.18
1)
Z1
v2
Qx1pe2dv
2x
pZ1
v2t1t2
pedt
x
p
2
1
12Zt2
edt
2xp
2
1x
p
2erfc2
s#1
1"Xq
P1Xaf dQ2RdEb1af dQ2Rd
bdcdcb
kN0k
ddfreeddfree
q
11X
f derfcRcd b
2kad
ddfree
q
11X
f ddfreeerfcRcddfree b
2kaddfree
d1
1
X
1qR
dfree badf ddfreeecd b
2kerfcRcdfree
d1
But,
11
XX
T D; NadDdNf dadDddfreeNf ddfree
dfree
ddfreed1
528
and therefore,
@T D; N1Xd
adDdfreef ddfree
@NN1dfree
d1
1
X
DdfreeadDdf ddfree
dfree
d1
SettingDeRc bin the previous and substituting in the expression for the average bit error
probability, we obtain
q#
T D; N
P1erfcRd eRcdfree b
bcfreeb
2k#NN1;DeRc b
Problem 13.19
1.For the Hamming codedmind13 and for the second code simple inspection shows
3.For Hamming code we use the result of Example 13.2.4 and for the6;2code use the given
4.The Hamming code can correct all single errors and the other code, with minimum distance of
4 can also correct all single errors. For three errors, if they are on dierent rows and columns,
they can obviously been corrected. If all three are in a single row, then in each column we do
not have more than one error, and the errors can all be corrected, similarly for the case when
all errors are in a single column. If two errors are in a row and two errors are in a column, like
1111111
1 1X1X1 1
1111111
0000000
0 0 0 0X0 0
1111111
529
then we can rst correct the single error in the fth row, and then the single errors in the
columns. A four error pattern shown below cannot be corrected by applying hard decision to
the rows and columns separately (but can be corrected by applying the optimal hard decision
1111111
1 1X1X1 1
1111111
0000000
0 0X0X0 0
1111111
Problem 13.20
have
maxfx; yg lnex1eyx
lnexln1ejyxj
maxfx; yg ln1ejyxj
and the result is proved, fory > xwe can similarly show the result.
maxfx; y; zg lnexeyez
lnewez
maxfw; zg
maxfmaxfx; yg; zg
Problem 13.21
The partition of the 8-PAM constellation in four subsets is depicted in the gure below.
530
1 3 5 7-1-3-5-7
10
1 5-3-773-1-5
110
0
3-57-15-3-7 1
2)The next gure shows one frame of the trellis used to decode the received sequence. Each branch
consists of two transitions which correspond to elements in the same coset in the nal partition
level.
-7,1
-5,3
-5,3
-
7,1
-3,5
-1,7
-1,7
-3,5
The operation of the Viterbi algorithm for the decoding of the sequencef:2;1:1;6;4;3;4:8;3:3g
is shown schematically in the next gure. It has been assumed that we start at the all zero state and
that a sequence of zeros terminates the input bit stream in order to clear the encoder. The numbers
at the nodes indicate the minimum Euclidean distance, and the branches have been marked with the
decoded transmitted symbol. The paths that have been purged are marked with an X.
1.13.3-4.8-346-.2
14.3811.0915.457.0526.451.451.44
XXXX111
X
-533
33
X3-511.0515.0510.455.0510.24
X-515
X5
-3
11.0511.456.0525.45
4.295
XX1-17-1
XX1
7.057.056.054.65
X-35
Transmitted sequence:
1 3 5 3 -5 -3 3
531
Computer Problems
n
Xn!
pe0:3k0:7nk
kn1=2k
and the resulting plot is shown below. The MATLAB script le for this problem is given next.
echo on
ep=0.3;
for i=1:2:61
p(i)=0;
for j=(i+1)/2:i
p(i)=p(i)+prod(1:i)/(prod(1:j)*prod(1:(ij)))*ep^j*(1ep)^(ij);
echo o;
end
end
echo on;10
pause% Press a key to see the plot.
stem((3:2:41),p(3:2:41))
xlabel(n)
ylabel(pe)
title(Error probability as a function of n in simple repetition code)
0.25
0.2
0.15
pe
0.1
0.05
0
051015202530354045
n
532
Computer Problem 13.2
In order to obtain all codewords, we have to use all information sequences of length 4 and nd the
corresponding encoded sequences. Since there is a total of 16 binary sequences of length 4, there
will be 16 codewords. LetUdenote a 2kkmatrix whose rows are all possible binary sequences of
lengthk, starting from the all-0 sequence and ending with the all-1 sequence. The rows are chosen in
such a way that the decimal representation of each row is smaller than the decimal representation of
all rows below it. For the case ofk4, the matrixUis given by
23
0000
67
67
607
001
67
67
607
6 0 1 07
67
67
60 0 1 17
67
67
607
100
67
67
607
1 0 17
6
67
67
60 1 1 07
67
67
607
111
7
U667(13.46)
617
0 0 07
6
67
67
61 0 0 17
67
67
617
010
67
67
617
0 1 17
6
67
67
61 1 0 07
67
67
61 1 0 17
67
67
617
1 1 07
6
45
1111
We have
CUG(13.47)
whereCis the matrix of codewords, which in this case is a 1610 matrix whose rows are the
533
codewords. The matrix of codewords is given by
23
0000
67
67
607
001
67
67
607
6 0 1 07
67
67
60 0 1 17
67
67
607
100
67
67
607
1 0 17
6
6723
67
60 1 1 071 0 0 1 1 1 0 1 1 1
6767
6767
607617
111110001110
767
C66767
617607
0 0 076 1 1 0 1 1 0 1 0 17
6
6745
67
61 0 0 171 1 0 1 1 1 1 0 0 1
67
67
617
010
67
67
617
0 1 17
6
67
67
61 1 0 07
67
67
61 1 0 17
67
67
617
1 1 07
6
45
3
1 1 1 12
0000000000
67
67
617
101111001
67
67
607
6 1 1 0 1 1 0 1 0 17
67
67
61 0 1 1 0 0 1 1 0 07
67
67
617
110001110
67
67
607
0 1 1 1 1 0 1 1 17
6
67
67
61 0 0 0 1 1 1 0 1 17
67
67
607
101000010
67
67
617
0 0 1 1 1 0 1 1 17
6
67
67
60 1 0 0 0 0 1 1 1 07
67
67
617
111000010
67
67
607
0 1 0 1 1 1 0 1 17
6
67
67
60 1 1 1 1 1 1 0 0 17
67
67
61 0 1 0 0 0 0 0 0 07
67
67
607
0 0 1 0 0 1 1 0 07
6
45
1100110101
A close inspection of the codewords shows that the minimum distance of the code is
534
dmin2:
k=4;
for i=1:2^k
for j=k:1:1
if rem(i1,2^(j+k+1))>=2^(j+k)
u(i,j)=1;
else
u(i,j)=0;
end
echo o;10
end
end
echo on;
g=[1 0 0 1 1 1 0 1 1 1;
1 1 1 0 0 0 1 1 1 0;
0 1 1 0 1 1 0 1 0 1;
1 1 0 1 1 1 1 0 0 1];
% Generate codewords.
c=rem(u*g,2);20
wmin=min(sum((c(2:2^k,:))));
Here
23
100110101111000
67
67
617
10001110110100
7
H667(13.48)
607
1 1 1 0 0 1 1 1 0 1 0 0 1 07
6
45
001011011110001
535
and, therefore,
23
100000000001100
67
67
607
10000000000110
67
67
607
0 1 0 0 0 0 0 0 0 0 0 0 1 17
6
67
67
60 0 0 1 0 0 0 0 0 0 0 1 0 1 07
67
67
60 0 0 0 1 0 0 0 0 0 0 1 0 0 17
67
67
G660 0 0 0 0 1 0 0 0 0 0 0 1 0 177(13.49)
67
607
6 0 0 0 0 0 1 0 0 0 0 1 1 1 07
67
67
60 0 0 0 0 0 0 1 0 0 0 0 1 1 17
67
67
607
00000001001011
67
67
607
0 0 0 0 0 0 0 0 1 0 1 1 0 17
6
45
000000000011111
There is a total of 2112048 codewords, each of length 15. The rate of the code is110:733.
15
In order to verify the minimum distance of the code, we use a MATLAB script similar to the one used
in Computer Problem 13.2. The MATLAB script is given next, and it results indmin3.
echo on
k=11;
for i=1:2^k
for j=k:1:1
if rem(i1,2^(j+k+1))>=2^(j+k)
u(i,j)=1;
else
u(i,j)=0;
end
echo o ;10
end
end
echo on ;
g=[1 0 0 0 0 0 0 0 0 0 0 1 1 0 0;
0 1 0 0 0 0 0 0 0 0 0 0 1 1 0;
0 0 1 0 0 0 0 0 0 0 0 0 0 1 1;
0 0 0 1 0 0 0 0 0 0 0 1 0 1 0;
0 0 0 0 1 0 0 0 0 0 0 1 0 0 1;
0 0 0 0 0 1 0 0 0 0 0 0 1 0 1;20
0 0 0 0 0 0 1 0 0 0 0 1 1 1 0;
0 0 0 0 0 0 0 1 0 0 0 0 1 1 1;
0 0 0 0 0 0 0 0 1 0 0 1 0 1 1;
0 0 0 0 0 0 0 0 0 1 0 1 1 0 1;
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1];
c=rem(u*g,2);
wmin=min(sum((c(2:2^k,:))));
536
30
=2
pe21114p1pdmin
s! s!!#1
" :5
20474Q1:466Eb1Q1:466Eb(13.50)
N0N0
The MATLAB function for computing the bound on message-error probability of a linear block
code when hard-decision decoding and antipodal signaling are employed is given next.
function[perr,gammadb]=pehda(gammadbl,gammadbh,k,n,dmin)
% pehda.m Matlab function for computing error probability in
% hard-decision decoding of a linear block code
% when antipodal signaling is used.
% [perr,gammadb]=pehda(gammadbl,gammadbh,k,n,dmin)
% gammadbl=lower Eb/N0
% gammadbh=higher Eb/N0
% k=number of information bits in the code
% n=code block length
% dmin=minimum distance of the code10
gammadb=[gammadbl:(gammadbhgammadbl)/20:gammadbh];
gammab=10.^(gammadb/10);
537
Rc=k/n;
pb=q(sqrt(2.*Rc.*gammab));
perr=(2^k1).*(4*pb.*(1pb)).^(dmin/2);
In the MATLAB script given next, the preceding MATLAB function is employed to plot error
probability versus b.
[perrha,gammab]=pehda(10,16,11,15,3);
semilogy(gammab,perrha)
Pe2047Q22Eb(13.51)
5N0
0
10
-5
10
e
P
-10
10
-15
10
-20
10
78910111213141516
(dB)
b
Two MATLAB functions for computing the error probability for antipodal signaling when soft-
function[perr,gammadb]=pesda(gammadbl,gammadbh,k,n,dmin)
% pesda.m Matlab function for computing error probability in
% soft-decision decoding of a linear block code
% when antipodal signaling is used.
% [perr,gammadb]=pesda(gammadbl,gammadbh,k,n,dmin)
% gammadbl=lower Eb/N0
% gammadbh=higher Eb/N0
538
% k=number of information bits in the code
% n=code block length
% dmin=minimum distance of the code10
gammadb=[gammadbl:(gammadbhgammadbl)/20:gammadbh];
gammab=10.^(gammadb/10);
Rc=k/n;
perr=(2^k1).*q(sqrt(2.*dmin.*Rc.*gammab));
In the MATLAB script given next, the preceding MATLAB function is employed to plot error
probability versus b.
[perrha,gammab]=pesda(7,13,11,15,3);
semilogy(gammab,perrha)
Here, the length of the information sequence is 17, which is not a multiple ofk02; therefore, extra
zero-padding will be done. In this case it is sucient to add one 0, which gives a length of 18. Thus,
100111001100001110
18
241336
The zero-padding required to make sure that the encoder starts from the all-0 state and returns to
the all-0 state addsL1k00s to the beginning and end of the input sequence. Therefore, the
000000100111001100001110000000
000001101111101011100110100100111111
The MATLAB script and the function cnv_encd.m to solve this problem is given next.
k0= 2;
g= [0 0 1 0 1 0 0 1; 0 0 0 0 0 0 0 1; 1 0 0 0 0 0 0 1];
539
input= [1 0 0 1 1 1 0 0 1 1 0 0 0 0 1 1 1];
output=cnvencd(g,k0,input)
function output=cnvencd(g,k0,input)
% cnvencd(g,k0,input)
% determines the output sequence of a binary convolutional encoder
% g is the generator matrix of the convolutional code
% with n0 rows and l*k0 columns. Its rows are g1,g2,. . .,gn.
% k0 is the number of bits entering the encoder at each clock cycle.
% input the binary input seq.
The code is a2;1code withL3. The length of the received sequenceyis 14. This means that
m7, and we have to draw a trellis of depth 7. Also note that since the input information sequence
is padded withk0L12 0s, for the nal two stages of the trellis we will draw only the branches
corresponding to all-0 inputs. This also means that the actual length of the input sequence is 5,
which, after padding with two 0s, has increased to 7. The trellis diagram for this case is shown
below.
540
Received
01 10 11 11 01 00 01
1232334
000000 00 00 00 00
a
1111111111
111111 11 11
32334
b
?
00 00 00
?
?
01
0101 0101
?
2233
10 10 10
10
10101010
?
d
?
01 01 01
1233
The parsed received sequenceyis also shown in this gure. Note that in drawing the trellis in
the last two stages, we have considered only the 0 inputs to the encoder (notice that in the nal two
stages, there exist no dashed lines corresponding to 1 inputs). Now the metric of the initial all-0
state is set to 0 and the metrics of the next stage are computed. In this step there is only one branch
entering each state; therefore, there is no comparison, and the metrics (which are the Hamming
distances between that part of the received sequence and the branches of the trellis) are added to the
metric of the previous state. In the next stage there exists no comparison either. In the fourth stage,
for the rst time we have two branches entering each state. This means that a comparison has to be
made here, and survivors are to be chosen. From the two branches that enter each state, one that
corresponds to the least total accumulated metric remains as a survivor, and the other branches are
deleted (marked by a small circle on the trellis). If at any stage two paths result in the same metric,
each one of them can be a survivor. Such cases have been marked by a question mark in the trellis
diagram. The procedure is continued to the nal all-0 state of the trellis; then, starting from that
state we move along the surviving paths to the initial all-0 state. This path, which is denoted by a
heavy path through the trellis, is the optimal path. The input-bit sequence corresponding to this path
is 1100000, where the last two 0s are not information bits but were added to return the encoder to
the all-0 state. Therefore, the information sequence is 11000. The corresponding codeword for the
selected path is 11101011000000, which is at Hamming distance 4 from the received sequence. All
other paths through the trellis correspond to codewords that are at greater Hamming distance from
For soft-decision decoding a similar procedure is followed, with squared Euclidean distances
The MATLAB function viterbi.m given next employs the Viterbi algorithm to decode a channel
output. This algorithm can be used for both soft-decision and hard-decision decoding of convolutional
codes. The separate le metric.m denes the metric used in the decoding process. For hard-decision
decoding this metric is the Hamming distance, and for soft-decision decoding it is the Euclidean
distance. For cases where the channel output is quantized, the metric is usually the negative of the
function[decoderoutput,survivorstate,cumulatedmetric]=viterbi(G,k,channeloutput)
%VITERBI The Viterbi decoder for convolutional codes
541
% [decoderoutput,survivorstate,cumulatedmetric]=viterbi(G,k,channeloutput)
% G is a n x Lk matrix each row of which
% determines the connections from the shift register to the
% n-th output of the code, k/n is the rate of the code.
% survivorstate is a matrix showing the optimal path through
% the trellis. The metric is given in a separate function metric(x,y)
% and can be specied to accommodate hard and soft decision.
% This algorithm minimizes the metric rather than maximizing10
% the likelihood.
n=size(G,1);
% check the sizes
if rem(size(G,2),k) =0
error(Size of G and k do not agree)
end
if rem(size(channeloutput,2),n) =0
error(channel output not of the right size)
end20
L=size(G,2)/k;
numberofstates=2^((L1)*k);
% Generate state transition matrix, output matrix, and input matrix.
for j=0:numberofstates1
for l=0:2^k1
[nextstate,memorycontents]=nxtstat(j,l,L,k);
input(j+1,nextstate+1)=l;
branchoutput=rem(memorycontents*G,2);
nextstate(j+1,l+1)=nextstate;
output(j+1,l+1)=bin2deci(branchoutput);30
end
end
statemetric=zeros(numberofstates,2);
depthoftrellis=length(channeloutput)/n;
channeloutputmatrix=reshape(channeloutput,n,depthoftrellis);
survivorstate=zeros(numberofstates,depthoftrellis+1);
% Start decoding of non-tail channel outputs.
for i=1:depthoftrellisL+1
ag=zeros(1,numberofstates);
if i<=L40
step=2^((Li)*k);
else
step=1;
end
for j=0:step:numberofstates1
for l=0:2^k1
branchmetric=0;
binaryoutput=deci2bin(output(j+1,l+1),n);
for ll=1:n
branchmetric=branchmetric+metric(channeloutputmatrix(ll,i),binaryoutput(ll));50
end
if((statemetric(nextstate(j+1,l+1)+1,2)>statemetric(j+1,1). . .
+branchmetric)jag(nextstate(j+1,l+1)+1)==0)
statemetric(nextstate(j+1,l+1)+1,2) =statemetric(j+1,1)+branchmetric;
survivorstate(nextstate(j+1,l+1)+1,i+1)=j;
ag(nextstate(j+1,l+1)+1)=1;
542
end
end
end
statemetric=statemetric(:,2:1:1);60
end
% Start decoding of the tail channel outputs.
for i=depthoftrellisL+2:depthoftrellis
ag=zeros(1,numberofstates);
laststop=numberofstates/(2^((idepthoftrellis+L2)*k));
for j=0:laststop1
branchmetric=0;
binaryoutput=deci2bin(output(j+1,1),n);
for ll=1:n
branchmetric=branchmetric+metric(channeloutputmatrix(ll,i),binaryoutput(ll));70
end
if((statemetric(nextstate(j+1,1)+1,2)>statemetric(j+1,1). . .
+branchmetric)jag(nextstate(j+1,1)+1)==0)
statemetric(nextstate(j+1,1)+1,2) =statemetric(j+1,1)+branchmetric;
survivorstate(nextstate(j+1,1)+1,i+1)=j;
ag(nextstate(j+1,1)+1)=1;
end
end
statemetric=statemetric(:,2:1:1);
end80
% Generate the decoder output from the optimal path.
statesequence=zeros(1,depthoftrellis+1);
statesequence(1,depthoftrellis)=survivorstate(1,depthoftrellis+1);
for i=1:depthoftrellis
statesequence(1,depthoftrellisi+1)=survivorstate((statesequence(1,depthoftrellis+2i). . .
+1),depthoftrellisi+2);
end
decodederoutputmatrix=zeros(k,depthoftrellisL+1);
for i=1:depthoftrellisL+1
decoutputdeci=input(statesequence(1,i)+1,statesequence(1,i+1)+1);90
decoutputbin=deci2bin(decoutputdeci,k);
decoderoutputmatrix(:,i)=decoutputbin(k:1:1);
end
decoderoutput=reshape(decoderoutputmatrix,1,k*(depthoftrellisL+1));
cumulatedmetric=statemetric(1,1);
function distance=metric(x,y)
if x==y
distance=0;
else
distance=1;
end
function[nextstate,memorycontents]=nxtstat(currentstate,input,L,k)
binarystate=deci2bin(currentstate,k*(L1));
binaryinput=deci2bin(input,k);
nextstatebinary=[binaryinput,binarystate(1:(L2)*k)];
543
nextstate=bin2deci(nextstatebinary);
memorycontents=[binaryinput,binarystate];
function y=bin2deci(x)
l=length(x);
y=(l1:1:0);
y=2.^y;
y=x*y;
function y=deci2bin(x,l)
y=zeros(1,l);
i= 1;
while x>=0 &i<=l
y(i)=rem(x,2);
x=(xy(i))/2;
i=i+1;
end
y=y(l:1:1);
c20 1 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0
function[csys,cpc]=RSCC57Encoder(u);
% RSCC57Encoder Encoder for 5/7 RSCC
% [csys,cpc]=RSCC57Encoder(u)
% returns csys the systematic bits and
% cpc, the parity check bits of the code
% when input is u and the encoder is
% initiated at 0-state.
u= [0 1 1 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1];
L=length(u);
l= 1;10
% Initializing the values of the shift register:
r1= 0;
r2= 0;
r3= 0;
while l<=L
ut=u(l);
% Generating the systematic bits:
c1(l) =ut;
% Updating the values of the shift register:
r1t=mod(mod(r3+r2,2) +ut,2);20
544
r3=r2;
r2=r1;
r1=r1t;
% Generating the parity check bits:
c2(l) =mod(r1+r3,2);
l=l+ 1;
end
ccys=c1;
cpc=c2;
function alpha=forwardrecursion(gamma);
% FORWARDRECURSION computing alpha for 5/7 RSCC
% alpha=forwardrecursion(gamma);
% returns alpha in the form of a matrix.
% gamma is a 16XN matrix of gammai(sigma(i-1),sigmi)
545
Computer Problem 13.10
function beta=backwardrecursion(gamma);
% BACKWARDRECURSION computing beta for 5/7 RSCC
% beta=backwardrecursion(gamma);
% beta in the form of a matrix
% gamma is a 16XN matrix of gammai(sigma(i-1),sigmi)
N=size(gamma,2);% Assuming gamma is given
Ns= 4;% Number of states
% Initialization:
beta=zeros(Ns,N);
beta(1,N) = 1;10
i=N;% Time index
simgai1= [1 2];% Set of states at i=N
beta(simgai1(1),i1) =gamma(1,i);
beta(simgai1(2),i1) =gamma(5,i);
i=N1;
simgai1= [1 2 3 4];% Set of states at i=N-1
beta(simgai1(1),i1) =gamma(1,N)*gamma(1,i);
beta(simgai1(2),i1) =gamma(1,N)*gamma(5,i);
beta(simgai1(3),i1) =gamma(5,N)*gamma(10,i);
beta(simgai1(4),i1) =gamma(5,N)*gamma(14,i);20
for i=N2:1:3
beta(simgai1(1),i1) =beta(1,i)*gamma(1,i) +beta(3,i)*gamma(3,i);
beta(simgai1(2),i1) =beta(1,i)*gamma(5,i) +beta(3,i)*gamma(7,i);
beta(simgai1(3),i1) =beta(2,i)*gamma(10,i) +beta(4,i)*gamma(12,i);
beta(simgai1(4),i1) =beta(4,i)*gamma(16,i) +beta(2,i)*gamma(14,i);
end
i= 2;% Set of states at i=2
simgai1= [1 3];
beta(simgai1(1),i1) =beta(1,i)*gamma(1,i) +beta(3,i)*gamma(3,i);
beta(simgai1(2),i1) =beta(2,i)*gamma(10,i) +beta(4,i)*gamma(12,i);30
i= 1;
simgai1= 1;% Set of states at i=1
beta0(simgai1(1)) =beta(1,i)*gamma(1,i) +beta(3,i)*gamma(3,i);
546
% E symbol energy
% EbN0dB SNR/bit (in dB)
% c decoder output
% check is 0 if c is a codeword and is 1 otherwise10
547
s=mod(ch*H,2);
it=it+ 1;
end
end
c=ch;
check=nnz(s);
if(check>0)
check= 1;
end
548
Chapter 14
Problem 14.1
1)The wavelengthis
31083
mm
10910
10m33600
The plus sign holds when the vehicle travels towards the transmitter whereas the minus sign holds
2)The maximum dierence in the Doppler frequency shift, when the vehicle travels at speed 100
fD2fD185:1852 Hz
max
3)The maximum Doppler frequency shift is obtain whenf1GHz1MHzand the vehicle moves
3108
minm0:2997 m
109106
and therefore
100103
fD92:6853 Hz
max
0:29973600
Problem 14.2
1)SinceTm1 second, the coherence bandwidth
1
Bc0:5 Hz
b
2Tm
1
Tct100=250 seconds
2Bd
549
4)The ratioW =Bc10. Hence, in principle up to tenth order diversity is available by subdividing
b
the channel bandwidth into 10 subchannels, each of width 0.5 Hz. If we employ binary PSK with
symbol durationT10 seconds, then the channel bandwidth can be subdivided into 25 subchannels,
each of bandwidth20:2 Hz. We may choose to have 5thorder frequency diversity and for each
T
transmission, thus, have 5 parallel transmissions. Thus, we would have a data rate of 5 bits per
signal interval, i.e., a bit rate of 1=2 bps. By reducing the order of diversity, we may increase the data
rate, for example, with no diversity, the data rate becomes 2.5 bps.
5)To answer the question we may use the approximate relation for the error probability given by
(11.1.32), or we may use the results in the graph shown in Figure 11.5. For example, for binary
PSK withD4, the SNR per bit required to achieve an error probability of 106is 18 dB. This the
total SNR per bit for the four channels (with maximal ration combining). Hence, the SNR per bit per
Problem 14.3
r10sec.
W
and, hence, the multipath component is resolvable. The appropriate channel model is
input signal
str
c1c1
output signal
c1stc2str
Problem 14.4
The signal bandwidth isW10 kHz. Therefore, the time resolution is
r100sec.
W
in this case, the multipath component is not resolvable. The appropriate channel model is
550
input signaloutput signal
stcst
Problem 14.5
; >0
p2
>:0
;otherwise
Hence, the probability of error for the binary FSK and DPSK with noncoherent detection averaged
Z12
1cEb22
P2eN0e=2d
022
12cEb1
1ZN
2
e02d
220
But,
Z1
2 n!
x2n1eaxdx; a >0
02an1
12cEb1
1ZN11
2
P2e02d
22022cEb1
22
N0
2
11
222cb1
2cEb1
N0
221
wherebEb. Withc1 (DPSK) andc(FSK) we have
N02
8
><1
;DPSK
P221b
>:1
2b;FSK
Problem 14.6
1)
551
cos 2 f1t
2
Matched Filter 1( )
+
2
Matched Filter 1( )
sin 2 f1t
r1(t)
cos 2 f2t
2
Matched Filter 2( )
++
2
Matched Filter 2( )
sin 2 f2t
sample att=kT
cos 2 f1t
Detector
utput
2selecto
Matched Filter 1( )
the larger
+
2
Matched Filter 1( )
sin 2 f1t
r2(t)+
cos 2 f2t
2
Matched Filter 2( )
+
2
Matched Filter 2( )
sin 2 f2t
2)The probability of error for binary FSK with square-law combining forD2 is given in Figure
14.14. The probability of error forD1 is also given in Figure 14.14. Note that an increase in SNR
by a factor of 10 reduces the error probability by a factor of 10 whenD1 and by a factor of 100
whenD2.
Problem 14.7
552
p
1)ris a Gaussian random variable. IfEis the transmitted signal point, then
b
q
Er Er1Er21kEmr
b
r1k2
2
f r 1pe2r
2r
Z0
P2f r dr
1
mr
2
1Z
prex2dx
21
0v1
uu2
mrC
tA
QB@2
r
where
m21k2E
rb
2222
r1k2
The value ofkthat maximizes this ratio is obtained by dierentiating this expression and solving for
2
k1
2
Note that if1> 2, thenk >1 andr2is given greater weight thanr1. On the other hand, if2> 1,
thenk <1 andr1is given greater weight thanr2. When12,k1. In this case
m22E
rb
22
r1
2)When232,k1, and
213
!
m2112Eb4E
r3b
22122
r331
191
m24EE
rbb
2222
r1311
10 log41:25 dB
3
553
Problem 14.8
0s1
2a2E
A
PeaQ@
N0
since the givenatakes two possible values, namelya0 anda2 with probabilities 0:1 and 0:9,
s! s!
0:18E8E
PeQ0:05Q
2N0N0
AsE! 1,Pe!0:05
N0
0v1
uu2
2aa2E
t12CA
Pea1; a2QB@
N0
In this case we have four possible values for the paira1; a2, namely,0;0; 0;2; 2;0, and2;2,
with corresponding probabilities ).01, 0.09, 0.09 and 0.81. Hence, the average probability of error is
s! s!
0:018E16E
Pe0:18Q0:81Q
2N0N0
Problem 14.9
a)
Nq
X
Ec1pcEEn1En2c
NEbkk
b
k1
554
b)In order to nd the variance of the estimate we rst needEc2. Note that
012
q
hi1NX
Ec2E@cEn1n2A
N2Ebkk
b
k1
012
NN
1qA
@NXnXn
N2EEcEb1k2j
b
k1j1
1h2i
222
NN
N2ENcEb
b
1h2i
2
NN0
N2ENcEb
b
N0
c2
NE
b
Problem 14.10
1.To achieve a rate of 4800 bps, we may useM4 PSK with a symbol rate ofTs1=2400 sec.,
which is 0.42 milliseconds. SinceTm5 msec., andTs< Tm, an equalizer is needed to combat
ISI.
2.To achieve a rate of 20 nits per second, we may use BPSK with a symbol rate ofTs1=2050
msec. SinceTm5 msec., andTsTm, no equalizer is needed. However, a time guard band
ofTmmay ne used to avoid ISI.
Problem 14.11
For a train traveling at 200 km/ht, the vehicle speed isv56 m/sec. At a carrier offc1 GHz, the
fmvfc=c
56109=3108
186 Hz
Sf1861186
>>:
0;jfj>186
555
Problem 14.12
We may select the symbol durationT100sec. to satisfy the bandwidth loss constraint. Then,
f1110 kHz and the number of subcarriers isN80080. The coherence time is
T10410
Tct1100 msec. Therefore,TctT. The coherence bandwidth isBc1100 kHz. To
BdTm
combat signal fading in any subchannel, we may transmit the same symbol on multiple subcarriers
N80800
Rsk symbols/sec
T D104DD
Problem 14.13
Problem 14.14
To show that the code has full diversity (in this case 4) we need to show that the matrix
DGG0
has full rank; whereG0is similar toGbut is obtained by using the triplets0; s0; s0instead of
123
s;s2; s3, wheres0; s0; s06s;s2; s3. Simple substitution gives
123
23
s1s0s2s0s3s00
123
67
607
6s007
62s2s1s10s3s37
DGG067
6s0007
63s30s1s1s2s27
45
0ss0ss0s1s0
33221
To show that this matrix is full rank, we can show that its determinant is nonzero unlesss1; s2; s3
556
from which we conclude that ifs0; s0; s06s;s2; s3, thenGhas full rank, and hence the code has
123
full diversity.
Problem 14.15
D2
GR
c3108
0:3 mD30:3048 m
f109
we obtain
GRGT45:845816:61 dB
EIRPPTGTGT16:61 dB
PTGTGR
PR2:995109 85:23 dB 55:23 dBm
4 d2
Note that
Problem 14.16
D2
GR
c3108
0:3 m andD1 m
f109
557
we obtain
GRGT54:8317:39 dB
EIRPPTGT0:154:837:39 dB
PTGTGR
PR1:9041010 97:20 dB 67:20 dBm
4 d2
Problem 14.17
3108
0:03 m
10109
D2102
GR0:66:5810558:18 dB
0:03
PTGTGR3101:56:58105
PR2:221013 126:53 dB
7
4d243:141594102
0:03
Problem 14.18
N0kT1:3810233004:141021W/Hz
If we assume that the receiving antenna has an eciency0:5, then its gain is given by
012
D23:1415950
GR0:5@3A5:48310557:39 dB
108
2109
0:15
E17:81251013
RPRb1011:887110718:871 Mbits/sec
N0N04:141021
558
Problem 14.19
GtotGaGosGBPFGa10512529 dB
12
P1133029 114 dB
s;dem
The noise-gure for the cascade of the rst amplier and the multiplier is
1100:51
F1FaFos100:53:3785
1
Ga10
1
We assume thatF1is the spot noise-gure and therefore, it measures the ratio of the available PSD
out of the two devices to the available PSD out of an ideal device with the same available gain. That
is,
Sf
F1n;o
Sf GaGos
n;i1
whereSf is the power spectral density of the noise at the input of the bandpass lter and
n;o
Sf is the power spectral density at the input of the overall system. Hence,
n;i
17530
Sf 101010100:53:37853:37851020
n;o
The noise-gure of the cascade of the bandpass lter and the second amplier is
Fa1100:51
F2FBPF2100:24:307
GBPF100:1
The signal to noise ratio at the output of the system (input to the demodulator) is
P
SNRs;dem 114111:36 2:64 dB
P
n;dem
Problem 14.20
0:75 m
f4109
559
If 1 MHz is the passband bandwidth, then the rate of binary transmission isRbW106bps.
PRE
Rbb=)1064:11021101:51:29651013
N0N0
The transmitted power is related to the received power through the relation
PTGTGRPRd2
PR=)PT4
4d2GTGR
Problem 14.21
N0kT1:3810233054:211021W/Hz
c3108
0:130 m
f2:3109
D23:14159642
GR0:551:315610661:19 dB
0:130
PTGTGR17102:71:3156106
PR4:6861012 113:29 dB
11
4d243:141591:6102
0:130
E14:6861012
RPRb100:64:43121094:4312 Gbits/sec
N0N04:211021
Computer Problems
560
Computer Problem 14.1
Figures 14.1 and 14.2 presentjc1njandjc2njforW10 kHz, respectively. The channel output
Td= 10^(3);
timeResolution= 1/W;
delaySamples=Td/timeResolution;
c1(1) =randn+j*randn;
c2(1) =randn+j*randn;
forn= 2:100010
c1(n) = 0.9*c1(n1)+randn+j*randn;
c2(n) = 0.9*c2(n1)+randn+j*randn;
end
x=ones(1,1000);
i= 0;
forvariance= 0:0.5:1.5
i=i+ 1;
c2delayed=zeros(1,n);
c2delayed(delaySamples+1:1000) =c2(1:1000delaySamples);
end
The following gure illustrates the result of the Monte Carlo simulation and the comparison with the
theoretical error probability.
561
9
(n)|
5
1
|c
4
0
02004006008001000
n
(n)|
5
2
|c
4
0
02004006008001000
n
562
2
w=0
20
10
0
02004006008001000
2
w=0.5
20
10
0
02004006008001000
2
w=1
20
10
0
02004006008001000
n
563
9
(n)|
5
1
|c
4
0
02004006008001000
n
5
(n)|
2
|c
4
0
02004006008001000
n
w=0
20
10
0
02004006008001000
2
w=0.5
20
10
0
02004006008001000
2
w=1
20
10
0
02004006008001000
n
10
Monte Carlo simulation
Theoretical value
-1
10
-2
10
-3
10
Error Probability
-4
10
-5
10
05101520253035
Average SNR/bit (dB)
EbNodB= 0:5:35;
BER=zeros(1,length(EbNodB));
for i= 1:length(EbNodB)
noerrors= 0;
nobits= 0;10
u=rand;
alpha=sigma*sqrt(2*log(u));
noise=sqrt(Noover2(i))*randn;
y=alpha*sqrt(Eb) +noise;
if y<= 0
yd= 1;
else
yd= 0;20
end
nobits=nobits+ 1;
noerrors=noerrors+yd;
end
BER(i) =noerrors/nobits;
end
rhob=Eb./Noover2;
P2= 1/2*(1sqrt(rhob./(1+rhob)));
semilogy(EbNodB,BER,-,EbNodB,P2,-o)
*
xlabel(Average SNR/bit (dB))
ylabel(Error Probability)
The gure shown below illustrates the result of the Monte Carlo simulation and a comparison with
the theoretical error probability. We note that the agreement is very good for large SNR.
566
0
10
Monte Carlo simulation
Theoretical value
-1
10
-2
10
-3
10
BER
-4
10
-5
10
-6
10
5101520253035
Average SNR/bit (dB)
D= 2;
sigma= 1;
Eb= 1/sqrt(2);
EbNorxperchdB= 5:5:30;
EbNorxperch= 10.^(EbNorxperchdB/10);
No=Eb*2*sigma^2*10.^(EbNorxperchdB/10);
BER=zeros(1,length(No));
SNRrxperbperch=zeros(1,length(No));
% Calculation of error probability using Monte Carlo simulation:10
for i= 1:length(No)
nobits= 0;
noerrors= 0;
Prxt= 0;% Total rxd power
Pnt= 0;% Total noise power
r=zeros(2,2);
R=zeros(1,2);
% Assumption: m = 1 (All one codeword is transmitted):
while noerrors<= 100
nobits=nobits+ 1;20
u=rand(1,2);alpha=sigma*sqrt(2*log(u));phi= 2*pi*rand(1,2);
noise=sqrt(No(i)/2)*(randn(2,2) + 1i*randn(2,2));
r(1,1) =alpha(1)*sqrt(Eb)*exp(1i*phi(1))+noise(1,1);
r(1,2) =noise(1,2);
r(2,1) =alpha(2)*sqrt(Eb)*exp(1i*phi(2))+noise(2,1);
r(2,2) =noise(2,2);
R(1) =abs(r(1,1))^2 +abs(r(2,1))^2;
567
R(2) =abs(r(1,2))^2 +abs(r(2,2))^2;
if R(1)<=R(2)
mh= 0;30
else
mh= 1;
end
Pnt=Pnt+No(i);
noerrors=noerrors+ (1mh);
end
SNRrxperbperch(i) = (PrxtPnt)/Pnt;
BER(i) =noerrors/nobits;
end40
rho=EbNorxperch;
rhodB= 10*log10(rho);
rhob=D*rho;
rhobdB= 10*log10(rhob);
KD=factorial((2*D1))/factorial(D)/factorial((D1));
P2=KD./rho.^D;
semilogy(rhobdB,BER,-,rhobdB,P2,-o)
*
22
f xxex=; x0
2
The gure below illustrates the histogram and the comparison with the actual Rayleigh PDF for
5.
568
300
200
100
0246810121416182022240
0:2
0:1
024681012141618202224
N=20000;
x=0:0.1:25;
u=rand(1,N);
sigma=5;
r=sigmasqrt(-2log(u));
**
r_ac=x/sigma^2.exp(-(x/sigma).^2/2);
*
subplot(2,1,1)
hist(r,x)
axis([0 25 0 300])
subplot(2,1,2)
plot(x,r_ac)
The following gure illustrates the result of the Monte Carlo simulation and comparison with the
theoretical error probability for a dual diversity system (D2) at large SNR. We note that the
569
-1
10
Monte Carlo simulation
Theoretical value
-2
10
-3
10
BER
-4
10
-5
10
-6
10
51015202530
D= 2;
sigma= 1/sqrt(2);
Eb= 1;
EbNorxperchdB= 5:5:25;
EbNorxperch= 10.^(EbNorxperchdB/10);
No=Eb*2*sigma^2*10.^(EbNorxperchdB/10);
BER=zeros(1,length(No));
SNRrxperbperch=zeros(1,length(No));
% Calculation of error probability using Monte Carlo simulation:10
for i= 1:length(No)
nobits= 0;
noerrors= 0;
% Assumption: m = 0 (All zero codeword is transmitted):
while noerrors<= 100
nobits=nobits+ 1;
u=rand(1,2);
alpha=sigma*sqrt(2*log(u));
phi= 2*pi*rand(1,2);
c=alpha.*exp(1i*phi);20
noise=sqrt(No(i)/2)*(randn(1,2) + 1i*randn(1,2));
r=c*sqrt(Eb) +noise;
R=real(conj(c(1))*r(1)+conj(c(2))*r(2));
if R<= 0
mh= 1;
else
mh= 0;
570
end
noerrors=noerrors+mh;
end30
BER(i) =noerrors/nobits;
end
% Calculation of error probability using the theoretical formula:
rho=EbNorxperch;
rhob=D*rho;
rhobdB= 10*log10(rhob);
KD=factorial((2*D1))/factorial(D)/factorial((D1));
P2=KD./(4*rho).^D;
% Plot the results:
semilogy(rhobdB,BER,-,rhobdB,P2,-o)40
*
xlabel(Average SNR/bit (dB));ylabel(BER)
legend(Monte Carlo simulation,Theoretical value)
zThe inputs to the detectors at the receive antennas are given by Equation (14.4.7), where the
identical variance2.
The MATLAB script for the problem for the case ofNTNR2; 5 is given below.
zThe elements ofHareh11,h12,h21, andh22. For the Rayleigh fading channel, these parameters
are complex-valued, statistically independent, zero-mean Gaussian random variables with identical
variances2. Hence, the two inputs to the detectors at the two antennas are
y1h11s1h12s21
y2h21s1h22s22
wheres1ands2are the transmitted symbols from the two transmit antennas and1; 2are the
statistically independent additive Gaussian noise terms with zero mean and equal variances2.
n
The MATLAB script for the problem when25 and21 is given below.
n
571
sigma= 5;% Variance of fading coecients
No= 1;% Noise variance
s= 2*randi([0 1],Nt,1)1;% Binary transmitted symbols
H= (randn(Nr,Nt) + 1i*randn(Nr,Nt))*sigma/sqrt(2);% Channel coecients
noise=sqrt(No/2)*(randn(Nr,1) + 1i*randn(Nr,1));% AWGN noise
y=H*s+noise;% Inputs to the detectors
disp([The inputs to the detectors are: ,num2str(y)])10
zThe MATLAB script for the computations in each of the three detectors is given below.
572
else40
sh(i) =1;
end
end
disp([The detected symbols using the ICD method are: ,num2str(sh)])
zThe graph for the estimated error rates as a function of SNR is shown below.
0
10
Alamouti: 4-PSK
-1
10
-2
10
-4
10
5101520
SNR (dB)
573
noerrors= 0;
nosymbols= 0;
while noerrors<= 100
s= 2*randi([0 1],1,2)1 + 1i*(2*randi([0 1],1,2)1);
nosymbols=nosymbols+ 2;
% Channel coecients20
h= 1/sqrt(2) * (randn(1,2) + 1i*randn(1,2));
% Noise generation:
noise=sqrt(No(i))*(randn(2,1) + 1i*randn(2,1));
% Correlator outputs:
y(1) =h(1)*s(1) +h(2)*s(2) +noise(1);
y(2) =h(1)*conj(s(2)) +h(2)*conj(s(1)) +noise(2);
% Estimates of the symbols s1 and s2:
sh(1) =y(1)*conj(h(1)) +conj(y(2))*h(2);
sh(2) =y(1)*conj(h(2))conj(y(2))*h(1);
% Maximum-Likelihood detection:30
for j= 1 : 4
Dist1(j) =abs(sh(1)codebook(j));
Dist2(j) =abs(sh(2)codebook(j));
end
[Min1 idx1] =min(Dist1);
[Min2 idx2] =min(Dist2);
st(1) =codebook(idx1);
st(2) =codebook(idx2);
% Calculation of error numbers:
if st(1) =s(1)40
noerrors=noerrors+ 1;
end
if st(2) =s(2)
noerrors=noerrors+ 1;
end
end
BER(i) =noerrors/nosymbols;
end
echo on;
semilogy(SNRdB,BER)50
xlabel(SNR (dB))
ylabel(Symbol Error Rate (SER))
legend(Alamouti: 4-PSK)
zFigures 14.7 and 14.8 illustrate the binary error rate (BER) for binary PSK modulation with
NT; NR2;2andNT; NR2;3, respectively. In both cases, the variances of the channel
gains are identical and their sum is normalized to unity; that is,
X
Ejhmnj21 (14.52)
n;m
The BER for binary PSK modulation is plotted as a function of the average SNR per bit. With the
normalization of the variances in the channel gainsfhmngas given by Equation (14.52), the average
574
0
10
ML
MMSE
-1
10
ICD
-2
10
-3
10
BER
-4
10
-5
10
-6
10
-7
10
051015202530
Average SNR/bit (dB)
Figure 14.7: Performance of MLD, MMSE, and ICD (detectors) withNR2 receiving antennas
10
ML
MMSE
-1
ICD
10
-2
10
-3
10
BER
-4
10
-5
10
-6
10
051015202530
Average SNR/bit (dB)
Figure 14.8: Performance of MLD and MMSE detectors withNR3 receiving antennas
575
The performance results in Figures 14.7 and 14.8 illustrate that the MLD exploits the full diversity
of orderNRavailable in the received signal and, thus, its performance is comparable to that of
a maximal ratio combiner (MRC) of theNRreceived signals, without the presence of interchannel
interference; that is,NT; NR1; NR. The two linear detectors, the MMSE detector and the ICD,
achieve an error rate that decreases inversely as the SNR raised to theNR1power forNT2
transmitting antennas. Thus, whenNR2, the two linear detectors achieve no diversity, and when
NR3, the linear detectors achieve dual diversity. We also note that the MMSE detector outperforms
the ICD, although both achieve the same order of diversity. In general, with spatial multiplexing (NT
antennas transmitting independent data streams), the MLD detector achieves a diversity of orderNR
and the linear detectors achieve a diversity of orderNRNT1, for anyNRNT. In eect, with
hasNRdegrees of freedom. In detecting any one data stream, in the presence ofNT1 interfering
signals from the other transmitting antennas, the linear detectors utilizeNT1 degrees of freedom
to cancel theNT1 interfering signals. Therefore, the eective order of diversity for the linear
detectors isNRNT1NRNT1:
576
% Minimum Mean-Sqaure-Error (MMSE) Detector:
echo o;
for i= 1:length(EbNodB)
noerrors= 0;
nobits= 0;
while noerrors<= 100
s= 2*randi([0 1],Nt,1)1;40
nobits=nobits+length(s);
H= (randn(Nr,Nt) + 1i*randn(Nr,Nt))/sqrt(2*Nr);
noise=sqrt(No(i)/2)*(randn(Nr,1) + 1i*randn(Nr,1));
y=H*s+noise;
w1= (H*H + No(i)eye(Nr))^(-1)H(:,1);% Optimum weight vector 1
**
w2= (H*H + No(i)eye(Nr))^(-1)H(:,2);% Optimum weight vector 2
**
W= [w1 w2];
sh=Wy;
*
for j= 1:Nt
if sh(j)>= 050
sh(j) = 1;
else
sh(j) =1;
end
end
noerrors=noerrors+nnz(shs);
end
BERMMSE(i) =noerrors/nobits;
end
echo on;60
577
xlabel(Average SNR/bit (dB),fontsize,10)
ylabel(BER,fontsize,10)
legend(ML,MMSE,ICD)90
578
Chapter 15
Problem 15.1
The probability of error for DS spread spectrum with binary PSK may be expressed as
s!
P2Q2W =Rb
PJ=PS
whereW =Ris the processing gain andPJ=PSis the jamming margin. If the jammer is a broadband,
PJW J0
PS E=Tb ERb
bb
Therefore,
s!
P2Q2Eb
J0
Problem 15.2
We assume that the interference is characterized as a zero-mean AWGN process with power spectral
densityJ0. To achieve an error probability of 105, the requiredE=J010 . Then, by using the
b
relation in (11.3.33) and (11.3.37), we have
W =RW =RE
b
PN=PSNu1J0
W =REbNu1
J0
WREbNu1
J0
whereR104bps,Nu30 andE=J010:Therefore,
b
W2:9106Hz
579
Problem 15.3
E
b
10:5dB
J0
dB
NuW =Rb1
E=J0
b
1000
11:3189 users
500
Nu145users
11:3
Problem 15.4
WPJE
b
RPSJ030dB
dBdBdB
W
R1000
W1000R106Hz
Problem 15.5
300
Td1sec
3108
The minimum bandwidth of a DS spread spectrum signal required to resolve the propagation paths
580
Problem 15.6
1MHz:TheE=J0is
b
EW =R106=104100
J0Nu11414
7:148:54dB
W =R7:14 29207
Problem 15.7
L2m12151
32767 bits
For binary FSK modulation, the minimum frequency separation is 2=T ;where 1=Tis the symbol
(bit) rate. The hop rate is 100hops=sec:Since the shift register hasN32767 states and
each state utilizes a bandwidth of 2=T200Hz;then the total bandwidth for the FH signal is
6:5534MHz:
W6:5534106
4
R1006:553410bps
3. If the noise is AWG with power spectral densityN0;the probability of error expression is
s! s!
P2QEbQW =R
N0PN=PS
581
Problem 15.8
TheE=J0required to obtain an error probability of 105for binary PSK is 9.5 dB. Hence, the
b
jamming margin is
PJWE
b
PSRbJ0
dBdBdB
279:5
17:5dB
Problem 15.9
Without loss of generality, let us assume thatL1< L2:Then, the period of the sequence obtained by
L3kL2
wherekis the smallest integer multiple ofL2such thatkL2=L1is an integer. For example, suppose
and divideL3byL1;the result is 21:Hence, if we take 21L1and 5L2, and modulo-2 add the resulting
Problem 15.10
L21011023
LTb102330dB
Tc
2. The jamming margin is
582
PJWE
b
PSRbJ0
dBdBdB
3010
20dB
whereJavJ0WJ0=TcJ0106
Problem 15.11
106
Tb3:69sec
:2708
a) For the suburban channel model, the delay spread is 7sec. Therefore, the number of bits aected
by intersymbol interference is at least 2. The number may be greater than 2 if the signal pulse
extends over more than one bit interval, as in the case of partial response signals, such as CPM.
b) For the hilly terrain channel model, the delay spread is approximately 20sec. Therefore, the
number of bits aected by ISI is at least 6. The number may be greater than 6 if the signal pulse
Problem 15.12
In the case of the urban channel model, the number of RAKE receiver taps will be at least 2. If the
signal pulse extends over more than one bit interval, the number of RAKE taps must be further
increased to account for the ISI over the time span of the signal pulse. For the hilly terrain channel
model, the minimum number of RAKE taps is at least 6 but only three will be active, one for the rst
If the signal pulse extends over more than one bit interval, the number of RAKE taps must be
further increased to account for the ISI over the same span of the signal pulse. For this channel,
in which the multipath delay characteristic is zero in the range of 2sec to 15sec, as many as
3 RAKE taps between the rst signal arrival and the delayed signal arrivals will contain no signal
components.
Problem 15.13
vf01059108
fm83:3Hz
c360038
583
For a train traveling at a speed of 200 Km/hr,
fm166:6Hz
The plots of the power spectral density for the automobile and the train are shown below
0.08
0.07
0.06
0.05
0.04
0.03
0.02
train
automobile
0.01
0
-200-150-100-50050100150200
(Hz)
f
m
Problem 15.14
PRPTLsGT
dBdBdBdB
whereLsis the free-space path loss andGTis the antenna gain. The path loss is
dBdB
Ls20 log4 d
dB
2
Ls20log8104108 dB
dB
584
Therefore,
PTPR10820
dBdB
PR88
dB
The received power level can be obtained from the conditionPR=PN102. First of all,PNW N0,
PN4:11016W
and
PR4:11018W
PTPR99 86 dBW
dBdB
Problem 15.15
W107
510337dB
R2103
PJWE
b
PsRCGdBJ0
dBdBdB
3771034dB
Problem 15.16
(a)If the hopping rate is 2 hops/bit and the bit rate is 100 bits/sec, then, the hop rate is 200
hops/sec. The minimum frequency separation for orthogonality 2=T400Hz:Since there
areN32767 states of the shift register and for each state we select one of two frequencies
585
(b) The processing gain isW =R;whereW13:1068MHzandR100bps:Hence
W
R0:131068MHz
(c)The probability of error in the presence of AWGN is given by (10.3.61) withN2 chips per
hop.
Problem 15.17
a)The total SNR for three hops is 2013 dB.Therefore the SNR per hop is 20=3. The probability of a
Pb11p2
112pp2
2pp2
EE
cc
1
e2N0eN0
2
0:0013
b)In the case of one hop per bit, the SNR per bit is 20, Hence,
1Ec
Pbe2N0
2
1
10
2e
2:27105
Therefore there is a loss in performance of a factor 57 AWGN due to splitting the total signal energy
Problem 15.18
W2109
210553dB
R104
2=E=J00:2
b
586
Hence
W0:4GHz
11
P2ee
E=J010
b
3:68102
Computer Problems
The results of Monte Carlo simulation are shown in Figure 15.1 for three dierent values of amplitude
587
function[p]=ssPe(snrindB,Lc,A,w0)
% [p]=ssPe(snrindB, Lc, A, w0)
% SSPE nds the measured error rate. The function
% that returns the measured probability of error for the given value of
% the snrindB, Lc, A and w0.
snr=10^(snrindB/10);
sgma=1;% Noise standard deviation is xed.
Eb=2*sgma^2*snr;% signal level required to achieve the given
% signal-to-noise ratio
Echip=Eb/Lc;% energy per chip10
N=100000;% number of bits transmitted
% The generation of the data, noise, interference, decoding process and error
% counting is performed all together in order to decrease the run time of the
% program. This is accomplished by avoiding very large sized vectors.
numoferr=0;
for i=1:N,
% Generate the next data bit.
temp=rand;
if(temp<0.5),
data=1;20
else
data=1;
end;
% Repeat it Lc times, i.e. divide it into chips.
for j=1:Lc,
repeateddata(j)=data;
end;
% pn sequence for the duration of the bit is generated next
for j=1:Lc,
temp=rand;30
if(temp<0.5),
pnseq(j)=1;
else
pnseq(j)=1;
end;
end;
% the transmitted signal is
transsig=sqrt(Echip)*repeateddata.*pnseq;
% AWGN with variance sgma^2
noise=sgma*randn(1,Lc);40
% interference
n=(i1)*Lc+1:i*Lc;
interference=A*sin(w0*n);
% received signal
recsig=transsig+noise+interference;
% Determine the decision variable from the received signal.
temp=recsig.*pnseq;
decisionvariable=sum(temp);
% making decision
if(decisionvariable<0),50
decision=1;
else
decision=1;
end;
588
0
10
A=0
A=3
A=10
-1
10
-2
10
-3
10
Measured error probability
-4
10
0510152025
SNR in dB
589
for i=1:4
gs{i} = 2*gs{i}1;
end
chip=length(gs{1});
err=zeros(numOfUsers, (snrMaxsnrMin)+1);
j= 0;
forSNR=snrMin:snrMax
j=j+ 1;
stddev=sqrt(chip/((10^(SNR/10))*2));
forinData=1:N20
channelOutput=zeros(1,chip);
for i=1:numOfUsers
infoData(i) = 2.*(round(rand(1)))1;
channelOutput=channelOutput+gs{i}*infoData(i);
end
noise=stddev*randn(1,chip);
channelOutput=channelOutput+noise;
for i= 1:numOfUsers
hardDec=sign(sum(channelOutput.*gs{i}));
ifhardDec=infoData(i);30
err(i,j) =err(i,j) + 1;
end
end
end
end
% Plotting commands follow.
ber=err./N;
snr=snrMin:snrMax;
semilogy(snr,ber(1,:),--);
holdon;40
semilogy(snr,ber(2,:),-.);
semilogy(snr,ber(3,:),:);
semilogy(snr,ber(4,:),-);
legend(User 1,User 2,User 3,User 4);
590
-1
10
User 1
User 2
User 3
User 4
-2
10
-3
10
Probability of error
-4
10
1234567891011
SNR in dB
Figure 15.2: The results of Monte Carlo simulation of four time synchronous CDMA users
gs{i} = 2*gs{i}1;
end
chip=length(gs{1});
err=zeros(numOfUsers, (snrMaxsnrMin)+1);
j= 0;
forSNR=snrMin:snrMax
j=j+ 1;
stddev=sqrt(chip/((10^(SNR/10))*2));
previosInfoData= 2.*(round(rand(1, 4)))1;20
infoData= 2.*(round(rand(1, 4)))1;
forinData=1:N
channelOutput=zeros(1,chip+3);
temp1=zeros(1,chip+3);
temp2=zeros(1,chip+3);
temp3=zeros(1,chip+3);
temp4=zeros(1,chip+3);
591
temp3(1:2) =previosInfoData(3) *gs{3}(chip1:chip);
temp3(3:chip+2) =infoData(3) *gs{3};
temp3(chip+3) =nextInfoData(3) *gs{3}(1);40
noise=stddev*randn(1,chip+3);
channelOutput=temp1+temp2+temp3+temp4+noise;
foruser= 1:4
hardDec=sign(sum(channelOutput(user:(chip+(user1))).*gs{user}));50
ifhardDec=infoData(user);
err(user,j) =err(user,j) + 1;
end
end
previousInfoData=infoData;
infoData=nextInfoData;
end
end60
% Plotting commands follow.
ber=err./N;
snr=snrMin:snrMax;
semilogy(snr,ber(1,:),--);
holdon;
semilogy(snr,ber(2,:),-.);
semilogy(snr,ber(3,:),:);
semilogy(snr,ber(4,:),-);
legend(User 1,User 2,User 3,User 4);
L2m14095
The periodic autocorrelation function of the equivalent bipolar sequence is presented in Fig-
ure 15.4
592
-1
10
User 1
User 2
User 3
User 4
-2
10
-3
10
Probability of error
-4
10
123456789
SNR in dB
Figure 15.3: The results of Monte Carlo simulation of four time asynchronous CDMA users
connections(9) = 1;
connections(12) = 1;
sequence=ssmlsrs(connections);
c= 2.*sequence1;10
Rc=zeros(1,L);
form=1:L
forn=1:L
Rc(m) =Rc(m)+c(n)*c(n+m1);
end
end
% Plotting commands follow.
plot(Rc);20
axis([500 4500500 4500]);
function[seq]=ssmlsrs(connections);
% [seq]=ssmlsrs(connections)
% SSMLSRS generates the maximal length shift-register sequence when the
% shift-register connections are given as input to the function. A zero
% means not connected, whereas a one represents a connection.
m=length(connections);
L=2^m1% length of the shift register sequence requested
registers=[1zeros(1,m1)];% initial register contents
seq(1)=registers(1);% rst element of the sequence
593
4500
4000
3500
3000
2500
2000
(m)
c
R
1500
1000
500
-500
-500050010001500200025003000350040004500
m
for i=2:2*L,10
newregcont(m)=mod(sum(registers.*connections), 2);
for j=m1:1:1,
newregcont(j)=registers(j+1);
end;
registers=newregcont;% current register contents
seq(i)=registers(1);% the next element of the sequence
end;
The gure shown below illustrates the result of this crosscorrelation offrkgwithfckg. Although
the signal component is not observable in the high-level noise, the signal is clearly detectable at the
594
10
1000
8
900
6
800
4
700
2
600
0
rk
yn
500
-2
400
-4
300
-6
200
-8
100
-10
0200400600800100002004006008001000
kn
Rx=zeros(length(p),M+1);
Sx=zeros(length(p),M+1);
for i= 1:length(p)10
for n= 3:N
c(i,n) = 2*p(i)*c(n1)power(p(i),2)*c(n2) +power((1p(i)),2)*w(n);
end
% Calculation of autocorrelations and power spectra:
Rx(i,:) =Rxest(c(i,:),M);
Sx(i,:)=tshift(abs(t(Rx(i,:))));
end
% Plot the results:
subplot(3,2,1)
plot(real(c(1,:)))20
axis([0Nmax(abs(real(c(1,:))))max(abs(real(c(1,:))))])
title(\it{p} = 0.9)
xlabel(\it{n})
ylabel(\it{c_{nr}})
subplot(3,2,2)
plot(real(c(2,:)))
axis([0Nmax(abs(real(c(2,:))))max(abs(real(c(2,:))))])
title(\it{p} = 0.99)
xlabel(\it{n})
ylabel(\it{c_{nr}})30
subplot(3,2,3)
plot(imag(c(1,:)))
axis([0Nmax(abs(imag(c(1,:))))max(abs(imag(c(1,:))))])
title(\it{p} = 0.9)
xlabel(\it{n})
ylabel(\it{c_{ni}})
subplot(3,2,4)
plot(imag(c(2,:)))
axis([0Nmax(abs(imag(c(2,:))))max(abs(imag(c(2,:))))])
title(\it{p} = 0.99)40
xlabel(\it{n})
ylabel(\it{c_{ni}})
subplot(3,2,5)
plot(abs(c(1,:)))
axis([0N0max(abs(c(1,:)))])
title(\it{p} = 0.9)
595
xlabel(\it{n})
ylabel(\it{|c_n |})
subplot(3,2,6)
plot(abs(c(2,:)))50
axis([0N0max(abs(c(2,:)))])
title(\it{p} = 0.99)
xlabel(\it{n})
ylabel(\it{|c_n |})
gure
subplot(2,2,1)
plot(abs(Rx(1,:)))
axis([0M0max(abs(Rx(1,:)))])
title(\it{p} = 0.9)60
xlabel(\it{n});ylabel(\it{|R_{c}(n)|})
subplot(2,2,2)
plot(abs(Rx(2,:)))
title(\it{p} = 0.99)
xlabel(\it{n});ylabel(\it{|R_{c}(n)|})
axis([0M0max(abs(Rx(2,:)))])
subplot(2,2,3)
plot(Sx(1,:))
title(\it{p} = 0.9)
xlabel(\it{f});ylabel(\it{S_{c}(f)})70
axis([0M0max(abs(Sx(1,:)))])
subplot(2,2,4)
plot(Sx(2,:))
title(\it{p} = 0.99)
xlabel(\it{f});ylabel(\it{S_{c}(f)})
axis([0M0max(abs(Sx(2,:)))])
Figure 15.5 presents the frequency selection pattern for the rst ten bit interval.
596
140
120
100
80
60
Frequency
40
20
0
12345678910
time
newregcont(m)=mod(sum(registers.*connections), 2);
for j=m1:1:1,
newregcont(j)=registers(j+1);
end;
registers=newregcont;% current register contents20
seq(i)=registers(1);% the next element of the sequence
frequency(i) =bin2dec(num2str(registers));% select the frequency
% select two frequencies
f0(i) =frequency(i)Df/2;
f1(i) =frequency(i) +Df/2;
end;
plot(frequency(1:10),);
*
Figure 15.6 illustrates the error rate that results from the Monte Carlo simulation. Also shown in the
The MATLAB scripts for the simulation program are given next.
echo on
rhob1=0:5:35;% rho in dB for the simulated error rate
rhob2=0:0.1:35;% rho in dB for theoretical error rate computation
for i=1:length(rhob1),
597
0
10
-1
10
-2
10
-3
10
-4
10
05101520253035
Figure 15.6: Error-rate performance of FH binary FSK system with partial-band interferenceMonte
Carlo simulation
function[p]=ssPe96(rhoindB)
% [p]=ssPe96(rhoindB)
% SSPE96 nds the measured error rate. The value of
% signal per interference ratio in dB is given as an
% input to the function.
rho=10^(rhoindB/10);
Eb=rho;% energy per bit
if(rho>2),
598
alpha=2/rho;% optimal alpha if rho>2
else10
alpha=1;% optimal alpha if rho<2
end;
sgma=sqrt(1/(2*alpha));% noise standard deviation
N=10000;% number of bits transmitted
% generation of the data sequence
for i=1:N,
temp=rand;
if(temp<0.5)
data(i)=1;
else20
data(i)=0;
end;
end;
% Find the received signals.
for i=1:N,
% the transmitted signal
if(data(i)==0),
r1c(i)=sqrt(Eb);
r1s(i)=0;
r2c(i)=0;30
r2s(i)=0;
else
r1c(i)=0;
r1s(i)=0;
r2c(i)=sqrt(Eb);
r2s(i)=0;
end;
% The received signal is found by adding noise with probability alpha.
if(rand<alpha),
r1c(i)=r1c(i)+gngauss(sgma);40
r1s(i)=r1s(i)+gngauss(sgma);
r2c(i)=r2c(i)+gngauss(sgma);
r2s(i)=r2s(i)+gngauss(sgma);
end;
end;
% Make the decisions and count the number of errors made.
numoferr=0;
for i=1:N,
r1=r1c(i)^2+r1s(i)^2;% rst decision variable
r2=r2c(i)^2+r2s(i)^2;% second decision variable50
% Decision is made next.
if(r1>r2),
decis=0;
else
decis=1;
end;
% Increment the counter if this is an error.
if(decis=data(i)),
numoferr=numoferr+1;
end;60
end;
% measured bit error rate is then
599
p=numoferr/N;
600