chapter 5: Communication Techniques

Example 5.1, page no-174

In [1]:
import math




#Variable Declaration
m=0.5           #modulation index

#Calculation
#for AM
pt1=(1+(m**2)/2.0)
#for SSBSC
pt2=(m**2)/4.0
#% power saving
p=(pt1-pt2)*100/pt1
p=math.floor(p*10)/10

#Result
print("Percentage power saving is %.1f%%"%p)

#for case (b)

#Variable Declaration
m=1           #modulation index

#Calculation
#for AM
pt1=(1+(m**2)/2.0)
#for SSBSC
pt2=(m**2)/4.0
#% power saving
p=(pt1-pt2)*100/pt1
p=math.floor(p*10)/10

#Result
print("\n Percentage power saving is %.1f%%"%p)
Percentage power saving is 94.4%

 Percentage power saving is 83.3%

Example 5.2, page no-174

In [4]:
#Variable Declaration
pc=500       #energy of carrier signal
m=0.6       #AM modulation index


#Calculation

#for (a)
pt=pc*(1+(m**2)/2)

#for (b)
pt2=pc*(m**2)/4


#Result
print("(a)\n A3E is the double side band AM with full carrier.\n Therefore, Pt= %.0f W\n\n (b)\n J3E is an SSBSC system.\n Therefore, Pt= %.0f W"%(pt,pt2))
(a)
 A3E is the double side band AM with full carrier.
 Therefore, Pt= 590 W

 (b)
 J3E is an SSBSC system.
 Therefore, Pt= 45 W

Example 5.3, page no-175

In [5]:
import math
#Variable Declaration
m=0.6           #60% modulation


#Calculation
#for A3E
pt1=(1+(m**2)/2)
#for J3E
pt2=(m**2)/4
#% power saving
p=(pt1-pt2)*100/pt1
p=math.ceil(p*10)/10

#Result
print("Percentage power saving is %.2f%%"%p)
Percentage power saving is 92.40%

Example 5.4, page no-175

In [6]:
#Variable Declaration

bw=0.5/100      #bw is 0.5% of carrier freq. 


#Calculation
wc=2/bw

#Result
print("Wc = %.0f*Wm"%wc)
Wc = 400*Wm

Example 5.5, page no-190

In [8]:
import math

#Variable Declaration

m=6.0              #Modulation Index
wc=7.8*10**8       #unmodulated carrier frequency
wm=1450            #Modulating frequency


#Calculation
fc=wc/(2*math.pi)
fm=wm/(2*math.pi)


#Result
print("Unmodulated carrier frequency, fc = %.2f MHz \n The modulation index m = %d \n Modulating frequency, fm = %.2f Hz"%(fc/10**6,m,fm))
Unmodulated carrier frequency, fc = 124.14 MHz 
 The modulation index m = 6 
 Modulating frequency, fm = 230.77 Hz

Example 5.7, page no-191

In [10]:
mf=150            #modulation index
fm=1              # modulating frequency in KHz


#Calculation
fd=mf*fm
bw=2*(mf+1)*fm

#Result
print("frequency deviation = %.0f kHz\n Bandwidth = %.0f kHz \n\n Expression for instantaneous frequency is given by, \n f = 10^8-150*(10^3)*sin(2*3.14*10^3*t)"%(fd,bw))
frequency deviation = 150 kHz
 Bandwidth = 302 kHz 

 Expression for instantaneous frequency is given by, 
 f = 10^8-150*(10^3)*sin(2*3.14*10^3*t)

Example 5.8, page no-191

In [ ]:
#Variable Declaration
fd=50            #frequency deviation in kHz
fm=1.0           #modulating frequency in kHz for case 1
fm2=100.0        #modulating frequency in kHz for case 2


#Calculation
#for case 1
m=fd/fm
bw=2*(m+1)*fm
#for case 2
m2=fd/fm2
bw2=2*(m2+1)*fm2


#Result
print("For first case\n Modulation index = %.0f \n Bandwidth = %.0f kHz \n\n For second case\n Modulation index = %.1f \n Bandwidth = %.0f kHz"%(m,bw,m2,bw2))

Example 5.9, page no-192

In [11]:
#Variable Declaration
bw=20*10**3    #bandwidth in Hz
fm=1* 10**3    #modulating frequency in Hz


#Calculation
mf=(bw/(2*fm))-1
new_mf=mf*6
new_fm=0.5     #kHz
new_bw=2*(new_mf+1)*new_fm

#Result
print("mf=%.0f\n New modulation index = %.0f\n New bandwidth = %.0f kHz"%(mf,new_mf,new_bw))
mf=9
 New modulation index = 54
 New bandwidth = 55 kHz

Example 5.10, page no-192

In [13]:
#Variable Declaration
fd=75.0     #Maximum allowed frequency deviation in kHz
fm=15.0     #Highest modulating frequency in kHz


#Calculation
D=fd/fm
bw=2*(D+1)*fm

#Result
print("Deviation Ratio, D = %.0f\n Bandwidth = %.0f kHz"%(D,bw))
Deviation Ratio, D = 5
 Bandwidth = 180 kHz

Example 5.11, page no-199

In [15]:
import math

#Variable Declaration
fm=3200.0        #highest frequency component in message signal
k=48000.0        #channel capacity in b/s

#Calculation
fs=2*fm
n=k/fs
n=math.floor(n)

#Result
print("n = %.0f\n L = 2^7 = %.0f\n fs = %.3f kHz"%(n,2**7,(k/7)/1000))
n = 7
 L = 2^7 = 128
 fs = 6.857 kHz

Example 5.12, page no-199

In [16]:
f=2500           #Highest frequency component in the signal in Hz

#result
print("Nyquist rate = 2 x f\n\t      = %.0f Hz = %.0f kHz"%(2*f,2*f/1000))
Nyquist rate = 2 x f
	      = 5000 Hz = 5 kHz

Example 5.13, page no-199

In [17]:
import math
#Variable Declaration
l=128          #no of Quantizing levels
fs=10000.0     #sampling frequency in Hz


#Calculation
n=7            #math.log2(l)
t=1/(n*fs)

#Result
print("Number of bits per sample (n) = %.0f\n Time duration of one bit of binary encoded signal is  %.3f micro second"%(n,t*10**6))
Number of bits per sample (n) = 7
 Time duration of one bit of binary encoded signal is  14.286 micro second

Example 5.15, page no-208

In [19]:
f1=2.4        #first signal frequency
f2=3.2        #2nd signal frequency
f3=3.4        #3rd signal frequency

t


sr=3*(f3*2)
st=10**6/(sr*10**3)
print("Sampling rate of the composite signal = %.1f kHz \nSampling interval of the composite signal = %.0f micro second"%(sr,st))
Sampling rate of the composite signal = 20.4 kHz 
Sampling interval of the composite signal = 49 micro second

Example 5.16, page no-209

In [21]:
import math

bw=3.2          # voice channel band limited frequency in kHz
r=1.2           # 1.2 times the Nyquist rate
n=24.0          # no of  voice channel
b=8.0           # 8-bit PCM
sr=2*bw*r
p=10**6/(sr*10**3)
N=(n*b)+1
bit_d=p/N
bit_d=math.ceil(bit_d*1000)/1000
tr=1/bit_d

print("Number of bits in each frame = %.0f \nBit duration = %.3f micro second \nTransmission rate = %.3f Mbps"%(N,bit_d,math.ceil(tr*1000)/1000))
Number of bits in each frame = 193 
Bit duration = 0.675 micro second 
Transmission rate = 1.482 Mbps