#The transmission bandwidth is given by the equation Bt=(1+r)Rb/2 and hence transmission rate is given by Rb=2Bt/(1+r)#where r=roll-off factor and 0<=r<=1. Since 'r' can take value in between 0 and 1,bandwidth varies from 2Bt to Bt.
Bt=32000#
r=1##assume values of Bt and r
Rb=(2*Bt)/(1+r)#
print "transmission rate = ",Rb##Rb=Bt for r=1
from numpy import mat
# problem fig. is ggiven on page no 324. Referring the fig. we are given the values of a0,a1,a-1,a-2
a=1#
b=-0.3#
c=0.1#
d=-0.2#
e=0.05#
#design a three-tap (N=1) equalizer by substituting these values into eq no 7.45 of the page no 325
A=mat([[0],[1],[0]])#
B=mat([[a, d, e],[b, a, d],[c, b, a]])
c=(B**-1)*A## As, A=B*C Hence c is obtained as given
print 'values of C-1,C0,C1 are obtained:'
print c
from __future__ import division
# a) Find detection error probability
#Given: Ap=1mV, 6n=192.3uV
# The formula for polar case is given by Ap/6n
Ap=1#
sigma_n=192.3#
x=Ap/sigma_n##here we have to find the value of P(e)=Q(x) from the table10.2 given on page no. 454
print "Value of x : %0.4f"%x
Q1=(0.9964)*10**(-7)#
print "error probability = %.2e "%Q1 ##this is nearly equal to zero
#Prob NO 7.4 b) Find detection error probability.
#In this case, only half the bits are transmitted by no pulse, there are, on the average, only half as many pulses in the on-off case(compared to the polar).
#To maintain the same power,we need to double the energy of each pulse in the on-off or the bipolar case(compared to the polar).
#Now, doubling the pulse energy is accomplished by multiplying the pulse by sqrt(2).
#Thus, for on-off Ap is sqrt(2) times the Ap in the polar case,that is, Ap=sqrt(2)*10**-3
x=Ap/2*sigma_n##here we have to find the value of P(e)=Q(x) from the table10.2 given on page no. 454
print "Value of x : %0.4f"%x
Q2=(1.166)*10**-4#
print "error probability = %0.2e "%Q2
#for a given power , the Ap for both the on-off and the bipolar cases are identical. Hence P(e)=1.5 Q(x)#
Q3=1.5*Q2#
print "error probability = %0.2e "%Q3